banner
huqingye

huqingye

Uninstalling Applications on Linux with apt

Uninstalling Packages Using the Command Line
All operations that can be performed using GUI tools can also be executed from the command line. In fact, the command line provides you with more options and controls for uninstalling packages.

You can open the terminal by using the keyboard shortcut Ctrl+Alt+T or by clicking on the terminal icon.

Before uninstalling a package, you must first find the exact package name. To get a list of all installed packages on your system, perform the following steps:

sudo apt list --installed
This command will print a long list of installed packages. It is best to pipe the output through less to make it more readable. Alternatively, you can use grep to filter the results.

On Ubuntu, Debian, and related Linux distributions, you can use the apt and apt-get command-line utilities to install, update, uninstall, and manage packages. The syntax for both of these commands is the same.

To remove an installed package, run the following command:

sudo apt remove package_name
Replace package_name with the name of the package you want to remove.

sudo apt-get remove package_name
You can also uninstall multiple packages. Separate the package names with spaces:

sudo apt remove package1 package2
The remove command will uninstall the given packages, but it may leave behind some package files. If you want to remove the package along with all its files, use purge instead of remove:

sudo apt purge package_name
Uninstalling Snap Packages
If the application you want to uninstall is not listed when running sudo apt list --installed, it may have been installed as a snap package.

To list all installed snap packages, run the following command:

snap list
Once you know the exact package name, you can uninstall it by typing the following:

sudo snap remove package_name
Uninstalling Unused Packages
Whenever you install a new package that depends on other packages, the dependencies of that package are also installed. After uninstalling a package, the dependent packages will be left on your system. These leftover packages will no longer be used by anyone and can be removed.

You can remove unwanted packages using the following method:

sudo apt autoremove

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.