-
-
When software is installed today, the following error occurs: e: sub-process/usr/bin/dpkg returned an error code (1) online query solution, which is misled online, accidentally deleted the dpkg info folder, and then always prompted "dpkg: Warning: the file name list file of the package ****** cannot be found. It is assumed that no file of the package is currently installed in the system. "I checked it online, the configuration file list of each software is saved in the info folder. After trying a lot of online legends, the methods are not easy to use, so I had to sacrifice Google artifacts and finally found a solution in a foreign article to execute the following script #! /Bin/bashset-e # clean out/var/Cache/APT/archivesapt-Get clean # Fill it with all. debs we needapt-Get -- reinstall-dy install $ (dpkg -- Get-selections | grep '[[: Space:] install' | cut-F1) dir = $ (mktemp-D-T Info-xxxxxx) for Deb in/var/Cache/APT/archives /*. debdo # Move to working directory cd "$ dir" # create Debian directory mkdir-P Debian # extract control files dpkg-Deb-e "$ Deb" # Extract File List, fixing up the leading. /And turning//. dpkg-Deb-c "$ Deb" | awk '{print $ NF}' | cut-C2-| sed-E's/^ \/$ /\/. /'> Debian/list # figure out Binary Package name Deb =$ (basename "$ Deb" | cut-D _-F1) # copy each control file into place CD Debian for file in * do CP-a "$ file"/var/lib/dpkg/INFO/"$ Deb ". "$ file" Done # Clean Up CD .. rm-RF debiandonermdir "$ dir" is used to download all installed software packages and Copy the extracted file list information to the info folder. After the execution is complete prompt x11-common empty file list, unknown reason, can only execute replacement method, copy the x11-common file from another Ubuntu, but still prompt dpkg warning, such as chrome, the software had to be manually installed, and the problem was solved after chrome and WPS were manually re-installed. APT-Get and dpkg finally had no warning. Although the problem is solved, I don't know whether to solve it completely. For the moment, I just need to reinstall it if there is a problem. Wow ~
how to delete the/var/lib/dpkg/INFO folder of dpkg by mistake Zhuan