If you’re like most people, you probably use software on your computer without even thinking about it. But what if you need to uninstall that software? In this article, we’ll show you how to uninstall software in Linux using the command line. First, open a terminal window and type the following command: sudo apt-get remove For example, if you want to uninstall the Firefox web browser, you would type: sudo apt-get remove firefox ..

How to Uninstall Software Using the Command Line on Ubuntu

If you’ve installed software from the Ubuntu software repositories using the Ubuntu Software Center, you can use the Ubuntu Software Center to uninstall that software as well. However, if you’re more comfortable using the command line, we’ll show you an easy way to see what’s installed on your system and uninstall programs.

The command line uninstallation methods will work with any Debian-based Linux distribution, not just Ubuntu.

If you have an idea of what you want to uninstall, but you don’t know the exact name, see our article about finding out exact package names in Linux. You can also use the “dpkg” command to see a list of all installed packages on your computer. Press Ctrl+Alt+T to open a Terminal window, then enter the following command into the prompt:

Or:

The commands will display the same content, but it’ll be displayed a little differently.

Scroll through the list of installed packages in the Terminal window to find the one you want to uninstall. Note the full name of the package.

To uninstall a program, use the apt command, which is the general command for installing programs and manipulating installed programs. For example, the following command uninstalls gimp and deletes all the configuration files, using the purge command.

Enter your password when prompted and press Enter.

The uninstallation process begins and a summary of the actions to be taken displays. When asked if you want to continue, type a “y” and press Enter.

The installation process continues. When it’s done, type “exit” at the prompt and press “Enter” to close the Terminal window, or click the “X” button in the upper-left corner of the window.

If you don’t want to remove the configuration files, simply substitute the command removefor purge, as shown in the following command.

Programs installed in Linux — just like Windows and MacOS — depend on other packages to function. When you uninstall a program, there may be packages that the uninstalled program depended upon that are no longer used. To remove any unused packages, use the “autoremove” command, as shown in the following example.

You can combine the two commands for removing a program and removing dependencies that are no longer being used into one, as shown below (two dashes before “auto-remove”).

If you’re short on space, you can use the “clean” command to remove downloaded archive files, as shown below.

This command removes the aptitude cache in “/var/cache/apt/archives”. When you install a program, the package file is downloaded and stored in that directory. You don’t need to keep the files in that directory. However, there is a potential drawback from deleting them: if you decide to install any of those programs again, the packages will have to be downloaded again.

The APT is a handy tool that makes downloading, installing, and uninstalling programs quick and easy. For more information about using the “apt” command, type “apt” at the prompt and press Enter.

The older “apt-get” command will accept most of the same arguments as the “apt” command demonstrated here, and you can use that instead if you prefer it.

RELATED: apt vs. apt-get: What’s the Difference on Linux?

How to Uninstall Software Using the Command Line in Fedora

Fedora is another popular Linux distribution, but uses a different package manager named DNF. Fortunately, DNF shares a lot its syntax with APT — that means if you’re familiar with APT from Debian, you won’t have a difficult time using DNF.

RELATED: What Is Fedora Linux?

Open up a Terminal window — or just type in the command-line interface (CLI) — and run the following command to list the installed libraries and programs. It’s handy if you know what you want to remove but don’t recall the specific name.

Scroll through the list until you find the program that you’re looking for.

There are two quick ways to remove a program using DNF.

sudo dnf remove — Removes only the specified program. sudo dnf autoremove — Removes the specified program and any additional dependencies it installed.

Remove is generally a safer command than autoremove. Autoremove has occasionally been known to get a bit overzealous and remove something it shouldn’t. If you don’t care too much about making sure stray dependencies get removed, just use sudo dnf remove.

Enter the following command into the Terminal or CLI, then enter your password.

For example, if you wanted to remove the GIMP from your PC, it’d look like this:

Just enter “y” and GIMP will be removed.

If you use autoremove instead, the prompt will list the specific program you want to remove, as well as any dependencies that installed with it. Otherwise, it works just like remove.

Fedora is usually pretty good at grabbing only the correct dependencies, but if you notice something on the “Removing Unused Dependencies” list that you’d like to keep, you can manually flag it to be kept. Enter the following command in a command line to keep a dependency:

Accidentally uninstalling a package isn’t a big deal — just use dnf install (package) to reinstall it.

Of course, adding and removing packages is only the beginning of running a Linux installation. There are a handful of other basic commands that you should know if you’re going to use Linux regularly.

RELATED: 10 Basic Linux Commands for Beginners