In our previous post, we showed you how to install deb packages. In this case, we’ll be teaching you different ways you can easily remove deb packages from your system.
Remove DEB Packages
In this case we’ll be using the different methods: apt-get
and dpkg
to remove all unwanted deb packages:
The first thing we need to do regardless if we are using apt-get
or dpkg
we need to get a list of all the packages installed on our system, with the intent of knowing the name of the package itself. This can get done with the dpkg -l
(--list
) command:
dpkg --list
This command will output something like this:
From there you can scroll down using the arrow keys on your keyboard and get exact name of the package you want to remove, in our case: google-chrome-stable
apt-get
With the apt-get
command we can use the --remove
flag only if we want the configuration data to also remain on the system, but if not, we can use the --purge
flag to remove the package as well to remove the configuration data:
sudo apt-get --remove remove package_name # configuration data will remain, package will get removed
sudo apt-get --purge remove package_name # configuration and package will get removed from your system
dpkg
Similar to the apt-get
command we can use the --remove
or -r
flag to indicate that we want to remove the package in question:
sudo dpkg -r package_name
sudo dpkg --remove package_name
Summary
In this short and quick guide you learned how you can easily through different methods remove deb packages. Whether you opt to use dpkg
or apt-get
, either will get the job done.