Completely remove software and configuration files under Linux __linux

Source: Internet
Author: User
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.

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.