Clear the configuration file of the deleted software package in Debian

Source: Internet
Author: User
In Debian, clear the configuration file of the deleted software package-Linux Release Technology-Debian information. For more information, see the following. This article is Wang Xu original, and use the aptitude account published in the north mail BBS (http://bupt.org/) Linux version.

Today, I cleaned up the system and used a command line, which may be of reference value to others.

Dpkg-l | grep "^ rc" | awk '{print $2}' | xargs aptitude-y purge

Purpose:

Delete the residual configuration file of the deleted software package. Purge can be cleared only when the remove package in debian does not delete the configuration file, but it is removed automatically based on the dependency. It takes a long time to complete the manual operation, there will inevitably be a lot of unnecessary configuration files left, which is annoying, so the above operations are involved.

Note:

1) dpkg-l

Lists the status of all packages installed in the system. packages starting with 'II' are installed normally, while packages starting with 'rc 'are deleted but still leave the configuration file, in other States, there is an error. Once you execute the command, you can see that the beginning of the output result is described.

2) grep "^ rc"

Extract the information of a package starting with rc, that is, the information of the package that is deleted but still contains the configuration file.

3) awk '{print $2 }'

Print the package names. They are located in the second field of the dpkg-l output result. It is estimated that many people use this command to recognize awk, many users only use awk in this command line. I am one of them.

4) xargs aptitude-y purge

Put the above output, that is, put the package name of the configuration file to be cleared after aptitude-y purge. The purge command will clear the configuration file, the-y parameter will automatically prompt the following aptitude command to answer: this switch is usually dangerous, so do not use it easily in general, but here, if you are sure that the configuration files of these packages are cleared, you can use this switch.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.