Easy Methods To Install Deb Files on Ubuntu 22.04 – OrcaCore
This guide will walk you through the process of how to Install Deb Files on Ubuntu 22.04. A DEB file is a software package format predominantly used by Debian Linux distributions and their derivatives, most notably Ubuntu. These files are the primary means of installing or updating Unix applications on these systems. Each DEB file is essentially a standard Unix archive, comprising two TAR archives: one containing installer control information and the other containing the installable data itself.
Let’s delve into the methods you can use to Install Deb Files on Ubuntu 22.04. Follow the guide steps on the Orcacore website to learn how you can install deb file Ubuntu 22.04.
Before we begin showing you how to Install Deb Files on Ubuntu 22.04, ensure you are logged in to your Ubuntu 22.04 server as a non-root user with sudo privileges. If you haven’t already configured this, refer to our guide on Initial Server Setup with Ubuntu 22.04.
This guide will demonstrate how to install Deb packages from the command-line interface (CLI).

Method 1. Install Deb Packages with GDEBI Package Manager
GDEBI is a dedicated package installer designed specifically for installing Debian executable packages on Debian-based Linux distributions like Ubuntu.
The Gdebi package manager isn’t installed by default in Ubuntu 22.04. To install it, execute the following command:
sudo apt install gdebi -y
Once the installation is complete, you can use GDEBI to install any local .deb file.
sudo gdebi /path/package_name.deb
This command will automatically install the specified .deb file, resolving dependencies as needed.
Method 2. Install Deb File Ubuntu with dpkg Package Manager
dpkg
is a fundamental tool for installing, building, removing, and managing Debian packages. It is pre-installed on all Debian-based systems. You can use the -i
switch to install .deb files.
sudo dpkg -i /path/package_name.deb
However, dpkg
may encounter dependency errors during the installation process.
dpkg: error processing package
If you encounter such an error, run the following command to install any pending dependencies:
sudo apt install -f
This command will instruct APT to fix broken dependencies, allowing the installation to proceed.
Method 3. Install Deb Files with APT Package Manager
You can install .deb files directly using 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
If you need to uninstall a .deb package, you can use the following command, replacing package_name.deb
with the actual name of the package file:
sudo dpkg -I package_name.deb
Then, use one of the following commands to remove the package from your system:
# sudo apt remove package_name
# sudo dpkg -r package_name
Finally, you can use the following command to remove any unneeded packages that may be lingering on your Ubuntu 22.04 system:
sudo apt autoremove
Alternative Methods to Install Deb Files
While the above methods are effective, here are two alternative approaches to installing .deb files on Ubuntu 22.04:
1. Using the GUI (Graphical User Interface):
Ubuntu provides a simple graphical way to install .deb files. This method is suitable for users who prefer a visual interface.
- Explanation: Simply navigate to the directory containing the .deb file using the file manager. Double-click the .deb file. This will typically open the Ubuntu Software Center (or another default package installer) which will then guide you through the installation process. The GUI automatically handles dependency resolution, making it a user-friendly option.
2. Using apt-get
with a Local Repository:
This method is particularly useful when you have multiple .deb files that you want to install together, or when you want to manage .deb files more systematically.
-
Explanation: This method involves creating a local repository containing your .deb files. APT can then treat this directory like any other software repository. This enables features like dependency resolution and simplifies future package management.
-
Steps:
-
Create a Directory for the Repository:
sudo mkdir /opt/localrepo
-
Copy .deb Files to the Repository Directory:
sudo cp /path/to/your/package1.deb /opt/localrepo/ sudo cp /path/to/your/package2.deb /opt/localrepo/ # Copy all your .deb files
-
Create the Packages Index:
This step generates the necessary index file for APT to recognize the repository.
sudo apt-ftparchive packages /opt/localrepo/ > /opt/localrepo/Packages
-
Add the Repository to APT’s Source List:
Create a new file in
/etc/apt/sources.list.d/
to define the local repository.echo "deb [trusted=yes] file:/opt/localrepo ./" | sudo tee /etc/apt/sources.list.d/localrepo.list
The
[trusted=yes]
option skips the usual GPG signature check, since you are using a local source. -
Update APT’s Package List:
sudo apt update
-
Install Packages:
Now you can install packages from your local repository using APT:
sudo apt install package1 package2 # Replace with the actual package names (not the .deb file names)
APT will automatically handle dependencies within the local repository.
-
-
Benefits: Centralized management of .deb files, dependency resolution, and integration with APT’s update mechanisms.
Conclusion
Installing a .deb file on Ubuntu 22.04 is straightforward, and multiple methods are available to suit different user preferences and scenarios. At this point, you have learned to Install Deb Files (Packages) on Ubuntu 22.04 using command-line tools and a graphical interface, as well as how to create a local repository for managing .deb packages.
Hope you enjoy it. Also, you may like to read the following articles:
Ubuntu 22.04 Check Disk Space
OpenJDK 19 Ubuntu 22.04
Install Nagios Ubuntu 22.04
Samba Share Ubuntu 22.04
Memcached installation Ubuntu 22.04
XWiki Setup Ubuntu 22.04
FAQs
What is a .deb file?
A .deb file is a Debian package file format used to install software on Debian-based Linux distributions like Ubuntu 22.04.
Is there a graphical way to install a .deb file?
Yes, double-click the .deb file to open it on your Ubuntu desktop with the default Software Installer and follow the prompts.