1. Download a dconf-editor, the command is as follows:
sudo apt install dconf-editor
2. Open the running interface and the command is as follows:
dconf-editor
3. Enter the following path: org >> gnome >> desktop >> input-sources
4. Click to enter xkb-options, fill in ['caps:swapescape'] in the Custom value , and click to confirm.