Introduction
This tutorial will walk you through several methods for removing software packages from an Ubuntu Linux system. We detail removal options using the GUI (graphical user interface) built in to the Ubuntu Software Center and using the command line.
Prerequisites
- A user account with sudo / administrative privileges to install/uninstall software from Ubuntu
- Access to a terminal window/command line (Ctrl+Alt+T) – optional
7 Ways to Uninstall Ubuntu Packages
Remove With Ubuntu Software Manager
If you run Ubuntu with the default graphical interface, you may be familiar with the default software manager. This graphical tool gives a list of available and installed programs. Launch it by clicking the Ubuntu Software Center icon.
Once the utility loads, there are three tabs across the top:
- All – This lists all available software. You can search this list for new programs to add.
- Installed – This lists only the programs you have installed.
- Updates – This lists any programs that have available updates. You can find more information about the updates from here.
Click the Installed tab. Scroll down the list of programs, then click the Remove button next to the program to uninstall.
Use the Synaptic Package Manager
The default Ubuntu Software Center may not display every application on your system. The Synaptic Package Manager is a more robust application. The Synaptic Package Manager is included by default in some versions of Ubuntu. Use the search bar to find and launch it on your system.
If your system does not include Synaptic Package Manager, use the Ubuntu Software Center to install it.
Once the Synaptic Package Manager loads, use the menu on the left to select Status > Installed. This lists all applications on your system.
To remove an application, highlight it > right-click > select Mark for Removal and then click Apply. This will uninstall the software, but leave the configuration files intact.
To delete the standard configuration files along with the software package, select Mark for Complete Removal instead.
How to Remove Package on Ubuntu From Command Line
Dpkg (Debian Package) is a standard package manager in many versions of Linux. To uninstall a package with the dpkg
command, you need to know the exact name of the package you intend to uninstall.
To list installed packages enter the following into a terminal window:
sudo dpkg ––list
This command lists all the software, but the list may be too long and not helpful.
To make a list easier to browse add the following:
sudo dpkg–query –l | less
If you know the name of the package you want to remove, you can search for it instead:
sudo dpkg–query –l | grep package_name
Replace package_name with the term you are searching for.
If you don’t know the full name, specify part of a name by surrounding it with asterisks (*), as follows:
sudo dpkg–query –l | grep *partial_name*
We suggest copying the exact software package name (right click and copy) for use later on in the removal process.
Note: Using dpkg to remove software packages is not recommended. The recommended option is to use a package manager that will remove all dependencies. For example, dpkg
may remove the specified package, but all of its dependencies will remain on the system and may no longer function correctly.
Apt-Get Remove Command
To remove a specific package, use the apt-get remove
command:
sudo apt-get remove package_name
This command prompts apt to scan through the installed applications and attempt to remove or repair any that are broken.
Apt-Get Purge Command
Replace package_name with the actual package name generated by apt or dpkg.
The remove
command only deletes the software, not the configuration files.
To remove the program and config files, use the purge
command:
sudo apt-get remove ––purge package_name
Clean Command
The apt package manager can also clean up your system.
To delete the cache of old/outdated packages, enter:
sudo apt-get clean
Some programs are installed with dependencies. These are other software packages the program needs to run. It’s possible to uninstall an application, and still have all its dependencies on your system.
This command prompts apt to scan through the installed applications and attempt to remove or repair any that are broken.
AutoRemove Command
The apt package manager can remove orphaned or unnecessary dependencies with autoremove
:
sudo apt-get autoremove
If you have any failed installations, broken dependencies, or corrupted package files, apt can try to repair them with the command:
sudo apt-get –f install
This command prompts apt to scan through the installed applications and attempt to remove or repair any that are broken.
Conclusion
Now you should have a good understanding of several ways to find and remove packages on Ubuntu Linux.
原创文章,作者:carmelaweatherly,如若转载,请注明出处:https://blog.ytso.com/222944.html