Linux uninstall package / software using the CLI

To uninstall a package or software on Linux using the command line, you can use the package manager specific to your distribution.

  • Debian/Ubuntu: The package manager on Debian and Ubuntu distributions is apt, you can use the following command to uninstall a package:
sudo apt remove <package-name>

You can also use the following command to completely remove the package including its configuration files:

sudo apt purge <package-name>
  • Fedora/RHEL/CentOS: The package manager on Fedora, RHEL, and CentOS distributions is yum or dnf, you can use the following command to uninstall a package:
sudo dnf remove <package-name>
  • Arch Linux: The package manager on Arch Linux is pacman, you can use the following command to uninstall a package:
sudo pacman -R <package-name>
  • Gentoo: The package manager on Gentoo is emerge, you can use the following command to uninstall a package:
sudo emerge -C <package-name>

You can also use the package manager’s search function to find the package name before uninstalling it.

For example to find a package name in Ubuntu:

apt search <software-name>

In Fedora:

dnf search <software-name>

And in Arch Linux:

pacman -Ss <software-name>

It’s important to keep in mind that uninstalling a package or software may also remove other packages that depend on it. Before uninstalling, you should review the list of packages that will be removed and ensure that you don’t need any of them.

Leave a Comment