Manual install linux package

Manually install a DEB package on Debian or Ubuntu

Feature image for the article about how to manually install a DEB package on Debian or Ubuntu

Sometimes you want to install software that is not readily available in the Debian or Ubuntu online software repository. Luckily, a lot of third party software providers make a DEB package available for you to install. This article explains how you can manually install software bundled as a DEB package onto your Debian system. Since Ubuntu derives from Debian, the explanation applies to Ubuntu based systems as well.

Background

What actually is a DEB package? A DEB package is a file format that specifies how to bundle and install software on the Debian Linux distribution. Since the Ubuntu Linux distribution derives from Debian, it supports DEB packages for software installations as well.

If you used either Debian or Ubuntu before, you undoubtedly worked with DEB packages already. You just might not have noticed it. All software that these Linux distributions support and maintain are essentially DEB packages. So whenever you install software with APT, under the hood it installs the software from the DEB package. An example for installing the HTOP interactive processes viewer:

In this case APT downloads the HTOP DEB package for your PC’s architecture, from the Debian software repository, and installs it on your system. Theoretically you can download the HTOP DEB package yourself and install it manually. You can find the link to the DEB package of HTOP at the bottom of this page on the Debian website. You can even find a link on the same page for viewing the files inside the DEB package, including their installation destination:

Browser screenshot that shows the file list of the HTOP DEB package from the online Debian repository.

When should you manually install a DEB package?

The Debian online software repository already includes HTOP. For this reason it doesn’t really make sense to manually download and install this DEB package. Just extra work that APT automates for you.

However, situations do exists where you need to install a DEB package manually on your system. When? Basically every time you want to install software or a software version that is not (yet) included in your distribution’s online software repository. Luckily, a lot of third party software providers make a DEB package available for you to install. If not, then you might have to create the DEB package yourself. However, that is outside the scope of this article. I will probably cover the creation of DEB packages sometime in the future though.

Читайте также:  Как изменить имя пользователя линукс

This article explains how you can manually install software bundled as a DEB package onto your Debian system. Two different ways of manually installing a DEB package will be presented:

  1. Manual install of a DEB package using APT in the terminal.
  2. Manual install of a DEB package using the GDebi graphical user interface program.

As mentioned before, Ubuntu derives from Debian. Therefore the explanation applies to Ubuntu based systems as well.

What do you need

To complete the presented instructions, all you need is a Debian or Ubuntu based system. It doesn’t really matter in what format. It can be:

  • A laptop or desktop PC.
  • A VirtualBox virtual machine.
  • A Raspberry PI with the Raspberry PI operating system installed.
  • A home or cloud server.

For this article, I decided on using a VirtualBox virtual machine running Ubuntu Budgie 20.04 “focal”. The virtual machine runs on my laptop, which has Debian 10 “buster” installed with the Gnome desktop environment.

For testing purposes, we’ll manually install the DEB package of the Atom editor. Atom is an easy-to-use programmer’s editor. A large eco-system exists around it, with all sorts of extra plugins and themes for you to install. Although the Atom editor misses from the Debian and Ubuntu online software repositories, they do offer a DEB package for download on their website. With other words, the perfect candidate for this article.

Download the Atom editor DEB package

Let’s get started by downloading the Atom editor’s DEB package. You can either visit the website of the Atom editor. The home page shows the download link for the DEB package. Alternatively, you can paste the following command in the terminal:

wget -O ~/Downloads/atom.deb https://atom.io/download/deb

This stores the atom.deb DEB package in the Downloads directory of your user’s home directory. Going forward with the manual install of the Atom editor DEB package, I assume that you downloaded the atom.deb DEB package to your ~/Downloads directory.

Terminal screenshot of downloading the Atom editor DEB package with WGET.

Manually install a DEB package

I’ll demonstrate two different methods for manually installing a DEB package. First by calling APT directly in the terminal. Then by running the GDebi program for those that prefer a graphical user interface.

Install a DEB package with APT

In the introduction I already mentioned how you usually install a DEB package from the Debian or Ubuntu online software repository:

sudo apt install [PACKAGE NAME]

You can use a similar syntax for manually installing a DEB package from a file:

sudo apt install -f [PACKAGE FILE]

Instead of specifying the package name, you simply specify the location of the DEB package. Additionally you add the -f command line option. This results in APT automatically installing software packages that the DEB package depends on.

Let’s give this a try for installing the Atom editor. Run the following command to manually install the Atom editor DEB package and its dependencies:

sudo apt install -f ~/Downloads/atom.deb

Terminal screenshot that shows how to manually install the Atom editor DEB package with APT.

Once the installation completes, you can find the Atom editor in your desktop environment’s application menu and start it. After starting it for the first time, it looks like this:

Читайте также:  Run kvm on linux

Screenshot that shows what the Atom editor looks like, when you run it for the first time.

Install a DEB package with GDebi

GDebi offer a graphical user interface for the manual install of DEB packages. To install it, simply run the following command from the terminal:

Alternatively, you can install GDebi using your desktop environments software installer. For example Gnome Software:

Screenshot that shows how to install the GDebi program using the Gnome Software application.

Once you installed GDebi, you can find it in your desktop environment’s application menu to start it. In the program menu, you can select FileOpen and browse to the atom.deb DEB package in your ~/Downloads directory:

GDebi screenshot that shows how to open a DEB package.

This loads the DEB package for installation. It automatically determines the package dependencies that should be installed as well. To proceed with the installation of the Atom editor’s DEB package, click the Install Package button on the top right side:

GDebi screenshot that shows how to manually install the Atom editor DEB package.

When the installation finishes, you can find the Atom editor in your desktop environment’s application menu and start it.

Manually remove a DEB package

Removing the manually installed DEB package is the same as for any other package. First remove the package itself with this command:

Terminal screenshot that shows how to remove a previously installed DEB package with APT.

Next, request APT to remove package dependencies that were installed as well and that your system no longer needs:

Terminal screenshot that shows how to run the APT autoremove command for removing package dependencies that are no longer needed on your system.

Wrap up

This article taught you how to manually install a DEB package on Debian or Ubuntu. For testing purposes we used the DEB package of the Atom editor.

You can use APT, assuming that you are comfortable working from the terminal. The command syntax is:

sudo apt install -f [PACKAGE FILE]

Note the importance of the -f command line parameter. You need it to have APT automatically install package dependencies for you.

Alternatively, you can use the GDebi software program, in case you prefer a program with a graphical user interface.

You can also use APT to remove the package and its dependencies from your system. It is a two step process. First remove the actual package and then its dependencies. APT automatically figures out which dependencies it no longer needs:

sudo apt remove [PACKAGE NAME]

Personally, I highly recommend getting comfortable with working from the terminal on Linux. It might strike you as inconvenient at first, but the Linux terminal offers so many powerful tools. Things such as grep, find, awk, sed and many more. As a first practice you can go through the article that teaches you how to edit text files from the terminal with Nano.

PragmaticLinux

Long term Linux enthusiast, open source software developer and technical writer.

Источник

How to Manually Install a Deb Package Using Command Line in Ubuntu

This article will list a few command line methods that can be used to install standalone “.deb” installers that are not available in official repositories of Ubuntu. Some other useful commands helpful for handling “.deb” packages will also be covered. So let’s jump in.

List All Dependencies of a Deb File

The example below shows information about persepolis download manager “.deb” file.

Читайте также:  Linux while on command line

This command is specially useful if you want to check what is being installed beforehand.

List All Files That will be Installed From a Deb Package

To see all files that a “.deb” package will install on your system along with their destination paths, run the command below:

The example below shows files that will be installed on the system if you manually install persepolis download manager “.deb” package. Note that Ubuntu’s apt package manager also lists included files but requires you to install the package first. However, this method doesn’t require you to install the “.deb” package and it is really useful if you want to analyze which file goes where.

Extract All Files from a Deb Package

Sometimes you may want to extract a deb package to check a piece of code or use some of its included files for debugging and other purposes. To extract all files from a deb package, you can run a command in following format:

Note that extracting files is not the same as installation of a deb package. You will just get extracted contents of a “.deb” package in a local folder.

Install a Deb File Using Dpkg

Dpkg is a package management utility for managing “.deb” (debian) packages. To install a “.deb” package using dpkg, run the command below:

The above command will install the standalone deb package only, without any dependencies. To fix this, you will have to run a command to auto-install required dependencies. Otherwise your system may be left in a broken state. To fix the unmet dependency issue, run the command below:

Install a Deb File Using Gdebi

Gdebi is a nice command line and graphical application solely dedicated for installing standalone “.deb” packages stored on your local drive. It automatically resolves dependencies as well, as long as they are available in official Ubuntu repositories (requires network connection).

To install gdebi in Ubuntu, run the command below:

To install a “.deb” package using Gdebi, run the command below:

Since gdebi will take care of installation of dependencies, you don’t have to manually run another command to fix broken packages. However, if you want to check if there are broken packages or not and fix them automatically, you can run the command mentioned above again:

Using Apt to Install a Deb Package

You can also use Ubuntu’s default “apt” package manager to install standalone “.deb” files. To do so, run the following command:

If you launched terminal inside the directory of “.deb” file, run following command instead:

Like gdebi, apt will automatically install all the required dependencies. To confirm, run the command below:

Conclusion

These are a few commands you can use to install “.deb” files without using any graphical interface. They are useful if you are running and managing Ubuntu server edition or using Ubuntu without any desktop environment.

About the author

Nitesh Kumar

I am a freelancer software developer and content writer who loves Linux, open source software and the free software community.

Источник

Оцените статью
Adblock
detector