Debian

How to Uninstall Package on Debian 12

How to Uninstall Package on Debian 12

Debian is a popular Linux distribution that provides a user-friendly interface and various package managers. You can install, configure, and uninstall the packages from your system using numerous available package managers. The package managers can either be GUI or command line based; some are installed on your system by default, while some need to be installed. Each package manager has a specific method to install, run, and uninstall the package.

It is important to install packages on your system, and equally important to uninstall unused packages. The reasons are these packages are occupying your storage space and are one of the reasons for slow system performance. There are various ways to uninstall the packages on the Debian system, and we are going to discuss them in detail in the next section of this post.

Quick Outline

  • How to Uninstall Package on Debian 12
  • How to Remove Broken Packages on Debian 12
  • Conclusion

How to Uninstall Package on Debian 12

The following are the two methods to uninstall a package from your Debian 12:

  • Through GUI
  • Through Command Line

Note: In order to uninstall any package from Debian, you will need administrative rights.

How to Uninstall Package on Debian 12 Through GUI

On Debian, you can remove the packages from the GUI using the following two ways:

  • Gnome Software
  • Synaptic Package Manager

1: Uninstall the Package on Debian 12 From Gnome Software

Gnome Software is a built-in GUI tool that manages the packages installed on your Debian system from the official repository. You can use the Gnome Software tool to uninstall or remove any package from your Debian system. For example, to uninstall the GParted package from Debian 12 using the Gnome Software tool, follow the below-mentioned steps:

Step 1: On your Gnome Desktop, click on the Activities option from the left top corner:

Step 2: In the search bar, type software and click on the Software tool to open:


Step 3:
Next, switch to the Installed tab:

Step 4: Look for the GParted tool option and click on the delete icon present in front of the tool name:

Step 5: A pop-up will appear on your screen, click on the Uninstall option:

 

As soon as you enter the password, the installation process starts and completes within seconds.

 

2: Uninstall Package on Debian 12 from Synaptic Package Manager

Synaptic Package Manager is another GUI tool pre-installed in the Debian system that uses the apt package manager to install, update, and remove packages from the system. To uninstall or remove the packages on Debian 12 using the Synaptic Package Manager, perform the below steps:

Step 1: Navigate to Activities, and search for Synaptic Package Manager:

Note: Ensure entering the administrative password to continue.

Step 2: Click the Search icon to search for the package:

Step 3: Type the name of the package you want to remove on Debian, and then click on the Search button:

Step 4: All the relevant packages will appear on your screen, click on it and choose Mark for Removal from the available options:

Step 5: Next, click on the Apply option to apply all the marked changes:

Step 6: A prompt will appear on your screen, asking for confirmation, click on Apply:

You have successfully uninstalled the Gparted from your Debian system, click on Close:

 

How to Uninstall Package on Debian 12 Through Command Line

The other approach to uninstall the package on Debian 12 is through the terminal. You can use four different package managers on Debian 12 to install, run, and deploy the packages on Debian. You can use these packages to easily uninstall packages from the system with all its dependencies and configuration files:

Let’s discuss the uninstallation commands of these package managers on Debian 12.

 

How to Uninstall Package on Debian 12 Using apt Package Manager

Apt (Advanced Packaging Tool) is a default command line package manager that is used to install, upgrade, update, and uninstall packages from the system. This package manager automatically installs dependencies on your system and installs the packages with their primary names on your system.

To view the list of all installed packages on Debian 12, execute the following command:

apt list --installed

You can search for a specific package name on Debian 12 by piping the above command with the grep command followed by the package name:

apt list --installed | grep <package_name>

In the below command, I have searched vlc in the list of installed packages of Apt:

apt list --installed | grep vlc

The apt command provides numerous options to

 

1: Uninstall a Package from Debian 12

To uninstall a package on Debian 12, use the below general syntax:

sudo apt remove [package-name]

In the following example command, I have uninstalled the vlc from my system:

sudo apt remove vlc

The remove command deletes the package binaries but keeps the configuration files and dependencies.

 

2: Remove Unused Dependencies of the Package

During package installation, the software manager often installs additional packages that stay on the system and may affect its performance. To uninstall the package with all its unused dependencies on Debian, run the following command by replacing the [package-name] with the package you want to remove:

sudo apt autoremove [package-name]

3: Remove the Configuration Files of the System

If you want to remove all the configuration files and data of the specific package, then use the purge command:

sudo apt purge [package-name]

How to Uninstall Package on Debian 12 Using dpkg Package Manager

The dpkg or Debian Package Manager is used to install, build, retrieve information, and remove the Debian packages. Run the following command to view the list of all the installed packages on your system:

dpkg --list

To remove a package using the dpkg tool on Debian, execute the following command and replace the [package-name] with the name of the package you wish to remove:

sudo dpkg --remove [package-name]

Alternatively, you can remove all the configuration files and data of a package on Debian 12 through the below-given command:

sudo dpkg --purge <package name>

Example: In the following example, I have used the remove command to uninstall the vlc from Debian 12:

sudo dpkg --remove vlc

 

How to Uninstall Package on Debian 12 Using Snap Package Manager

The Snap package manager is an independent package manager used to install the applications on your system without the need to install any additional dependencies or libraries. It installs the packages in a bundle in a sandbox environment. This means if you uninstall a package using Snap, it will delete all the files and associated data of that package.

First, execute the following command to get the list of installed Snap packages on Debian 12:

snap list

The syntax to remove the package from Debian 12 using the Snap package manager is mentioned below:

sudo snap remove [package-name]

Example: In the following example, I have uninstalled Spotify from Debian 12 using the snap remove command:

sudo snap remove spotify

 

How to Uninstall Package on Debian 12 Using Flatpak Package Manager

The Flatpak package manager provides an efficient way to manage the packages on Debian 12. You can easily install and run the applications on your system in a sandboxed environment, meaning the installed applications do not interfere with the other packages on the system. Using this package manager, you can install the packages with all the required libraries and dependencies into a single bundle. If you don’t want to use a specific installed package on Debian, you can remove it anytime using the uninstall command:

To remove the package using the Flatpak package manager on your system, you will need an application ID of the desired package. If you do not know the application ID of the package, then run the following command to get detailed information about the package:

sudo flatpak search --columns=application [package-name]

The general syntax for removing the package from Debian 12 using the flatpak package manager is written below:

sudo flatpak uninstall [application ID]

Example: In the below example, I have searched Skype to get its application ID using the following command:

sudo flatpak search --columns=application skype

Once you get the application ID of the Skype, execute the below command to uninstall it from Debian 12:

sudo flatpak uninstall com.skype.Client

The Skype package is successfully uninstalled from your Debian 12.

 

How to Remove Broken Packages on Debian 12

In the following command, the clean removes the cache of retrieved package files from the archives’ directory, and the autoremove options delete all the unnecessary files, like dependencies that are no longer needed:

sudo apt clean && sudo apt autoremove -y

Adding -f flag with apt command followed by the install option will fix the broken dependencies and data corruption issues in the system:

sudo apt -f install

Then use the following command to reconfigure all the unpacked packages on Debian:

sudo dpkg --configure -a

 

Conclusion

Managing packages on Debian 12 is a straightforward process, as there are numerous package managers available. You can use the Gnome Software tool and Synaptic Package Manager to install and uninstall the package from the system through GUI. Alternatively, you can use apt package manager, snap, flatpak, and dpkg to uninstall the packages from your system through the terminal. You can also sudo apt-get clean && sudo apt-get autoremove to delete all the broken packages from the Debian system. We have discussed the commands used to uninstall the packages using these package managers in the above section of this guide.

 

Similar Posts