Yum in red hat linux

Chapter 8. Yum

Yum is the Red Hat package manager that is able to query for information about available packages, fetch packages from repositories, install and uninstall them, and update an entire system to the latest available version. Yum performs automatic dependency resolution on packages you are updating, installing, or removing, and thus is able to automatically determine, fetch, and install all available dependent packages.

Yum can be configured with new, additional repositories, or package sources, and also provides many plug-ins which enhance and extend its capabilities. Yum is able to perform many of the same tasks that RPM can; additionally, many of the command-line options are similar. Yum enables easy and simple package management on a single machine or on groups of them.

The following sections assume your system was registered with Red Hat Subscription Management during installation as described in the Red Hat Enterprise Linux 6 Installation Guide. If your system is not subscribed, see Chapter 6, Registering the System and Managing Subscriptions.

Yum provides secure package management by enabling GPG (Gnu Privacy Guard; also known as GnuPG) signature verification on GPG-signed packages to be turned on for all package repositories (i.e. package sources), or for individual repositories. When signature verification is enabled, Yum will refuse to install any packages not GPG-signed with the correct key for that repository. This means that you can trust that the RPM packages you download and install on your system are from a trusted source, such as Red Hat, and were not modified during transfer. See Section 8.4, “Configuring Yum and Yum Repositories” for details on enabling signature-checking with Yum, or Section B.3, “Checking a Package’s Signature” for information on working with and verifying GPG-signed RPM packages in general.

Yum also enables you to easily set up your own repositories of RPM packages for download and installation on other machines.

Learning Yum is a worthwhile investment because it is often the fastest way to perform system administration tasks, and it provides capabilities beyond those provided by the PackageKit graphical package management tools. See Chapter 9, PackageKit for details on using PackageKit .

You must have superuser privileges in order to use yum to install, update or remove packages on your system. All examples in this chapter assume that you have already obtained superuser privileges by using either the su or sudo command.

Читайте также:  Настройка samba oracle linux

Источник

How to install software packages on Red Hat Enterprise Linux (RHEL)

Learn how to install software with RHEL’s package manager using the dnf command or the GNOME Software app.

How to capture terminal sessions using the script commandPhoto by Sora Shimazaki from Pexels

There’s a lot of flexibility in how you install an application on Linux. It’s partly up to the software’s developer to decide how to deliver it to you. In many cases, there’s more than one «right» way to install something.

Training & certification

However, when an application is mission-critical, it’s important that you get timely and reliable updates. The best way for that to happen is to install software from a central hub. On Red Hat Enterprise Linux (RHEL), that central hub for application installation and maintenance is the dnf (formerly known as yum ) package manager.

Using a package manager ensures that every file installed on your system is dutifully recorded in a database, and each package can be updated when a new release is available. RHEL provides two ways to interact with its package manager: the dnf command and the GNOME Software app.

Search software repositories

Applications available on Red Hat’s servers are divided into several software repositories. These include the BaseOS, AppStream, Red Hat Linux Builder (previously called CodeReady Linux Builder), and Supplementary repositories.

To see the repositories enabled on your system, use the dnf repolist command along with the —all option. It’s a long list, so pipe it through the more pager to scroll through it:

$ sudo dnf repolist --all | more amq-interconnect-textonly-1-for-middleware-rpms Red Hat A disabled amq-textonly-1-for-middleware-rpms Red Hat J disabled ansible-automation-platform-2.2-for-rhel-9-. Red Hat A disabled ansible-automation-platform-2.2-for-rhel-9-. Red Hat A disabled ansible-automation-platform-2.2-for-rhel-9-. Red Hat A disabled codeready-builder-for-rhel-9-x86_64-debug-rpms Red Hat C disabled codeready-builder-for-rhel-9-x86_64-eus-debug-rpms Red Hat C disabled codeready-builder-for-rhel-9-x86_64-eus-rpms Red Hat C disabled codeready-builder-for-rhel-9-x86_64-eus-source. Red Hat C disabled codeready-builder-for-rhel-9-x86_64-rpms Red Hat C enabled codeready-builder-for-rhel-9-x86_64-source-rpms Red Hat C disabled [. ]

To enable a repository, use the dnf config-manager subcommand with the —enable option and the name of the repository as listed. For instance, to enable the rhel-9-for-x86_64-supplementary-rpms repository:

$ sudo dnf config-manager --enable rhel-9-for-x86_64-supplementary-rpms Updating Subscription Management repositories.

Find software to install

If you know what application you want to install, you can verify that it’s in the repository by searching for its name or even just part of its name:

$ sudo dnf search toolbox Updating Subscription Management repositories. ==== Name Exactly Matched: toolbox =========== toolbox.x86_64 : Tool for containerized command line environments on Linux

Install software from a remote repository

To install an application, use the install subcommand:

Источник

Linux package management with YUM and RPM

Gift package wrapped in purple with lavender ribbon

Installing, patching, and removing software packages on Linux machines is one of the common tasks every sysadmin has to do. Here is how to get started with Linux package management in Linux Red Hat-based distributions (distros).

Читайте также:  Установить поддержку linux во freebsd

Package management is a method of installing, updating, removing, and keeping track of software updates from specific repositories (repos) in the Linux system. Linux distros often use different package management tools. Red Hat-based distros use RPM (RPM Package Manager) and YUM/DNF (Yellow Dog Updater, Modified/Dandified YUM).

Yellow Dog Updater, Modified (YUM)

[ Editor’s Note: DNF or Dandified YUM is the updated default since Red Hat Enterprise Linux 8, CentOS 8, Fedora 22, and any distros based on these. Generally, the options are the same. Read more about DNF here. ]

YUM is the primary package management tool for installing, updating, removing, and managing software packages in Red Hat Enterprise Linux. YUM performs dependency resolution when installing, updating, and removing software packages. YUM can manage packages from installed repositories in the system or from .rpm packages. The main configuration file for YUM is at /etc/yum.conf , and all the repos are at /etc/yum.repos.d .

You can learn more about adding repositories to your system from this article on how to add a YUM repo from Amy Marrich.

It’s easy to manage packages in Linux with YUM . At the command line, enter:

There are many options and commands available to use with YUM . I’ve listed some commonly-used commands for YUM below:

Command Purpose
yum install Installs the specified packages
remove Removes the specified packages
search Searches package metadata for keywords
info Lists description
update Updates each package to the latest version
repolist Lists repositories
history Displays what has happened in past transactions

The following are commonly-used options with YUM :

Options Purpose
-C Runs from system cache
—security Includes packages that provide a fix for a security issue
-y Answers yes to all questions
—skip-broken Skips packages causing problems
-v Verbose

The history option gives you an overview of what happened in past transactions. This provides some useful information, like the date when the transaction happened and what command was run.

yum-history

You can undo or redo certain transactions using the history command. Here is an example of undoing a transaction:

YUM provides many options for package management. For detailed option information, look at man yum and yum –help . Also, here is a link to YUM documentation.

RPM is a popular package management tool in Red Hat Enterprise Linux-based distros. Using RPM , you can install, uninstall, and query individual software packages. Still, it cannot manage dependency resolution like YUM . RPM does provide you useful output, including a list of required packages. An RPM package consists of an archive of files and metadata. Metadata includes helper scripts, file attributes, and information about packages.

RPM maintains a database of installed packages, which enables powerful and fast queries. The RPM database is inside /var/lib , and the file is named __db* .

Читайте также:  Linux ms sql gui

RPM has some basic modes: query, verify, install, upgrade, erase, show querytags, show configuration. At least one of these modes needs to be selected to perform package management tasks. Every mode has its own set of options. For example, install mode i has its own set of installation options. Options for the modes are found on the RPM man pages at man rpm .

Some commonly-used modes are listed below:

Mode Description
-i Installs a package
-U Upgrades a package
-e Erases a package
-V Verifies a package
-q Queries a package

Here are some commonly-used general options:

General options Purpose
-? | —help Prints help
—version Prints version number
-v Prints verbose output

To install or upgrade an .rpm package using RPM, issue this command:

The flag -i is for install, U is for upgrade, v for verbose, h for hash (this option displays the # as a progress bar for the operation). In this example, v and h are optional flags.

rpm-ivh

To query for a package using RPM issue following command:

rpm -q query-options package

Option a queries all installed packages on the system.

rpm-qa

To erase a package, use the following command:

rpm -e erase-options package-name

rpm-evh

Package management is a common task for every system. YUM and RPM provide efficient ways to install, upgrade, remove, and track software packages on Red Hat Enterprise Linux systems.

[ Want to try out Red Hat Enterprise Linux? Download it now for free. ]

Источник

Yum, шпаргалка

Шпаргалка по работе с пакетным менеджером Yum (Yellowdog Updater, Modified), который используется в популярных Linux дистрибутивах: RedHat, CentOS, Scientific Linux (и других). В целях экономии места вывод команд не представлен.

Оглавление

#yum updateinfo list security
#yum groupinfo "Basic Web Server"
#yum groupinstall "Basic Web Server"
#yum groupremove "Basic Web Server"
#yum repo-pkgs reponame install
#yum repo-pkgs reponame remove

проверить локальную базу rpm (поддерживаются параметры dependencies, duplicates, obsoletes, provides)

установить из локальной директории (поиск/установка зависимостей будут произведены из подключенных репозиториев)

#yum localinstall httpd.rpm
#yum localinstall http://server/repo/httpd.rpm

Опции Yum

--disableplugin=fastestmirror
#yum update -y --enablerepo=epel
#yum update -y --disablerepo=epel

скачать пакеты, но не устанавливать
(на Centos 7 x86_64 будут скачаны в ‘/var/cache/yum/x86_64/7/base/packages/’)

#yum install httpd --downloadonly

Cледующие команды доступны после установки пакета yum-utils

#repoquery --requires --resolve httpd
#reposync -p repo1 --repoid=updates

запрос к локальной базе yum, отображение информации о пакете
(использованная команда, контрольная сумма, URL с которого был установлен и другое)

скачать src.rpm пакет из репозитория
(должен быть подключен соответствующий репозиторий, например в ‘/etc/yum.repos.d/CentOS-Sources.repo’ в CentOS)

Конфигурационные файлы Yum и их расположение

Некоторые опции yum.conf:

cachedir=/var/cache/yum/$basearch/$releasever

Определяет должен или нет Yum хранить кэш заголовков и пакетов после успешной установки. Значения: 0 или 1. (по умолчанию 1)

Некоторые полезные плагины

Работа Yum через прокси сервер

proxy_proxy_username=user proxy_password=pass
#export http_proxy="http://server:3128"

Источник

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