Home ยป How to Uninstall Packages Marked “rc” on Debian/Ubuntu Linux: A Complete Guide

How to Uninstall Packages Marked “rc” on Debian/Ubuntu Linux: A Complete Guide

by vpsa.eu
Linux VPSA.eu

If you’ve ever used the dpkg command to check the status of packages on your Debian or Ubuntu system, you might have come across some marked with the status “rc”. This can be confusing if you’re not familiar with the terminology. So, what does “rc” mean, and how do you get rid of these packages? Let’s break it down.

Understanding the “rc” Status

In the context of dpkg, “rc” signifies a package that is in a “removal-pending” state with configuration files remaining. Here’s what each letter means:

  • r: The package has been marked for removal.
  • c: The configuration files associated with the package are still present on the system.

This usually happens when you’ve attempted to remove a package but the process was interrupted, or if the package was removed manually without properly removing its configuration files.

Why Remove “rc” Packages?

While “rc” packages don’t necessarily harm your system, they do occupy disk space and can potentially cause conflicts with other packages. It’s good practice to clean up these leftover packages to keep your system tidy and avoid any potential issues.

How to Uninstall “rc” Packages

Here are the steps to uninstall packages marked “rc” on Debian or Ubuntu Linux:

1. Identify “rc” Packages

First, let’s find out which packages are in the “rc” state. Open a terminal and run the following command:

dpkg -l | grep "^rc"

This will list all packages with the “rc” status. Take note of the package names you want to remove.

2. Uninstall the Packages

Now that you know which packages to remove, use the apt command with the purge option to uninstall them along with their configuration files:

sudo apt purge <package-name1> <package-name2> ...

Replace <package-name1>, <package-name2>, etc. with the names of the packages you want to remove. The purge option ensures that the configuration files are also deleted.

4. Verify the Removal

After the uninstallation process completes, verify that the packages and their configuration files have been removed by running the same command again:

dpkg -l | grep "^rc"

This time, the output should be empty, indicating that there are no more “rc” packages on your system.

Additional Tips

1. Uninstalling Multiple Packages: If you have a long list of “rc” packages to remove, you can use a command like this to purge them all at once:

sudo apt purge $(dpkg -l | grep "^rc" | awk '{print $2}')

2. Force Removal: If you encounter any errors during the removal process, try adding the –force-yes option to the apt purge command. This will force the removal of the packages, even if there are potential issues.

Warning: Use caution when using the –force-yes option, as it can potentially remove essential packages if not used carefully.

Preventing “rc” Packages in the Future

To avoid accumulating “rc” packages in the future, make sure to use the apt command with the purge option when removing packages:

sudo apt purge <package-name>

This will ensure that the configuration files are removed along with the package, preventing them from becoming “rc” packages.


By understanding the meaning of the “rc” status and following the steps outlined in this guide, you can easily uninstall packages marked “rc” on your Debian or Ubuntu system. Regular maintenance and cleanup of your package list can help keep your system running smoothly and efficiently.

You may also like

Leave a Comment