How to Install .deb files in Ubuntu 22.04

How to Install .deb files in Ubuntu 22


Installing software on Ubuntu traditionally involves package management systems like APT, but installing .deb files offers a more direct approach. This method allows users to manually install applications without relying solely on the official repositories. Whether it’s proprietary applications or custom-built software, knowing how to install .deb files on Ubuntu plays a pivotal role in expanding the capabilities of your system, providing a versatile and efficient way to enhance your software ecosystem.

Ubuntu is one of the most user-friendly and hence a greatly popular Linux distributions globally. However, a simple task as installing a third-party software can seem tedious when coming over from Windows. For Ubuntu you don’t get executable files, rather you get Debian packages (aka .deb files). Whether you’re a seasoned Linux user or a newcomer exploring the operating system, this guide will equip you with the knowledge and confidence to handle .deb files. Let’s dive in.

Updating the installed packages

Running the following command is considered a best practice before installing any .deb packages:

$sudo apt update && sudo apt upgrade -y

This command sequence initiates an update of the package manager’s repository information, fetching the latest version details of available packages. Subsequently, it upgrades installed packages to their most recent versions, applying essential security patches and bug fixes.

This proactive approach minimizes the risk of compatibility issues or conflicts with older library versions or dependencies that the new .deb package may rely on. By keeping the system up-to-date, users can foster a more stable and secure environment, enhancing the overall reliability of the software installation process and reducing the likelihood of encountering unforeseen complications during the installation of the Debian package.

Method 1: Install .deb files through the dpkg utility

dpkg is a command-line utility that comes out of the box with Ubuntu and many other Linux distributions. You can use it to install .deb files. Open up the terminal containing your deb file and run the following command to start the installation:

$sudo dpkg  -i [filename]

The “-i” option tells the dpkg utility to install the deb package. Let’s say that you have the deb file of TeamViewer already downloaded. Open up the terminal in the directory containing the .deb file and run the following:

$sudo dpkg -i teamviewer_amd64.deb

This will install the latest version of the tool contained in the deb package.

Uninstalling with the dpkg command

If you want to uninstall the tool with the dpkg command you’ll need to replace the “-i” option with the “-r” option, like so:

$sudo dpkg -r teamviewer

Method 2: Install .deb files through the APT Package Management System

The APT package manager is generally available in all Linux distributions. By using it, you can install different packages directly from the official Linux repository. Not just that, you can also use it to install .deb files.

If you already have a deb file downloaded, you can go ahead and install it using the following:

$sudo apt install ./[filename]

Similar to the last method, open up your terminal in the directory with the TeamViewer deb file. Here, you can install the tool through the deb file, using the following command:

$sudo apt install ./teamviewer_amd64.deb

Running it will install the tool completely.

Uninstalling through the APT Package Manager

As you’ve installed the application through the terminal, if you want to remove the package at this point, you can uninstall it using the following command:

$sudo apt purge teamviewer

Just enter “Y” here and press enter to proceed with the process. Running this command will not just remove the tool, but it will also remove any configuration files associated with the tool.

Method 3: Install .deb files through the GUI

If you don’t want to get down with the commands and get your hands dirty in the terminal, you can simply install the deb package through the Ubuntu Software Install utility.

In your file explorer, navigate to the directory containing your deb file. Right-click on it and select “Open with other Application”.

In the next dialog box, select “Software Install” and then click on the green “Select” button.

Now the Ubuntu Software Center will open up and you can see details of the deb package. Here you need to click the green “Install” button to start the installation process.

Before the installation starts, you will need to authenticate the process with your admin password, and then the tool will be installed.

Uninstalling through the GUI

Like the installation process you can open up the deb file through the “Software Install” option. Here you can remove it through the red button with a bin on it.

Conclusion

Installing Debian (.deb) files on Ubuntu 22.04 can be achieved through various methods, offering users flexibility based on their preferences and familiarity with different tools. The dpkg command provides a direct and powerful approach, allowing users to manually manage package installations. Apt, on the other hand, streamlines the process by handling dependencies automatically and simplifying package management, providing a convenient way to install .deb files on Ubuntu. Additionally, users who prefer a graphical interface can leverage the GUI tools available in Ubuntu to further simplify the process of installing .deb files with a more visually intuitive approach. Whether opting for the command line with dpkg and apt or utilizing the graphical interface, Ubuntu 22.04 accommodates diverse user needs for seamless and efficient package installations, making it easy to install .deb files on Ubuntu.