Installing linux packages ubuntu

Установка deb пакетов в Ubuntu

Установка новых программ — один из самых важных моментов при работе с вашей системой. Раньше мы уже рассматривали добавление PPA в систему и установку программ из исходников. Но даже в PPA есть далеко не все пакеты, а установка из исходников слишком сложна для новичков.

Нередко возникает необходимость поставить программу, для которой уже есть собранные deb пакеты в интернете. Это может быть какая-нибудь не очень популярная программа или даже драйвера, которые вы скачали и хотите установить на компьютер где нет сети. На компьютере без сети установка программ с флешки ubuntu может стать единственным решением. В этой статье будет рассмотрена установка deb пакетов в ubuntu. Мы рассмотрим где их взять и как установить deb в ubuntu.

Где взять deb пакеты?

Ответ прост — на просторах интернета. Если это нужная вам программа, то вы уже знаете где взять для ее пакет. В случае с драйверами ситуация немного сложнее. Все программы и драйвера, которые находятся в официальных репозиториях Ubuntu вы можете найти на сайте launchpad.net, это очень удобно, если на машине, где они должны быть установлены нет интернета. Например, ищем linux-firmware и открываем ее страницу на Launchpad, внизу выбираем версию программы:

deb10

Дальше выбираем архитектуру:

deb8

И осталось получить deb файл для нашей системы:

deb9

Если у вас есть другой компьютер с интернетом или вы планируете устанавливать программы потом, а сейчас нужно только скачать deb пакеты, то это можно сделать с помощью apt:

deb

Пакет будет сохранен в текущей папке и дальше вы сможете все без проблем установить. Но будет скачан только сам пакет, без его зависимостей. Зависимости мы можем получить только в системе с интернетом используя команду apt-rdepends:

apt download имя_пакета $(apt-rdepends имя_пакета|grep -v «^ «)

Теперь у вас есть не только пакет, но и все его зависимости.

Установка deb пакетов Ubuntu

Установить Deb пакет Ubuntu не так уж сложно, для этого даже есть несколько утилит. Можно устанавливать как с помощью графического интерфейса, так и в терминале.

Самый простой способ установки — в графическом интерфейсе, с помощью центра приложений, с него и начнем. Откройте файловый менеджер в папке с пакетом:

deb1

Выполните двойной клик по deb пакету, далее откроется центр приложений, где вы посмотреть информацию о пакете и запустить установку нажав кнопку установить.

Читайте также:  Kaspersky security center web console linux

deb2

Установка программ Ubuntu с помощью центра приложений мне не очень нравится, он обычно очень долго думает и не всегда правильно открывает программу, но можно воспользоваться другой графической утилитой — gdebi. Сначала ее нужно установить:

sudo apt-get install gdebi

Теперь кликаем правой кнопкой мыши по файлу, выбираем открыть с помощью и gdebi:

deb5

Дальше осталось нажать кнопку установить и дождаться завершения установки пакета ubuntu. Программа автоматически установит все зависимости, если есть доступ к сети.

deb6

Установка deb из консоли Ubuntu выполняется не намного сложнее. Для этого используется утилита dpkg. Сначала переходим в папку куда был загружен deb пакет:

sudo dpkg -i имя_пакета.deb

deb3

Для этой команды доступны символы сокращений, например, можно написать вот так, чтобы установить все deb пакеты из этой директории:

Программа не умеет разрешать зависимости, даже если есть доступ к сети, она только устанавливает пакет, поэтому для установки зависимостей после установки deb ubuntu выполните:

deb4

Теперь, когда зависимости были загружены, вы можете запускать и использовать программу.

Это не единственный способ установки пакетов ubuntu через терминал, утилиту gdebi тоже можно запустить таким способом:

Возможно, вы не знали, но apt тоже умеет устанавливать deb пакеты и даже более чем успешно разрешает зависимости. Только утилите нужно передать полный путь к файлу для установки. Если вы находитесь в папке с deb пакетом выполните:

sudo apt install ./имя_пакета.deb

deb7

Программа автоматически установит все зависимости и больше ничего не придется выполнять.

Выводы

Вот и все. Теперь установка deb пакетов в Ubuntu не вызовет у вас проблем. Оказывается, есть несколько способов установки программ в ubuntu и все они имеют свои преимущества. Если у вас остались вопросы, спрашивайте в комментариях!

Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.

Источник

Installing and Working with Packages in Ubuntu

In Ubuntu, much like any other OS, one needs software. The primary method of software installation is via the GUI Ubuntu Software tool. This, however, is neither the preferred nor the only way of installing packages. Beginners tend to stick to GUIs; however, as you spend more time on Ubuntu, you end up having to resort to existing repositories and adding repositories, and worse comes to worst, manually install the packages. In this tutorial, we will learn to install and work with packages in Ubuntu.

Method 1: Repositories

The best part about Ubuntu and any flavor of Linux is that it comes with its own repository. A repository is basically like a store filled with thousands of packages or software. However, all the software available in the repository is open source and for Linux.

Читайте также:  Linux apt remove purge

You can, of course, search the repository for available packages using the apt command. To search the repository in Ubuntu:

For example, suppose that I’m looking for a package called MySQL:

Suppose that you’ve found the package you want but are looking for more information about the found package, then you’d use the apt show command.

Next, you can check for the dependencies using the following code:

Once you’re satisfied with the package you’ve found, you can install it. The apt-get install command will fetch and install the dependencies first and then install the package itself so that you can sit back and relax while the command does everything automatically for you. To install using the repository in Ubuntu:

Once installed, it is always a possibility that you might not like the package and wish to completely remove it from your system. To remove an installed package, type:

Apt -get remove will not remove the configuration files of the program you installed, and in those cases, you may use purge instead. To remove everything, including configuration files, you would type:

Method 2: Adding to a repository

There are many instances when and where the package you’re looking for will not be in the repository; however, it might be available in a totally different repository. So what do we do then? We add the repository that does have the file to our own. Apt primarily look for repositories in /etc/apt/sources.list – this is where all the repositories are found.

In order to add another repository to the ones you currently own, you can use the Personal Package Archives (PPAs). It is advised that you do not randomly add repositories, as it is not scanned for malware! Only add from trusted sources!

For example, if you want to add the ppa for the simple screen recorder:

To remove the ppa repository for the simple screen recorder:

For example, when you want to install Wine for Linux, they ask you to add a repository.

The latter will add the repository specified to /etc/apt/sources.list.

Method 3: Manually install the package

At times, there’s just no other way around it; you need to install the package manually. In such cases, the packaging format you get depends on the software you’re downloading.

Читайте также:  Linux для amlogic s905x3

DEB Packages
In order to install a DEB packaging, I personally use gdebi:

Once gdebi is installed, you can use the following code to install the .deb package.

Alternatively, most users use the dpkg command. The dpkg command is used to install, build, remove, and manage debian packages. Sometimes, you simply download a deb file and can’t use the apt command; in such cases, we use the dpkg command.

To install a package using dpkg:

One can also use dpkg to scan the deb file to see its contents:

To uninstall using dpkg, you need the package name used by the system; you can get it by typing:

And then uninstall it using the following:

And should it require reconfiguration because it’s corrupt, you can type:

RPM Package
RPM packages are typically used by CentOS, RHEL, and Fedora. However, there are times when as an Ubuntu user, you just need to use an rpm package. You can turn the rpm package into a deb package and install it in such cases.

First, let’s install alien, a package used to convert rpm files into deb files.

Then, download the rpm file and type:

For example, the latter will create a deb version of the same package that you can install with gdebi.

Tarballs
With tarballs, it’s harder to satisfy dependencies, and it’s harder to remove and update. However, there are times when tarballs are the only option, especially if you are prone to downloading off of github. In such cases, to install tarballs:

tar -xvzf package.tar.gz (or tar -xvjf package.tar.bz2)
cd package
./configure
make
sudo make install

Advanced Linux users prefer to install packages via the command line; this is a fact. Packages come in all shapes and forms; this is another fact. Some packages are rpm packages, others are tarballs, others can be found in a repository, and others require you to add novel repositories. In this tutorial, we learned the various ways in which one can install and manage packages. In fact, we rely on the apt and the dpkg commands to manage them overall. Using apt and dpkg, we can install, update, and remove packages.

Источник

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