Ubuntu is one of the widely used Linux distributions. Many people, including me, started my Linux journey with it. It is one of the best Linux operating systems for familiarizing yourself with the Linux environment, and the easy-to-use user interface plays a huge role.
If you have freshly installed Ubuntu, you might have noticed that it has a lot of additional packages installed that might not be useful for everyone.
PS: The word ‘package’ in this article is very similar to the software/app we usually refer to while using Windows.
So let’s talk about removing the packages on Ubuntu, whether they were pre-installed or you installed them yourself and no longer needed them. We have several options to do the same, starting with the easiest one.
Ways to Uninstall a Package on Ubuntu | GUI & Terminal
1. Uninstall Ubuntu Packages using Synaptic Package Manager via GUI
Ubuntu Software Center was discontinued long ago and hence will not be covered in this tutorial. The best alternative is Synaptic Package Manager, which is not pre-installed, so we must install it first.
- Open Terminal.
- Type
sudo apt install synaptic
- Enter the password if prompted, and then type ‘y’ to confirm the installation.
- Open the App Drawer from the bottom-left corner of the screen.
- Search for the synaptic package manager and open it.
- Enter password when prompted.
- Search for the package you want to uninstall.
- Right-click and select “Mark for Complete Remove.” Click Apply to execute the action.
- Confirm the action again and wait for it to complete.
2. Uninstall Ubuntu Packages with apt or apt-get via Terminal
Apt or apt-get is one of the best package managers for Ubuntu and is pre-installed. Generally, you can use both apt and apt, but we prefer apt over apt-get.
- Open the terminal.
- Type
sudo apt remove {package-name}
Replace {package-name} with the package name that you want to uninstall.
In this case, we are uninstalling transmission.
- You will likely be prompted to enter the password since we are using sudo unless you have entered it earlier in the present terminal session.
- Type y and press enter when prompted for confirmation.
- The package has now been removed from your system.
3. Uninstall Ubuntu Packages using dpkg via Terminal
dpkg is also pre-installed on Ubuntu systems and can be used to manage packages. Follow the process below to uninstall a package using dpkg on Ubuntu:
- Type
sudo dpkg -r {package-name}
- Type the password if prompted for sudo privileges.
4. Uninstall Ubuntu Packages with snap via Terminal
snap also comes pre-installed with Ubuntu. Here are the steps to follow:
- Type
sudo snap remove {package-name}
- Type the password when prompted and wait for the process to finish.
One thing we noticed while using snap is that not all the packages are listed there. We wanted to uninstall the transmission, but it was not listed there. You can check all the packages that can be uninstalled using snap.
sudo snap list
How to Remove Unnecessary Dependencies via Terminal
Many packages are dependent on several other packages to function correctly. But when you remove that package, those extra packages installed on your system will remain and consume space.
- Use the following command to get rid of all the unnecessary dependencies :
sudo apt autoremove -y
Also read: How to Deploy Laravel to Production Server on Ubuntu with GitHub
So that was all. Although we have mentioned various methods in this tutorial, we highly recommend sticking with apt for package management. If you have any questions, let us know in the comment section below.