cd /var/lib/dpkg
sudo mv info info.bak #that is, back up an info
sudo mkdir info #Create a new info directory
Then use the following command to reinstall those error packages
sudo apt-get –reinstall install package name
At first, I wanted to install several packages at the same time in one command, but the result still appeared E: Sub-process /usr/bin/dpkg returned an error code (1) . So delete the new info and install them one by one. After each package is installed, delete the info and create a new one, so there is no prompt E: Sub-process /usr/bin/dpkg returned an error code (1) up.
Finally replace the new info with the original info.bak
sudo -rf info
sudo mv info.bak info
After entering sudo apt-get update, sudo apt-get upgrade and sudo apt-get autoremove, there is no E: Sub-process /usr/bin/dpkg returned an error code (1).