Debian – How to remove a software installed by dpkg -i FILE.deb

debiandpkg

For example, Opera web browser is distributed as a deb file, and can be installed by the command dpkg -i opera.deb. How to remove it?

Best Answer

First, find out what the package name is (which may or may not be the same or even similar to the .deb filename...but usually is at least similar):

dpkg -I opera.deb | grep 'Package:'

then remove that package, using either dpkg or apt-get (or apt or aptitude etc etc etc).

dpkg -r packagename

Optionally use --purge rather than -r if you want to completely remove the package, including conffiles.

You can even remove it in one line with something like this:

apt-get purge $(dpkg -I opera.deb | awk -F: '/Package/ {print $2}')
Related Question