Linux and install rpm

Устанавливаем RPM пакеты в Linux

Рассказываем о том, что такое RPM-пакеты, где они поддерживаются и как с ними обращаться.

Что из себя представляет RPM?

Ранее этот акроним расшифровывался как Red Hat Packet Manager. Из названия становится ясно, что это пакетный менеджер, разработанный компанией Red Hat. Только остается непонятным, что такое пакетный менеджер и что за компания такая Red Hat.

Пакетный менеджер — утилита, которая помогает распаковать в систему любое приложение и скачать все необходимые для его работы компоненты. Проще говоря — загрузчик и установщик программ в Linux.

Red Hat — ветераны в области создания операционных систем на базе Unix и Linux. На основе их Red Hat Linux были построены такие популярные дистрибутивы как Fedora, OpenSUSE и CentOS. Все они унаследовали RPM.

Также RPM — это формат файлов, который пакетный менеджер Red Hat может обрабатывать. Он довольно распространен и часто встречается на официальных сайтах популярных программ (типа Google Chrome или VS Code). Файлы в этом формате нужно скачивать, если вы используете дистрибутив на базе Red Hat Linux. Самые популярные из них: Fedora, OpenSUSE и CentOS.

Файлы RPM похожи на файлы DEB, которые используются в дистрибутивах на основе Debian (Ubuntu, Mint, Elementary OS) и в самом Debian.

Устанавливаем RPM-пакет

Для установки RPM-пакетов (то есть файлов в формате RPM) можно использовать сразу несколько инструментов. Один из них универсален для всех систем на базе Red Hat Linux, а остальные уникальны для каждого дистрибутива.

Программа RPM

Это как раз та самая универсальная утилита для работы с RPM-пакетами. С помощью нее можно устанавливать, обновлять, удалять и всячески управлять файлами в соответствующем формате.

Она работает следующим образом: вводится команда rpm, затем вводится режим, потом опции и в конце название пакета, над которым нужно провести заданные операции.

  • -q — режим получения информации. Используется, чтобы получить определенную характеристику пакета. Например, какие зависимости ему нужны для нормальной работы.
  • -i — режим установки. Тут и так все понятно.
  • -V — режим проверки. В этом режиме утилита проводит сравнение файлов из пакета с теми, что уже находится в системе. В рамках ее интереса оказывается MD5-сумма, выданные разрешения, тип файла и так далее.
  • -U — режим обновления. Тут тоже все ясно без дополнительных комментариев.
  • -e — режим удаления. В этом режиме можно избавиться от пакета.
Читайте также:  Syn flood kali linux

С опциями сложнее. Их количество насчитывает несколько десятков — описывать в этой статье все не имеет смысла. Но некоторые все-таки отметить стоит, так как они непосредственно участвуют в установке RPM-пакетов.

  • v — это опция, включающая Verbose, то есть подробный лог всех выполняемых программой действий.
  • –force — опция, которая вынуждает RPM выполнять все операции принудительно без дополнительного ожидания.
  • __ –nodeps__ — эта опция заставляет RPM игнорировать зависимости в ходе установки пакета.
  • __ –replacefiles__ — настройка, которая принуждает RPM к замене всех старых файлов на новые без лишних вопросов.

Список установленных приложений в CentOS 7

Также терминал можно запустить, одновременно нажав клавиши Ctrl + Alt + T

Команда для перехода в папку Downloads

Вы можете работать из любой другой папки, но так удобнее

  • Потом запускаем RPM.
    • Для простой установки подойдет такая команда: sudo rpm -i название пакета.rpm.

    Базовые команды для работы с RPM

    Вот так просто можно установить Google Chrome в формате RPM

    Чтобы в ходе установки выводить в консоль все, что происходит с RPM, вводим такую команду: __sudo rpm -iv *название пакета*.rpm__.
    — Вы вправе комбинировать любые варианты опций и режимов.

    RPM несовершенен — он имеет один существенный минус, который перекрывает большую часть его преимуществ. Он не умеет находить и устанавливать зависимости. А это значит, что большую часть программ вы просто не сможете установить без ручного поиска зависимостей и ручной загрузки из разных репозиториев.

    Ошибка зависимостей

    Ошибка, которая будет часто возникать, если не пользоваться современным менеджером пакетов

    Поэтому в дистрибутивах на базе Red Hat Linux появились более продвинутые пакетные менеджеры для работы с RPM-файлами.

    Пакетные менеджеры популярных дистрибутивов

    Рассмотрим три самых распространенных пакетных менеджера.

    yum

    Этот вариант используется в дистрибутиве CentOS. Чтобы установить пакет с помощью него, введем в терминал команду sudo yum —nogpcheck localinstall название пакета.rpm.

    Команда распаковки пакета с yum

    Базовая команда для установки приложений с помощью YUM

    dnf

    Более продвинутая версия, которая используется в дистрибутиве Fedora. Чтобы установить пакет с помощью него, введем в терминал команду sudo dnf install название пакета.rpm

    Команда установки программ с помощью DNF

    А вот так устанавливаются программы в Fedora

    zypper

    Это пакетный менеджер из операционной системы openSUSE. Чтобы установить пакет с помощью него, введем в терминал команду sudo zypper install название пакета.rpm.

    Графический интерфейс

    Этот способ установки подойдет тем, кто привык к работе с Windows.

    • Просто загружаем RPM-пакет из интернета.
    • Открываем его в любом файловом менеджере.
    • Кликаем по нему дважды.

    Файловый менеджер в CentOS

    Магазин приложений в Fedora

    Источник

    How to Install an RPM File On Linux OS (CentOS, RHEL, & Fedora)

    While working in Linux, you may have seen downloadable files with the .rpm extension. Rpm files are designed to be downloaded and installed independently, outside of a software repository.

    This guide will show you how to install a .rpm file to your Linux CentOS or Fedora system.

    how to install rpm file on linux

    Note: RPM Package Manager (RPM) is a free and open-source package management system for installing, uninstalling and managing software packages in Linux.

    • A user account with sudo privileges
    • Access to a terminal window / command line (Menu > applications > utilities > terminal, Ctrl-Alt-F2)
    • RPM, DNF, & YUM Package Managers (all included by default)

    Step 1: Download RPM Installation File

    Typically, a web browser is used to locate and download a .rpm file. However, if a browser is not available you can still download a file if you know where it’s located.

    You may need to install a software tool called wget .

    To install wget in CentOS, enter the following in a terminal window:

    To install wget in Fedora, enter the following:

    Now, you can use the wget command to download the .rpm file you want. Enter the following:

    wget http://some_website/sample_file.rpm

    The system should reach out to the website and download the file to your current working directory.

    Note: You can look up the address of a particular .rpm file in a web browser on another system. Also, this is a handy way to install more recent software versions or special non-standard software. Also, take care when installing software packages! Make sure you trust the source before you install. Usually, a developer will include a verification method to make sure you’re getting authentic software.

    Step 2: Install RPM File on Linux

    Install RPM File Using RPM Command

    To install a .rpm package in CentOS Linux, enter the following:

    sudo rpm -i sample_file.rpm

    The -i switch tells the package manager you want to install the file.

    More information on the RPM installer can be found in the RPM documentation.

    Install RPM File with Yum

    Alternately, you can use the yum package manager to install .rpm files.

    sudo yum localinstall sample_file.rpm

    The localinstall option instructions yum to look at your current working directory for the installation file.

    Note: YUM stands for Yellowdog Updater Modified. Normally, yum looks to your enabled software repositories for new software packages to install. More recent verbiage suggests using install instead of localinstall, but it’s up to you.

    Install RPM on Fedora

    To install an .rpm package on Fedora Linux, enter the following:

    sudo rpm -i sample_file.rpm

    Just as in CentOS, the -i switch tells RPM to install the software.

    Another method is to use the dnf utility to install the package:

    sudo dnf localinstall sample_file.rpm

    Unlike many Linux tools, DNF is not a set of initials. It is merely the next evolution of the yum package manager.

    Remove RPM Package

    The RPM installer can be used to remove (or uninstall) a software package.

    Enter the following into a terminal window:

    sudo rpm -e sample_file.rpm

    The -e option instructs RPM to erase the software. Check RPM Dependencies

    So far, this guide assumes the software either doesn’t have dependencies or already has them installed.

    To check the .rpm file for dependencies using the following command:

    sudo rpm -qpR sample_file.rpm

    The system should list all the dependencies:

    • -q – This option tells RPM to query the file
    • -p – This option lets you specify the target package to query
    • -R – This lists the requirements for the package

    If there are any missing dependencies, you can install them from the standard repositories using yum or dnf. If your software requires other non-standard software, it will often be noted in the installation instructions.

    Download RPM Packages from the Repository

    One exciting feature of the yum package manager is that it allows you to download .rpm files directly from the repository. This might be helpful if you have limited bandwidth, or want to copy a single downloaded file between systems. It could also help if you have intermittent internet access, and you don’t want to spend time waiting for your installer to finish.

    To download a .rpm file from the repositories, enter the following:

    sudo yumdownloader packagename

    If you wanted to download the files for Apache, for instance, you’d replace packagename with httpd. You can then install the file as above.

    Note: In Linux, administrators find it helpful to have a single tool to manage software. That tool – called a package manager – can install software, keep track of software requirements, and track updates and patches. Package managers also work with repositories, which are secure and standardized libraries of commonly-used and well-supported applications. If you had to install wget in Step 1, that’s an example of installing from a repository.

    In this tutorial, we covered three different options for installing RPM files on Linux.

    As with most Linux software, your default package manager makes it simple to track installations, updates, and prerequisites.

    Источник

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