You installed the Ubuntu operating system a long time ago, configured it “for yourself”, but the most important thing is still missing. It is understandable: to ensure proper functionality, there are not enough most necessary programs, which in Windows we diligently searched for, downloaded and installed. Which we will continue to do - but already in the Linux environment.

One of the main issues that always causes persistent misunderstanding on the part of “transitional” Linux users (and ubuntologists) is the installation software(software) under Ubuntu. Linux has a peculiar structure system files, which is different from the "dll-garbage", as it is called, Windows. Such a thing as installing any program with a couple of clicks is not exactly absent here, but it is quite rare (read about this below).

Deb packages

Now more about Ubuntu system. In theory, all programs should be installed from the so-called. source codes (sources) - C++ files intended for compilation. However, it was not in vain that several so-called batch systems were developed at one time. In some operating systems Linux is distributed by RPM (Red Hat Package Manager)-system, in others, such as Debian and based on it - DEB (actually, from the word “Debian”), etc…

Note. DEB and RPM systems are partially similar in their design, but they are still incompatible with each other. However, there is special program alien, which converts packets from one format to a format with varying degrees of "luck"

We will install almost all software in Ubuntu from deb packages. A package is not an installation file, but a binary archive with components to install, plus some information about the package version, its architecture, and available dependencies. Upon opening the deb file through the package manager utility, the files are distributed to the system directories, links are created in the menu - and after that the program is ready for use. Compared to the process of compiling programs from source code, this is very easy and fast method installations.

As for dependencies, they are conditionally divided into mandatory and optional (based on the name, the latter are simply recommended for download). Most packages are interconnected with other libraries, without which they simply cannot be installed. What is the advantage of such a “package-dependent” approach? By themselves, deb-files take up relatively little space (usually tens or hundreds of kilobytes) due to the fact that they contain only the most necessary components. As you install more and more packages, the list of dependencies grows significantly. Subsequently, when a program is removed, all dependent packages are also removed (if they do not already depend on other packages). Here is such a kind of “alternative” to Windows dll-libraries.

Repositories

Another concept that you will have to deal with is a repository, a repository of software. We won't go into the architecture of a repository, but note that it usually consists of four categories: Main, Restricted, Universe, and Multiverse. Packages included in the universe and multiverse partitions are available only via the Internet and cannot be included in the initial distribution of Ubuntu. That is why, due to Ubuntu's rejection of non-free software, Linux users have problems (temporary) with codecs, DVD playback, fonts and other things.

There are two sources for installing packages, a local repository and an Internet repository, although you should use the word "repository" in the plural, since there are a myriad of them.

The local source is HDD or removable media in the form of a CD or DVD. Disks with repositories can be purchased in online stores, including Belarusian ones. Most full version for Ubuntu - on 4 or more DVDs, although the complete official repository takes up much more gigabytes than all these disks combined. A Russian mirror is available, as well as many other sources for downloading packages. At http://packages.ubuntu.com/ you can always find and download the necessary deb in a fairly visual form (with display of all strict / non-strict dependencies). Although we strongly discourage you from doing this yourself, because in order to satisfy the dependencies, you will have to download far from one package. In general, the occupation is extremely tedious. Ask on the forums, ask your friends for disks with repositories - and the whole problem will be solved very quickly.

Now briefly about the principle of naming batch files. Example: the name is conky_1.4.5-0ubuntu1_i386.deb. As you might guess, conky is the name of the program, 1.4.5 is its version, ubuntu is the supported OS, i386 is the processor architecture - a description of architectures). If you meet the suffix.src in the name, know that you are dealing with a package that includes source files. The am64 suffix means that the package is intended for installation on a 64-bit processor. Since 32-bit and 64-bit software are incompatible, downloading “foreign” packages is pointless. In the event that the version or architecture of the program is not compatible with the system, the package manager will stop the installation. If you have 32 bit Ubuntu version, be careful, order disks with repositories specifically for a 32-bit system.

Consider the situation: you have bought several DVD repositories. In this case, according to the instructions on the disc label, you need to add the repositories to a common “base”. To do this, in the console for each disk, you need to run the command apt-cdrom add, and then the disks will automatically be added to the list of repositories.

This list is stored at /etc/apt/sources.list. You can update it manually: sudo gedit /etc/apt/sources.list or through the Synaptic package manager.

And in the Gnome menu there is a corresponding item: System? Administration? Application sources. To add a source, go to this address and select "Third Party Software". Then click the “Add” button and enter the APT string, for example: deb http://ftp.debian.org sarge main. Now click the "Add Source" button and close all windows. You can install packages different ways, but the list of repositories you create will be available from the interface of all programs.

Usually, when you come across a description of a utility, a link to an Internet repository and a description of how to install the necessary packages are indicated. In general, this system is very convenient for subsequent software updates: the deb-manager compares Latest updates in the repositories with the packages you have and, if changes are found, updates them.

If you update manually, then sudo apt-get upgrade-- similar command in the console. During installation, the manager issues a warning about the occupied disk space with all dependencies and satisfies them as you wish. Downloaded packages are not deleted after installation, but are carefully stored in the cache: /var/cache/apt/archives/ from where you can copy them to another location. Unfinished (for example, in the event of a connection failure) packages are stored in the directory /var/cache/apt/archives/partial/. After the connection is restored, the update will continue from the same place as if nothing had happened.

Installing deb packages

The easiest way to install applications is through the menu Applications? Install/Remove. Programs are sorted into categories, have a description (however, things are not the best with translations), rating - all this makes it easier to choose among an impressive selection of programs. Check the required packages (or uncheck them if the package needs to be removed) and click “Ok”. Nothing complicated!

If you work through the console, then the similar commands will be: apt-get install<название пакета> (installation), apt-get remove<имя пакета> (removal).

The installed programs should appear in the list of the Main Menu in the section assigned to it.

Note. There is another way to install programs - by running a special script (the extension may vary - .sh, .py, etc.). Drivers and all-in-one packages are often distributed this way. During installation, the script asks questions that the user must answer. To run the executable type ./filename.extension

If the two installation methods mentioned are not enough for you, it's okay. In addition to the above aptitude, there are other package managers. If we consider programs with a graphical interface, then, first of all, the following three programs should be noted.

Synaptic (Synaptic Package Manager)

Synaptic is a program for managing both rpm and deb packages, apt graphical shell. It is integrated into Ubuntu, so there will be no problems with finding and installing it. This manager will install packages located on the hard disk via the Internet on removable media. If we take similar programs (YaST2, KPackage and others) as a comparison, the convenience of using Synaptic is an order of magnitude higher. These words mean: thoughtful settings, interface and label system. Moreover, it is relatively stable and fast work. This has long been proven in practice: when the number of various programs, libraries is in the thousands, such programs are most held in high esteem.

Automatix

More friendly than the standard "Install/Remove" program. It is designed for automated installation of the most requested applications, Ubuntu. As a result, the addition of features with which the OS was initially “out of tune”. It:

Multimedia codecs
- mount, read and write FS NTFS (relevant for Ubuntu 7.04 and below)
- ability to watch DVD
- additional scripts
- scripts for Nautilus and more.

With Aptoncd, you can create an ISO image with all installed packages and burn it to a CD/DVD. Then this repository is added without any problems to the general list of deb sources. We will talk about ways to do this in the next issue, in the practical part of this chapter.

Inset. Useful Console Commands

Unpacking:

archive gz/gz2 -- gunzip / gunzip2<файл>
archive bz/bz2 -- bunzip / bunzip2<файл>
tar archive -- tarxvf<файл>

Working with packages:

apt-get install --reinstall<программа> - installation of a package with overwriting files
apt-get install<программа 1> <программа 2> <программа n> - installation of several programs at once
apt-get -d install<программа> - launching the program without unpacking it
apt-get update- update package lists
sudo alien<пакет.rpm> -- convert rpm package to deb

In based on Debian systems program files, libraries source packaged and distributed as .deb files. Installing .deb files can be done with the tool command line called dpkg. However, a typical .deb package has dependencies (or required packages) that must be pre-installed in order to be able to install that .deb package, and dpkg cannot resolve these dependencies.

For example, if you try to install a package called webmin using dpkg on a fresh Ubuntu, dpkg will fail or dependency problems.

$ sudo dpkg -i webmin_1.620_all.deb dpkg: dependency problems prevent configuration of webmin: webmin depends on libnet-ssleay-perl; however: Package libnet-ssleay-perl is not installed. webmin depends on libauthen-pam-perl; however: Package libauthen-pam-perl is not installed. webmin depends on apt-show-versions; however: Package apt-show-versions is not installed. dpkg: error processing webmin (--install): dependency problems - leaving unconfigured Processing triggers for ureadahead ... Errors were encountered while processing: webmin

When it comes to .deb file dependencies, linux tool called gdebi is a blessing. With gdebi you can install .deb files with automatic resolution of unmet dependencies.

The gdebi utility has two components gdebi for the command line tool and gdebi-gtk for the GUI. Depending on what you're on desktop computer Linux or on a "headless" server, you can only install the command line tool or the full graphical version.

Installing a .deb file with dependencies on a headless server

To install gdebi in the console on Debian, Ubuntu or Linux Mint, do the following.

$ sudo apt-get install gdebi-core

For now just run gdebi with the target .deb file to install and handle dependencies. Any required packages will be installed automatically.

$ sudo gdebi webmin_1.620_all.deb

Installing a .deb file with dependencies in a desktop environment

You can also use the gdebi console tool on the desktop, or you can try gdebi with a GUI. To do this, install gdebi as shown. The GTK of its interface will also be installed.

$ sudo apt-get install gdebi

Then type this command to install the .deb file.

$ sudo gdebi-gtkwebmin_1.620_all.deb

You will see GUI package installer as shown in the screenshot below.

If there are any dependencies, the status window will show you those dependencies and you can check them by clicking on "Details" as shown below.

Finally, just click "Install Package" for the .deb installation process.

D eb is the installation package format used by all Debian-based distributions. Deb packages can be installed and removed using the command line or a graphical package manager.

In this tutorial, we will explain how to install debian .deb packages on Ubuntu 18.04. The same instructions apply for Ubuntu 16.04 and any Debian-based distribution, including Debian, Linux Mint, and Elementary OS.

Before you start

The Ubuntu repositories contain thousands of deb packages that can be installed from the Ubuntu Software Center. If you want to install from the command line, you can use the apt command line utility.

But there are applications that are not included in Ubuntu or any third party repositories. These applications must be downloaded from the developers website and installed manually.

Be careful when installing deb packages from unofficial sources.

Download deb packages

For the purpose of demonstration in this article, we will download and install the debug TeamViewer. TeamViewer is an all-in-one solution for remote support, sharing desktop, online meetings and file transfer between computers.

Launch your web browser and go to the TeamViewer for Linux download page. Download the deb package by clicking the Ubuntu and Debian download link.

If you prefer to use the terminal, you can download the deb file using wget or curl:

wget --no-check-certificate https://download.teamviewer.com/download/linux/teamviewer_amd64.deb

curl -k -O -L https://download.teamviewer.com/download/linux/teamviewer_amd64.deb

Installing deb packages from the command line

When it comes to installing deb packages from the command line, you have several tools at your disposal. In the following sections, we will show you how to use the apt , gdebi , and dpkg utilities to install deb packages.

Installing deb packages with apt

APT (Advanced Package Tool) is a command line interface for a package management system. It was introduced in Ubuntu 14.04 and combines the most commonly used apt-get and apt-cache commands.

To install local deb packages to apt you need to provide the full path to the deb package. If the package is in your current working directory, instead of using an absolute path, you can add ./ before the package name. Otherwise, apt will try to extract and install the package from the Ubuntu repositories.

sudo apt install./teamviewer_amd64.deb

You will be prompted to enter Y:

0 upgraded, 84 newly installed, 0 to remove and 64 not upgraded. Need to get 21.0 MB of archives. After this operation, 66.3 MB of additional disk space will be used. Do you want to continue?

The apt package manager will resolve and install all package dependencies.

Installing deb packages with gdebi

gdebi is a tool for installing local deb packages. It is not installed by default in , but you can install it from the Ubuntu Software Center or using the following command:

sudo apt install gdebi

Now you can install deb gdebi packages by typing:

sudo gdebi teamviewer_amd64.deb

Do you want to install the software package? :

Type y when prompted by gdebi , enable and install the deb package and all its dependencies for you.

Installing deb packages with dpkg

dpkg is a low-level package manager for Debian-based systems. Use the -i (or --install) option to install deb dpkg packages.

sudo dpkg -i teamviewer_amd64.deb

Unlike apt and gdebi , dpkg does not resolve dependencies. If you are getting dependency errors while installing deb packages, you can use the following apt command to resolve and install all package dependencies:

sudo apt install -f

Installing deb packages using the GUI

If you prefer to use the GUI, just download the deb file and double click to open it.

Default graphics software center will open

Click the Install button and the Authentication dialog box will open.

Installation may take some time depending on the size of the file and its dependencies. Once the deb package is installed, the Install button in the Ubuntu Software Center will change to Uninstall.

That's it, the application is installed on your system and you can launch it from the applications menu.

Conclusion

In this article, you learned how to install local deb packages.

Feel free to leave a comment if you have any questions.

Today I thought about what to do if there is no access to the Internet, but you need to install some program. After all, the programs linux ubuntu installed from online repositories. By the way, this also works in Kubuntu, Lubuntu. The rest did not check.
And how to get the necessary deb-packages for installation? If there is no Internet on the computer yet, at least a program for connecting to the Internet, for example, the same wvdial program. So that you can connect, for example, my modem in the console. Even though I figured it out. But all of a sudden you need it.
In order to get a list of Internet addresses where our deb packages are located, I use the program apt-get, as a command apt-get --print-uris --yes here --print-uris returns the URL to the screen. You don't need superuser rights to issue this command, so sudo you do not need to enter.

apt-get --print-uris --yes install wvdial

But to weed out the results and leave some URLs. I take advantage grep together with cut, in order to filter out the output of the program. Instead of wvdial you can enter the program you want to install.

apt-get --print-uris --yes install wvdial | grep ^\" | cut -d\" -f2

Now let's output to a file which we can then successfully feed to the program to load our deb packages. My request in the terminal began to look like this.

apt-get --print-uris --yes install wvdial | grep ^\" | cut -d\" -f2 > Loading.txt

Now, in order to download all the deb packages, it will be enough for me to use the program wget I wrote about her. It will suffice to do

this is the file that was created when executing the above command. You can write the full path to this file if it is not located in the folder where you opened the terminal.

You can also get a list of addresses needed to update the distribution.

apt-get --print-uris --yes dist-upgrade | grep ^\" | cut -d\" -f2 > "distribution updates"

wget -i "distribution updates"


When downloading a large number of files, you may need to select the folder where the files will be downloaded and the command will look like this

wget --directory-prefix=/path/to/download/files -i Loading.txt


wget --directory-prefix=/path/to/download/files -i "distribution updates"


Well, now it remains only to transfer the downloaded deb packages to a computer without the Internet and install them. In my case, I downloaded the program wvdial, and he pulled out four deb packages in dependencies. We take these packages with a flash drive and transfer them to the computer for which we downloaded the files, and install them using the command.

Go to the directory with downloaded and transferred deb-packages

cd /path/to/ our/deb packages


And install our packages.

sudo dpkg -i *deb


That's basically it, the program wvdial installed. In this way, you can download absolutely any program in Linux Ubuntu, Kubuntu, Lubuntu for offline installation. Maybe in other distributions, I don’t know, I tried only these.

Even if you're new to Linux and haven't worked with it for very long, you know that the most common way to install programs on distributions based on this kernel is to install from the repositories. However, there are times when this is not possible, and desired program distributed as an rpm or deb package. And since Debian-based distributions (Ubuntu, Elementary OS, Linux Mint, etc.) that use deb packages are more common today, let's look at how to install them.

Installing deb package in Ubuntu

In Ubuntu, you can install the deb package through the Software Center:

  • download the required file;
  • double-click on it with the left mouse button;
  • in the Application Center that opens, select "Install".

Installing deb package via terminal

As always, the easiest and most versatile way for both Linux settings, and installation of deb packages in particular, this is a terminal. To install a deb package through the terminal, just run a few commands. Let's look at an example Google installations Chrome:

  • Naturally, first download the package itself;
  • then we open the terminal and go to the directory with the file, since most often it is “Downloads”, then the command will look like this: cd ~ / Downloads /
  • and install using the dpkg package manager: sudo dpkg -i google-chrome-stable_current_i386.deb
  • enter the superuser password and wait for the installation to complete.

That is, to install the deb package through the terminal, you need to use the construction:

sudo dpkg -i packagename.deb Previous post