How to remove package ubuntu
How to remove package ubuntu
How to uninstall package on Ubuntu
A “package” is a compressed file archive that contains all of the files that come with a given application in Linux distributions. New software for Linux-based PCs is delivered and maintained by a package. Executable installers are used in the same way as executable installers are used on Windows-based machines.
In this article two ways to uninstall a package from the Ubuntu system are discussed. You can follow any of the two according to your requirements.
Uninstalling Package Using Software Center of Ubuntu
Software center is like the App store of Apple and allows you to install and uninstall packages. If you are a new user and find the command line difficult then you can uninstall the package through the software center if it’s installed by Ubuntu software center.
Step 1: Open Ubuntu Software Center
Click on icon of Software Center from the list of icons on left side of Ubuntu screen:
Step 2: Open installed apps
Click on installed tab on Ubuntu software center:
Step 3: Remove Package/App
Now you can remove any package which is present in installed packages of Ubuntu software center. I am removing Document Scanner from installed packages by clicking on the “Remove” button in front of package to be removed:
A dialogue box will appear, click on Remove:
Uninstalling Package on Ubuntu Using Command Line
Some installed packages are not available in “installed packages” of Ubuntu software center so we can remove them using the terminal. There are three ways to remove package using command Line:
Uninstalling Package using “apt” : The best way is to use the “apt” command to remove packages.
The apt( Advance Packaging Tool) is the default package manager of Ubuntu.
Set the package-name which you want to remove.
Example: Run the below mentioned command to remove “nodejs” package from Ubuntu system:
In place of “nodejs” write the name of the package you want to remove.
Uninstalling Package Using “dpkg”: We can also remove package from system using dpkg command, dpkg is a Debian package manager that allows you to install, build, uninstall, and manage packages:
Change “package-name” according to your requirement.
Example: Run the below mentioned command to remove “make” package from Ubuntu system:
In place of “make” write the name of the package you want to remove.
Uninstalling Package using “snap”: Although the Snap package manager is very new, it is included in all current Ubuntu editions. To uninstall packages, which were installed as snap packages you need to run the snap command which works independent of apt command. The syntax is given below:
Set “package-name” which you want to remove.
Example: Run the below mentioned command to remove “rocketchat-server” package (which is installed as snap package) from Ubuntu system:
In place of “rocketchat-server” write the name of the package you want to remove.
Uninstalling unnecessary Packages : Your package management may download dependencies that are required to correctly install a package while installing some software. These dependencies will remain on your system after it finishes installing a package, but they will be unused. As a result, it’s a good idea to run the following command on a regular basis to clear out any unwanted packages from your system.
Run the below mentioned command to remove unused packages:
Conclusion
To free up the space occupied by some unused packages, Ubuntu allows you to remove these unnecessary packages from your system. In this article we discussed in detail how to uninstall unwanted packages using the Ubuntu software center and using the command line in which commands are discussed to remove packages from the system; using apt, dpkg and snap. Read the article carefully to uninstall unnecessary packages from your Ubuntu system.
About the author
Alishba Iftikhar
I am currently an undergraduate student in my 1st year. I am an internee author with Linuxhint and loved learning the art of technical content writing from senior authors. I am looking forward to opting my career as a full time Linux writer after I graduate.
How do I uninstall a package in Ubuntu?
In this tutorial, we will talk about how you uninstall a package in Ubuntu distribution using both methods: either using the GUI or by using the command-line environment.
Prerequisites
To uninstall or remove a package from the Ubuntu Linux system, you must have root privileges to run the terminal commands.
Methods to uninstall a package in Ubuntu 20.04 system
Using the following two ways, you can uninstall a package from the Ubuntu 20.04 operating system:
Method 1: Uninstall a package using the Terminal (Command-line method)
Most Ubuntu Linux users prefer to use the command-line method to uninstall or remove an application from the Ubuntu system. The command-line method offers more control and options for uninstalling the packages.
List installed Ubuntu packages
It is necessary to know the exact package name to uninstall a software or package from your Ubuntu system. Therefore, in Ubuntu 20.04 system, you can view the installed packages by using the following command:
The above command displays the large list of installed packages on your system. but, it would be difficult to find the exact package name from the displayed, installed packages list. To view output in the more readable form, use the ‘less’ with the above command as follows:
Press enter to move on to the next package.
You can also search the exact package name from the whole list by using the grep command as follows:
For example, to find all ‘apache2’ packages, use the below-mentioned command:
Commands to remove a package using Terminal in Ubuntu
The following four most commonly used commands that help you to remove a software package or an application from the Ubuntu system:
Uninstall a package using the ‘remove’ command
To uninstall or remove a package from the Ubuntu system, use the ‘apt-get remove’ command followed by the package name as follows:
You can also remove more than one package at the same time by using the following command syntax:
For example, we want to uninstall ‘zip’ and ‘wget’ packages from the Ubuntu system. Use the below-mentioned command to uninstall these packages:
Uninstall package using ‘purge’ command
The ‘apt-get remove’ command removes the entire package from your Ubuntu system. But, it leaves some packages and configuration files behind on your system. However, to completely uninstall a package including all configuration files, use the ‘purge’ instead of executing the ‘remove’ command. The following ‘purge’ command is used to uninstall a package from the Ubuntu system completely:
For example, to uninstall apache2 packages along with all configuration files from your system, use the below command:
Uninstall unused packages
When you install an application on Ubuntu, it may also download and install the dependencies required to install the application properly. When you uninstall the required packages, the packages dependencies still linger in your system but are unused. These leftover or unused packages can remove from the Ubuntu system by executing the following command:
You can also clean the outdated/ old packages from the cache by running the below-mentioned command:
Uninstall snap packages
The snap package manager is a part of the new Ubuntu versions. So, when you independently uninstall a package using snap, you need a list of all installed snap packages. Using the below-given command, you can easily display the list of all installed snap packages:
Once the installed snap packages list is obtained, use the following command to uninstall the snap package:
For example, to uninstall the ‘discord’ application from the snap list, use the following command:
Method 2: Uninstall a package from Ubuntu using the GUI
The alternative way to uninstall a package is using the Ubuntu software center. The software package manager is available on the left sidebar of your Ubuntu desktop. To access this application click the ‘Ubuntu software’ icon or launch it using the application search bar as follows:
The following Ubuntu software manager window shows on your system. Click on the ‘Installed’ tab to see all installed packages. Here, you can search for an application that you want to uninstall from your Ubuntu system.
Select the application that you want to remove from your Ubuntu machine as follows:
Conclusion
We learned different commands through which you can easily uninstall a package or software from your Ubuntu 20.04 system. Moreover, we also demonstrated how to remove or uninstall a package using the GUI of the Ubuntu software center. You can adopt any method from either uninstalling a package via command-line or using the GUI; these methods are useful for every Linux user.
About the author
Samreena Aslam
Samreena Aslam holds a master’s degree in Software Engineering. Currently, she’s working as a Freelancer & Technical writer. She’s a Linux enthusiast and has written various articles on Computer programming, different Linux flavors including Ubuntu, Debian, CentOS, and Mint.
Uninstalling Packages With Apt Package Manager
In this module, we are going to learn the steps for uninstalling packages with apt from our Debian/Ubuntu systems.
Table of Contents
Find The Package You Want To Uninstall
First things first, we need to find the package which we want to uninstall. We can very easily locate our package’s exact name with the following :
This helps us to locate the exact package which we would require for the future steps. Once, we have located out desired package, we can move onto the next step.
Uninstalling Packages With Apt
When talking about uninstalling packages using apt package manager, we have the following two options :
1. Using apt remove
To remove a package using ‘remove‘ simply type :
2. Using apt purge
We can very easily remove packages with the ‘purge’ command as such :
The primary difference being ‘remove‘ and ‘purge‘ is that ‘remove‘ only gets rid of the package leaving any configuration files untouched. Whereas ‘purge‘ not only removes the package but also removes all configuration files OUTSIDE THE HOME DIRECTORY.
A Fun Little Secret
Quite contrary to what their primary function is, both ‘purge‘ and ‘remove‘ can be used to INSTALL packages. This can be achieved by appending a ‘+‘ at the end of the package name as such :
Post Uninstall Clean Up
At this point, we have successfully removed/purged our package. Now, we can run some commands to perform post-removal clean up out of good practice
We can clear the cache of the old/outdated packages with :
We can remove unrequired packages with :
Finally, any failed/broken installs can be fixed with :
Conclusion
Thus we learnt how we can easily remove packages from Debian/Ubuntu based system using the apt package manager.
How to completely remove a package in Ubuntu
In general, when you install any package in Linux the dependency packages also get installed alongside.
Dependency packages are necessary to run a application without any issues.
When the package is uninstalled, the dependency packages will stay on the system. These leftover packages are no longer used by anything and it is safe to remove them.
Identifying a package in Ubuntu
We should be knowing the exact package name to uninstall it. The package can be identified using the ‘apt’ command and we should be aware few letters about a package which can help to identify the package easily instead of checking all of them on the system.
Using apt command
Using dpkg command
1) Removing a package using apt command
apt is a command-line utility for installing, updating, and removing deb packages on Ubuntu, Debian, and their derivatives. It combines the most commonly used commands from the apt-get and apt-cache.
The below command is used to remove the binaries, but not the configuration or data files of the package. It will also leave dependencies associated with it.
The following command removes the package including all its files but not the dependencies installed with it.
Run the below command to remove orphaned packages.
2) Removing a package using apt-get command
apt-get is a CLI package management tool that is widely used on Debian based systems. The apt-get command allows us to Install, update, and remove packages, while the apt-cache command is used to search for new packages.
Run the following commands to completely remove a package from the system.
3) Removing manually installed package
If you had installed a package using make file, it will be uninstalled in the same procedure. Please navigate to the package directory and follow the below steps to remove it.
For demonstration purposes, we will be uninstalling the node package using the make file.
How to Uninstall | Delete Packages on Ubuntu 18.04
This brief tutorial shows you how to uninstall or delete packages on Ubuntu 18.04 | 16.04 systems.
If you’re a student or new user looking for a Linux system to start learning on, the easiest place to start is on Ubuntu Linux OS…. It’s a great Linux operating system for beginners.
Ubuntu is an open source Linux operating systems that runs on desktops, laptops, server and other devices…
Students and new users will find that Linux isn’t so different than Windows and other operating systems in so many ways, especially when it comes to managing installed programs and packages.…
Both Ubuntu and Windows systems allow you to be productive, easy to use, reliable and enable you to install and run thousands of programs from gaming to productivity suite software for individuals and businesses.
However, when you’re learning to use and understand Ubuntu Linux, you will also want to learn some basic tasks like install and uninstall packages using the command line.
Most Linux users can do some basic command line tasks. This tutorial is going to show you how….
On Ubuntu, applications are available in two formats:
Snap packages are referred to as snaps and Debian packages are referred as deb. If an app is available in both formats, Ubuntu Software list the snap apps first.
Uninstalling Packages via Ubuntu Software Center
New users and students who are not yet familiar with the command line, Ubuntu desktop come with a GUI package manager called Software Center. This utility provides a graphical user interface (GUI) to find, install, and uninstall applications and packages.
To remove or uninstall packages via Ubuntu Software Center, follow the steps below:
Click the Ubuntu Software icon in the Dock, or search for Software in the Activities Overview search box to bring up Software Center.
When Ubuntu Software opens, click the Installed button at the top to list all the installed applications on the system.
Look through the list of installed applications and find the one you want to remove.
Install packages are listed alphabetically. When you find the apps, select to highlight it.
Then click the Remove button. you will be asked to confirm that you want to remove the application. Next, you will be asked to authenticate by entering your password. After you have done that, the application will be removed.
On Linux systems there’s something known as app dependencies. some applications depend on others to function properly. if you attempt to remove an application that is need by others, all the others will be removed as well along with the apps you’re uninstalling.
You will be asked to confirm whether you want this to happen before the applications are removed.
Uninstall Packages via Command Line
For students who are comfortable with the command line, the steps below show you how to remove or uninstall packages using the command line utility.
Just like above where you search for all installed packages, you can use the apt list command to list all packages that are installed.
Example, run the commands below to list all install packages.
That should list all installed package.
To remove a package you find on the list, simply run the apt-get or apt command to uninstall it.
sudo apt remove package_name
Replace package_name with the package you wish to uninstall.
To uninstall multiple packages, run the commands below
sudo apt remove package_name_1 package_name_2
To completely remove packages and their configuration settings file, you use apt get with purge options.
sudo apt purge package_name
For Snap package, you can list using the commands below:
Remove Snap packages using the commands below:
sudo snap remove package_name
Congratulations! You have learned how to uninstall packages from Ubuntu using the GUI Software Center as well as apt command line tool.
You may also like the post below:
Published by Richard
In my spare time, I research topics that are interesting and worthwhile for users and students who want to try something new. I, too, am a student and my focus here is to help other students and new users get started with managing Ubuntu Linux, Windows, Content Management Systems (CMS) and others.
I try to do my best explaining the topics and detailing the instructions so that anyone can understand. These tutorials may not work in all situations and for all users. However, if you run into trouble, please ask your questions below and I or someone from the community may help you resolve. Thanks for reading and hope you come back.