In this article we will show you how to Remove Package on Ubuntu From Command Line. Ubuntu Desktop is a Linux distribution developed by Canonical, and itโs one of the most popular distros, thanks to its ease of use. Itโs also one of the top choices for people who are getting started with Linux. The server edition, which we wonโt be focusing on here, is also operating in the majority of internet servers.
So what is a Linux distribution? Itโs an operating system developed from the Linux kernel, UNIX-like system created by Linus Torvalds in 1991. It is one of the best operating system for hackers and for professional users like developers and coders, Linux distributions are usually free and open source, and many are great alternatives to popular operating systems like Windows and Apple Laptops macOS.
If thereโs software on your Ubuntu Linux system that you wish to remove, there are a few ways to go about uninstalling the associated packages. Since Ubuntu can install packages through apt or through Snap. Below we mentioned the steps to Remove Package on Ubuntu From Command Line.
How to Use Command Line to Remove Package on Ubuntu
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 in Ubuntu, 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.
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 purgecommand:
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.
Final Words
We hope you like this article on how to Remove Package on Ubuntu From Command Line. If you know how to use CLI and you are familiar with different commands then your work will be completed fast as compared to using GUI. You can perform multiple tasks by entering commands in the CLI.
I hope you understand this article, Remove Package on Ubuntu From Command Line.