In this guide, we want to teach you to Install Deb Files (Packages) on Ubuntu 22.04.
A DEB file is a software package used by the Debian Linux distribution and its variants, such as Ubuntu. DEB files are used primarily to install or update Unix applications. Each DEB file is a standard Unix archive that contains two TAR archives: one for installer control information and another for installable data.
Steps To Install Deb Files on Ubuntu 22.04
To complete this guide, log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide on Initial Server Setup with Ubuntu 22.04.
In this guide, we will show you how to install Deb packages from the CLI:
- GDEBI Package Manager
- dpkg Package Manager
- APT Package Manager
Install Deb Packages with GDEBI Package Manager
GDEBI is a package installer to install Debian executable packages on the Debian-based distribution of Linux.
The Gdebi package manager is not installed by default in Ubuntu 22.04. To install it, run the command below:
sudo apt install gdebi -y
When your installation is completed, you can use it to install any local deb file.
sudo gdebi /path/package_name.deb
The above command will install the deb file for you automatically.
Install Deb Files with dpkg Package Manager
dpkg is a tool to install, build, remove, and manage Debian packages. The dpkg is already installed by default in all Debian-based systems. You can use its switch “-i” to install any deb files.
sudo dpkg -i /path/package_name.deb
However, dpkg may give you a dependency error while installing the package.
dpkg: error processing package
If it gives such an error, then run the following command to install the pending dependencies:
sudo apt install -f
Install Deb Files with APT Package Manager
At this point, you can easily install any deb files with Apt on Ubuntu 22.04.
To install deb files with APT, you can use one of the following commands:
# sudo apt install ./package_name.deb # sudo apt install /path/package_name.deb
Uninstall Deb Packages from Ubuntu 22.04
At this point, if you want to uninstall your deb files, you can easily use the following command with the actual name of the package:
sudo dpkg -I package_name.deb
Also, you need to use one of the commands below to remove it from your system:
# sudo apt remove package_name # sudo dpkg -r package_name
Finally, you can use the command below to remove any unwanted package that may have been there in your Ubuntu 22.04:
sudo apt autoremove
At this point, you have learned to Install Deb Files (Packages) on Ubuntu 22.04.
Hope you enjoy it. For more guides and articles, you can visit the Orcacore website.