How to completely uninstall applications by command line in Ubuntu

Uninstall Ubuntu Software and clean-up obsolete dependencies

-Advertisement-

Uninstalling the software from the command line via Terminal is one of the most important tasks while dealing with troubleshooting a remotely connected Ubuntu PC. In today’s Terminal Tuts session, let’s take a deep dive into it.

Uninstalling Software from Terminal in Ubuntu

The following guide is tested on Ubuntu 17.10 but should work on older Ubuntu versions as well as Linux Mint, and elementary OS.

Step 1) To uninstall a software package, you need to know the exact name of it. We shall use the tdpkg list command for it. Launch ‘Terminal’ and enter the following command:

dpkg --list
-Advertisement-

You should see a long list of applications. Note down the name of the program which you want to uninstall. For example, I want to remove VLC Media Player, which is listed as just ‘vlc’.

dpkg --list command listing all apps in Ubuntu 17.10 Terminal
dpkg –list command listing all apps in Ubuntu 17.10 Terminal

Step 2) To uninstall a program, we shall use remove command along with apt-get, which is typically used to install applications. Of course, sudo command to carry out superuser tasks. There are two important things to consider on what’s your uninstallation plan.

Keep Personalized Settings:

-Advertisement-

If you are removing a program only to reinstall later, then you may want to keep the configuration files, which will remember your settings applied in that app. In such a case, use the remove command as follows:

General format:

sudo apt-get remove package_name

In my case, to remove vlc:

-Advertisement-
sudo apt-get remove vlc

Complete Uninstallation:

On the other hand, use –purge command to completely uninstall the app if you plan not to reinstall the app.

sudo apt-get --purge remove package_name
sudo apt-get --purge remove vlc

Some Housekeeping

Now that you have uninstalled the software, you may want to do some extra cleanup to remove the dependencies of the software you uninstalled now or may be in the past. Dependencies are the apps and libraries that are used by the software you no longer have in your PC. Note that it is entirely safe to do so because no application is using them.

sudo apt-get autoremove

As you see autoremove command is generic cleaning command for any obsolete packages that are left over in your PC.

-Advertisement-
Kiran Kumar
Hi there! I'm Kiran Kumar, founder of FOSSLinux.com. I'm an avid Linux lover and enjoy hands-on with new promising distros. Currently, I'm using Ubuntu as a daily driver and run several other distros such as Fedora, Solus, Manjaro, Debian, and some new ones on my test PC and virtual machines. I have a day job as an Engineer, and this website is one of my favorite past time activities, especially during Winter ;). When I'm not writing for FOSSLinux, I'm seen biking and hiking on scenic trails. I hope you enjoy using this website as much as I do writing for it. Feedback from readers is something that inspires me to do more and spread Linux love!. If you find a time, drop me an email or feedback from the 'Contact' page. Or simply leave a comment below if you found this article useful. Have a good day!

5 COMMENTS

  1. I’m new to command line and terminal. Being a “neat freak”, I really appreciate this info on keeping my system clean…thank you!

  2. Thanks. A very lucid post :).

    I have been struggling with removing Postman (an API tool).

    Postman is a native app that has been installed to /opt and I can see its folders and files there..
    however when I try to uninstall it using Ubuntu Software center, or Synaptic or apt or just list it using dpkg – all of the above do not show any postman files.
    Any idea what to do??

Leave a Reply to Arek Cancel reply

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,637FansLike
361FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

Top 20 Git Commands with Practical Examples

If you are here reading this post, there is a high probability that you have heard or interacted with Github, and you now want to learn Git. Before we continue with showing you some of the cool Git commands, let's understand the difference between Git and GitHub.

Top 10 New Features in Linux Kernel 5.7

Linus Torvalds has announced the release of Linux Kernel 5.7 after seven weeks of development. The release announcement comes as a piece of exciting news as it brings a host of new features for the hardware manufacturers as well as the developers.

How to install CMake on Ubuntu

CMake is a cross-platform free and open-source software tool designed to build, test, and package the software. CMake uses a simple platform and compiler-independent configuration files to control the software compilation process.

How to install Lightworks on Ubuntu

Even though Linux may not get a native installer of video editing software like Adobe Premiere or Final Cut Pro, that doesn't mean there are no industry standards tools available. Lightworks is non-linear editing (NLE) video mastering app for Windows, Linux, and macOS. Installing it on Ubuntu is simple due to deb package availability.

How to install DaVinci Resolve on Fedora

Davinci Resolve is a professional application used for color correction, video editing, visual effects, and motion graphics. It is one of the extensively used software by movie industries located in Hollywood.

The 10 Best Programming Languages for Hacking

One of the significant entities we have in Cyber Security is Ethical Hacking (ETH). It is the process of detecting and finding flaws or vulnerabilities in a system that a hacker would exploit.

MUST READ

Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.
Elementary OS 5.1 Hera has received a point release with a handful of new features and bug fixes, and we will be reviewing the significant changes in this article. For those new to elementary OS, this Ubuntu-based Linux distribution uses their inhouse built Pantheon desktop environment and AppCenter.

5 Best Download Managers for Linux

We often need to download large files that can go corrupt due to various reasons such as slow internet or interrupted download. Using a broken downloaded file is not something one wants. Download managers make sure that the downloaded file maintains its integrity and also presents you with the ability to pause and resume downloads, provided the server supports it. When you are downloading a massive file, it's recommended to use a download manager.

CopyQ – Advanced clipboard manager for Linux

We have all had that moment when we copied a text, but we first needed another one, and in the process, lost the first one. If you're lucky, you can get it back quickly with a bit of work.

15 Tar command in Linux uses with examples

Tar is a famous utility that is basically used for collecting multiple files in a single archive. This file is often called a 'tarball'. Today, we are going to tell you about the different things you can do with tarballs using the tar command, with practical examples.

Installing multiple Linux distros on a USB drive

A bootable Linux USB drive, which also referred to as a Live USB drive, is a drive containing files that enable a computer to boot into a specific Linux distro. It is most commonly used to test-drive various Linux distros before installing on the computer for use as a daily driver.