The Wayback Machine - https://web.archive.org/web/20241105143457/https://www.geeksforgeeks.org/how-to-uninstall-packages-with-apt-package-manager-in-linux/
Open In App

How to Uninstall Packages With Apt Package Manager in Linux

Last Updated : 22 Jun, 2022
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

The apt command is a sophisticated command-line tool that interacts with Ubuntu’s Advanced Packaging Tool (APT) to execute tasks including installing new software packages, updating the package list index, and even upgrading the whole Ubuntu system. Along with this, we can uninstall or remove the downloaded packages from the system. So in this article, we will go through the steps of uninstalling the packages from the Ubuntu system.  

These are some following methods in Linux to delete packages using apt-package manager:

  • Uninstall the program using apt purge
  • Uninstall the program using the apt remove
  • Remove broken packages or packages which weren’t fully installed

Let’s go through both methods one by one.

Get the List of Installed Packages

sudo apt list

This command will show you a list of all the packages you’ve installed. You can skip this step if you already know the name of your package.

apt list

 

Method 1: Uninstall the program using apt purge:

sudo apt purge <package name>

Using apt to delete packages is the same as using apt-get to install it. 

For this article, we will be going to remove firefox along with its configuration.

 

Method 2: Uninstall the program using apt remove:

sudo apt remove <package name>

 

To avoid confirmation, you can alternatively use the “-y” option,

sudo apt remove -y <package name>

 

For Post uninstall clean Up

sudo apt clean && sudo apt autoremove

 

  • clean: Removes the cache of programs that are older than the one that was installed.
  • autoremove: Removes files that are no longer needed, such as dependencies.

Method 3: Remove broken packages or packages which weren’t fully installed:

sudo apt clean && sudo apt autoremove
sudo apt -f install
sudo dpkg --configure -a
remove_broken_packages_cmds

 

  • -f install: Fix any broken dependencies and any potential package corruption issues.
  • dpkg –configure -a: Reconfigure an unpacked package and “-a” means all unpacked but configured packages are configured.

What’s the difference between ‘remove‘ and ‘purge‘?

You must be thinking that what’s the difference between the “remove“ command and the “purge“ command. On executing the “remove” command it will keep the package’s configuration files after the uninstallation while the “purge” command will delete the package’s configuration files after the uninstallation.



Similar Reads

Difference Between APT, APT-GET, APT-CACHE and APT-CONFIG
apt, apt-get, apt-cache, and apt-config lie in some specific roles within the Debian package management system. Apt (Advanced Package Tool) is a high-level interface for managing software packages combining the functionalities of apt-get and apt-cache. In this article, we discuss on each component and its play of distinct roles in Debian systems. T
4 min read
sudo apt-get update vs sudo apt-get upgrade: Key Differences Explained
Two basic commands you are likely to utilize when managing software packages on an Ubuntu system are sudo apt-get update and sudo apt-get upgrade. Understanding the differences between these commands is essential for maintaining your system safe and secure. This article will go into detail regarding each command, describing its purposes, best pract
10 min read
How to uninstall packages from Linux?
In this article, we will learn to uninstall the different types of packages from Linux. Let's understand the uninstalling process through some examples: Example 1: Uninstall a package using apt-get In this example, we will remove GIMP, a graphics software that was installed with the help of apt-get. Step 1: To list all the apt-get packages, enter t
2 min read
How to speed up the downloading of packages using apt-fast in Ubuntu?
While updating or installing new packages in ubuntu we often experienced slow downloading speed even while our network connection is running fine. To get around this and speed up the downloads, we use apt-fast wrapper. apt-fast is a shell script wrapper for "apt-get" and "aptitude". It improves downloading speed for packages by providing a correspo
2 min read
Using Synaptic Package Manager to Download a Package in Linux
Synaptic package manager is GTK-based graphical user interface based on Advanced Package Tool, or APT for download or removes packages on Debian based system like Ubuntu. We can download packages by using the apt command, but the GUI interface is always user-friendly and easy to use. To install synaptic package manager run the following command on
3 min read
How to Install apt-listchanges package on Ubuntu?
Upon collecting the appropriate items from the Debian changelog and NEWS files, the utility apt-listchanges may compare a new version of a package with the one presently installed and display what has changed. It may be run on multiple.deb archives at once to get a list of all changes that would result from installing or updating a set of packages.
3 min read
How To Install apt-offline package on Ubuntu?
Apt-offline adds offline package management features to Debian-based systems. It may be used to download packages and dependencies that will be installed later (or necessary to update) in a disconnected system. Packages can be downloaded from another connected PC. It may also get bug reports for the downloaded packages. Apt-offline is an Offline AP
3 min read
How To Install apt-mirror package on Ubuntu?
This is a tiny utility that allows you to mirror any (or all) of the Debian and Ubuntu GNU/Linux distributions, as well as any other apt sources generally offered by open source developers. This tutorial will walk you through the process of setting up repository mirrors for Ubuntu 20.04 and Ubuntu 18.04. The same procedure applies to each previous
2 min read
How to Install apt-transport-https package on Ubuntu?
Apt-transport-https is a fake transitory package; in 1.5, https support was relocated into the apt package. It is safe to remove. This is a fake transitory package; in 1.5, https support was relocated into the apt package. It is safe to remove. This is a fake transitory package; in 1.5, https support was relocated into the apt package. It is safe t
3 min read
How to Install apt-file package on Ubuntu?
Apt-file is a software program that indexes the contents of packages in your accessible repositories and allows you to search for a certain file among all available packages. Apt-file is a command-line utility for searching files in APT packages. You may search for which package a file is in or show the contents of a package without installing or d
2 min read
How to Install apt-show-versions package on Ubuntu?
If you are using any Linux Distributions like Ubuntu OS, you should know the process to Manage & Verify Installed Packages there. And for that purpose, the Apt-Show-Versions Package on Ubuntu will be the best. With the Ubuntu Apt-Show-Versions Package, you can list down the Ubuntu Packages present in the device. In this article, we will discuss
4 min read
How to Fix apt-get command not found in Linux
Linux, celebrated for its power and versatility, can occasionally pose challenges, especially for newcomers. The apt-get command, a vital tool for package management in Debian-based Linux distributions like Ubuntu, is essential for installing, updating, and managing software. However, you may encounter the vexing error message: "apt-get command not
5 min read
apt-get command in Linux with Examples
The command-line tool `apt-get` is the most popular package management tool used in our Debian-based Linux operating system. This article provides an overview of `apt-get` and its basic syntax. It will include the most commonly used commands, their syntax, description, and examples. It also gives an explanation of the contrast to other Linux distri
15+ min read
apt command in linux with examples
apt provides a high-level Command Line Interface (CLI) for the APT package management system, offering a user-friendly interface intended for interactive use. It simplifies common tasks like installation, upgrades, and removal, with better defaults than more specialized tools like apt-get and apt-cache. Syntaxapt [...COMMANDS] [...PACKAGES]Where, C
5 min read
sysget - Front-End For Every Package Manager in Linux
There are lots of package managers for various Linux distros, for example, apt (Ubuntu), yum (legacy Fedora), dnf (Fedora) but remembering them all is quite a headache. So for that reason, there is a utility called sysget, which is a front-end for every package manager in Unix-like operating systems. So that you don't need to learn about every pack
2 min read
Nix - The Purely Functional Package Manager for Linux
Nix is a purely functional package manager for Linux, that serves to provide a purely functional approach to any system's software package management. Due to its functional and declarative approach, it is lauded for its capacity to: Support the installation of multiple versions of a given package.Enable atomic upgrades and rollbacks of a given pack
5 min read
How to Install a New Package Manager in Linux
Linux offers several package managers for software installation, updates, and maintenance. In Linux, every distribution comes with a package manager by default. The Debian distribution comes with APT(Advanced Package Tool), Red Hat, and its derivatives such as CentOS and Fedora use YUM package management.However, there may be cases when you need to
4 min read
Uninstall Linux completely from a PC with Windows
We would learn here how to completely uninstall any Linux OS from PC through Windows. This is a procedure that involves to steps-> (i) Delete Linux Partition (ii) Remove Linux OS from EFI System Partition You must be thinking what is EFI System Partition? The EFI system partition (ESP) is a partition on a storage device that is used by computers
2 min read
Uninstall Node.JS Using Linux Command Line
To uninstall Node.js from your Linux system, you can use the command line, and the process will vary depending on how you originally installed it. Whether you used a package manager like apt, installed Node.js using nvm (Node Version Manager), or manually installed it from a binary file, you can easily remove Node.js from your system by following t
3 min read
YUM vs. APT: What's the Difference?
Yum and APT are two of the most popular package management systems in the Linux world, and they are used on various Linux distributions, such as Red Hat-based Linux use yum (Yellowdog Updater Modified) and Debian-based systems use apt (Advanced Packaging Tool). When it comes to updating package information and keeping your system up to date, both A
4 min read
What is the difference between yum and apt-get?
Package management is a fundamental aspect of any Linux distribution, as it allows users to easily install, update, and remove software packages. Two widely used package managers in the Linux world are yum and apt-get. In this article, we will delve into the details of these package management tools, explain how they work, and highlight the key dif
2 min read
Difference Between APT and DPKG in Ubuntu
The installation, updating, and removal of software are all important functions in the Ubuntu operating system and heavily rely on package management. Two common tools used to manage packages include APT and DPKG, which stands for Debian Package. DPKG is considered the low-level package manager because it makes direct installations and removals of
5 min read
How to Convert .rpm package to .deb using alien Package Converter?
Most of the time there are packages (in repositories and GitHub) that are ready to use. But sometimes packages are not available in binaries (ready to install on the go) we have to download the source code and build from scratch. This is not an issue if you have time but for increasing Productivity. Here is where Alien (package converter) comes int
2 min read
How to Install and Configure Synaptic Package Manager in Ubuntu?
Synaptic Package Manager is a GUI based package management tool that uses APT (Advanced Package Tool) to installing, updating or removing packages from the Linux system. Some of the feature given by Synaptic Package Manager are: Allow installing, updating or removing packagesUpgrading whole systemSearching and filtering the list of packages availab
1 min read
What is Fedora's DNF package manager and how to use it?
A package manager is a program that helps you to manage and install and manage apps and their dependencies on a system. While Debian-based systems have dpkg and APT as their package managers and Arch-based systems have Pacman, Fedora-based systems use DNF. What is DNF?DNF or Dandified YUM is the package manager of Fedora and Fedora derivatives and
5 min read
Snap Package Manager on Ubuntu
Snap is a package management system and software deployment. Generally, these packages are termed as snaps. The tool for using snaps is termed as the snap. Snaps are app packages for cloud, IoT and desktop that are easy to install, and cross-platform. Snaps works across all the Linux distributions so it activates the utilities and latest apps for t
4 min read
How to Install Linux Packages Inside a Docker Container?
Once you understand how to pull base Docker Images from the Docker registry, you can now simply pull OS distributions such as Ubuntu, CentOS, etc directly from the Docker hub. However, the OS Image that you have pulled simply contains a raw file system without any packages installed inside it. When you work on projects inside Docker Containers, you
2 min read
Linux - Installing PIP to Manage Python Packages
Python is the most popular language for a decade, and we all know that python had a huge support of libraries that are used in different sectors of Software Engineering. Meanwhile, PIP also getting its fame along with python in Linux and developers community.PIP is a package manager for python in handling the software packages that are developed us
2 min read
How to Install Packages in Python on Linux?
To install a package in python, we use pip. The pip is a python package manager. In this tutorial, we will be discussing how we can install packages in python on a Linux system. To install packages in python on Linux, we must have python and pip installed on our Linux machine. As python comes preinstalled with the Linux system, we may have to insta
2 min read
How to Install RPM Packages on Linux?
Red Hat Package Manager or RPM is a free and open-source package management system for Linux. The RPM files use the .rpm file format. RPM package manager was created to use with Red Hat Linux, but now it is supported by multiple Linux distributions such as Fedora, OpenSUSE, Ubuntu, etc. RPM packages can be cryptographically verified with GFG and MD
2 min read
Article Tags :
three90RightbarBannerImg