Clean up the system today, using a command line that may be of reference value to others
Dpkg-l |grep "^RC" |awk ' {print $} ' |xargs aptitude-y
Use:
Deletes the residual configuration file for a package that has been deleted. Because the remove package in Debian will not remove the configuration file, purge can be cleared, but automatically removed according to the dependency relationship is remove, in addition to their own miss operation, so used a long time, it is inevitable that a lot of unnecessary configuration files, more annoying, so have the above operation.
Description
1) dpkg-l
Lists the status of all packages installed in the system, ' II ' at the beginning of the normal installation of the package, ' RC ' at the beginning of the deletion but still leave the configuration file package, the other state is the wrong state, the implementation of their own once understood, the output of the beginning of the results are explained.
2) grep "^RC"
Extracts a package that starts with an RC, which is the row of information that is deleted but still remains in the configuration file's package.
3 awk ' {print $} '
Print the names of these packages, they are located in the second field of the output of dpkg-l, it is estimated that a lot of people through this command to recognize awk, there are many people only on this command line to use awk, I was one of them.
4 Xargs aptitude-y purge the output, which is the name of the package to clear the configuration file, is placed behind the Aptitude-y purge, the purge command clears the configuration file, and the-y parameter automatically answers the prompt for the following aptitude command. A switch is usually dangerous, so don't use it easily in general, and here you can use this switch if you are sure that the configuration files for these packages are clean.