If you are new to Ubuntu, installing, removing, or updating deb files may be challenging. Deb files are installation packages that allow you to install new software or applications on your system. This guide will demonstrate how to install or remove Deb file installations on Ubuntu 22.04 Jammy Jellyfish or Ubuntu 20.04 Focal Fossa with the command line terminal.
Table of Contents
Installation of Deb Files on Ubuntu
The Terminal application can install deb files on Ubuntu, which can be opened using the Ctrl+Alt+T keyboard shortcut or by searching for “Terminal” in the applications menu.
Download the Deb File:
Before installing a deb file, download it from a trusted source. You can usually find deb files on the official website of the software you want to install or from trusted third-party sources.
Open the Command Terminal:
Open the command terminal after downloading the deb file. You can do this by pressing the Ctrl+Alt+T keys on your keyboard or searching for “Terminal” in the applications menu.
Here is an example to download Discord as a .deb file using the command line terminal:
wget "https://discord.com/api/download?platform=linux&format=deb" -O discord.deb
Navigate to the Download Folder:
Next, navigate to the downloaded deb file’s folder. You can do this using the “cd” command in the terminal. For example, if the file is located in the “Downloads” folder, you can navigate to it using the following command:
Install the Deb File:
Once in the deb file folder, you can install it using the dpkg command. For example, if the deb file is named “software.deb”, you can install it using the following command:
sudo dpkg -i software.deb
For example, Discord would be:
sudo dpkg -i discord.deb
Note that the “sudo” command is used to run the dpkg command as an administrator, which is required for installing software on Ubuntu. If the installation is successful, you will see a message that says, “Setting up software.”
Example of installing Discord from a .deb file on Ubuntu:
Resolve Dependency Issues:
Sometimes, the installation may fail due to missing dependencies. In such cases, you can install the missing dependencies using the following command:
sudo apt-get install -f
This command will install any missing dependencies and complete the installation process.
Removal of Deb Files on Ubuntu
Removing deb files is also a straightforward process that can be accomplished using the command terminal. Here is a step-by-step guide to help you remove a deb file from your Ubuntu system:
Identify the Package Name:
Before removing a deb file, you need to know the name of the package that it belongs to. You can find the package’s name using the dpkg command with the “-l” option. For example, to list all installed packages that begin with the letter “g,” you can use the following command:
dpkg -l | grep "^ii" | grep "g"
This will list all installed packages that begin with the letter “g.” Note down the name of the package that you want to remove.
Uninstall the Package:
Remove the package using the dpkg command with the “-r” option once you know the package’s name. For example, to remove the package named “gdebi-core,” you can use the following command:
sudo dpkg -r gdebi-core
This will remove the package and any associated files from your system.
In conclusion, installing and removing deb files on Ubuntu is a simple process that can be accomplished using the command terminal. With this guide, you should now be able to install new software and applications, remove unnecessary packages, and easily manage your system. Following these steps, you can keep your Ubuntu system organized and optimized for your needs.