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?

  • 1
    did you try dpkg -r package_name yet ?
    – MelBurslan
    Apr 25, 2016 at 14:43
  • Does man dpkg offer any suggestions? Apr 25, 2016 at 14:59
  • apt-get remove pkgname or apt-get purge pkgname will work, regardless whether it is installed correctly or incorrectly, so long as it is uninstallable. Apr 25, 2016 at 15:02
  • 1
    @FaheemMitha How do I know the pkgname?
    – tmpbin
    Apr 25, 2016 at 15:04
  • 1
    Well, it's probably opera. But try dpkg -l | grep opera and see what you get. Apr 25, 2016 at 15:05

1 Answer 1


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}')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.