Ubuntu

How to Install a deb File by dpkg or by apt in Ubuntu 22.04?

How to install a deb file by dpkg or by apt

Whenever software is to be compiled from the source, it usually comes in packages as compressed archives such as .rpm, .deb, .tar.gz, etc. These packages are then extracted and then installed using a package manager. The “.deb” is a popular software package format used extensively in Linux/Ubuntu. This article demonstrates the installation of a .deb file/package by two popular package managers: dpkg and apt on Ubuntu 22.04 LTS.

How to Install a .deb File/Package in Ubuntu 22.04?

Dpkg and apt are two of the most popular package managers in Linux. The installation of a “.deb” file/package will be demonstrated in the following sections via dpkg and apt package managers:

How to Install a .deb File/Package via “dpkg” Package Manager?

“dpkg” delivers low-level package management, i.e., it does not check and install dependencies. In this section, we will download and install Google Chrome using the “dpkg” package manager by the following steps:

Step 1: Update System Repositories

To update the system repositories, run the following command:

$ sudo apt update

Step 2: Download Google Chrome .deb File

We can download the “.deb” file of Google Chrome from the link and by clicking the “Download” button:

We will be re-directed to the following window, where we can select the “64-bit .deb (For Debian/Ubuntu)” option and press the “Accept and Install” button:

This will start downloading the “.deb” file which will complete in a few seconds and the .deb file will be downloaded in the “Downloads” directory.

Step 3: Install Google Chrome

To install Google Chrome, first navigate to the “Downloads” directory via the cd command:

$ cd Downloads
$ ls

From the above image, it can be seen that the “google-chrome-stable_current_amd64.deb” file is successfully downloaded in the “Downloads” folder. Next, the following command is executed:

$ sudo dpkg -i google-chrome-stable_current_amd64.deb

Enter the sudo password to continue with the installation process. After a few seconds, Google Chrome will be installed.

Step 4: Verification of Installation

We can verify Google Chrome installation by launching it via Ubuntu Desktop’s file manager by clicking on the “Show Applications” button on the bottom left of the screen:

We can then type “Google Chome” in the search bar and select Google Chrome Icon:

After pressing the Google Chrome Icon, Google Chrome Brower will be launched:

How to Install a .deb File by Using “apt” Package Manager?

“apt” (Advanced Packaging Tool) is a high-level package management system and it automatically checks and downloads all dependencies related to the package. In this section, we will download and install Sublime Text using the “apt” package manager using the following steps:

Step 1: Update System Repositories

System repositories will be updated by running the following command:

$ sudo apt update

Step 2: Download Sublime Text .deb File

We can download the “.deb” file of Sublime Text from the link and by clicking the “Download” button:

We will be redirected to the following page, where we can click the “direct downloads” button:

We will be re-directed to the Downloads page, and we can select “64-bit .deb”:

The .deb file will then be downloaded in the Downloads directory.

Step 3: Install Sublime Text

We will navigate to the “Downloads” directory by cd command:

$ cd Downloads

From the above image, we can see that the “sublime-text_build-4152_amd64.deb” file is successfully downloaded, which is installed by the following command:

$ sudo apt install ./sublime-text_build-4152_amd64.deb

Enter the sudo password to continue with the installation process. After a few seconds, Sublime Text will be installed.

Step 4: Verification of Installation

We can verify Sublime Text’s installation by launching via using Ubuntu Desktop’s file manager by clicking on the “Show Applications” button on the bottom left of the screen:

We can then type “Sublime Text” in the search bar and select Sublime Text Icon:

After pressing the Sublime Text Icon, Sublime Text will be launched:

Conclusion

“.deb” file can be installed using dpkg package manager by using the syntax “sudo dpkg -i deb-file.deb” and by default “apt – advanced package tool” by using the syntax “sudo apt install ./deb-file.deb”. This article has demonstrated the installation of the .deb files of Google Chrome and Sublime Text by two popular package managers: dpkg and apt respectively on Ubuntu 22.04 LTS.

Similar Posts