remove apps from terminal

Uninstalling 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) In order to uninstall a software package, you need to know the exact name of it. We shall use dpkg list command for it. Launch ‘Terminal’ and enter the following command:

dpkg --list

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:

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

General format:

sudo apt-get remove package_name

In my case, to remove vlc:

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 completely 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.

Previous articleHow to Enable Tabs in Ubuntu Terminal
Next articleHow to record a screenshot by command line in Ubuntu
Hi there! I'm Kiran Kumar, founder of FOSSLinux.com. I'm an avid Linux lover, and enjoys 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. 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 time, drop me an email or feedback from 'Contact' page. Or simply leave a comment below if you found this article useful. Have a good day!

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Rick Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Rick
Guest
Rick

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