What is rpm in red hat linux
RPM имеет пять основных режимов работы (не считая создания пакета): установка, удаление, обновление, анализ и проверка. Этот раздел содержит описание каждого режима. Чтобы получить полное описание всех подробностей и параметров, попробуйте выполнить rpm —help или обратиться к разделу 15.5 Дополнительные ресурсы .
Прежде чем воспользоваться пакетами RPM, вы должны знать, где их найти. Поисковые машины в Интернете знают о множество хранилищ RPM, но если вы ищете пакеты RPM, созданные компанией Red Hat, обратитесь к следующим источникам:
Компакт-диски Red Hat Enterprise Linux
Страница обновлений Red Hat, расположенная по адресу http://www.redhat.com/apps/support/errata/ .
Список зеркал FTP-сервера Red Hat, опубликованный по адресу http://www.redhat.com/download/mirror.html
Сеть Red Hat Network — Подробнее о ней вы узнаете в главе 17 Red Hat Network
Обычно файлы, содержащие пакеты RPM, имеют имена вроде foo-1.0-1.i386.rpm . Имя файла включает название пакета ( foo ), версию ( 1.0 ), выпуск ( 1 ) и архитектуру ( i386 ). Чтобы установить пакет, войдите в систему под именем root и введите в приглашении оболочки следующую команду:
rpm -Uvh foo-1.0-1.i386.rpm
Если установка пройдёт успешно, на экране появится следующее:
Как вы видите, RPM выводит имя пакета, а затем, по мере установки пакета, последовательность символов «решётка», отражающую процесс установки.
При установке или обновлении пакета автоматически проверяется подпись пакета. Эта подпись подтверждает то, что пакет был подписан разработчиком и не был изменён. Например, если при проверке подписи происходит ошибка, вы получите примерно следующее сообщение:
error: V3 DSA signature: BAD, key ID 0352860f
Если это новая подпись только для заголовка появляется такое сообщение:
error: Header V3 DSA signature: BAD, key ID 0352860f
Если у вас не установлен ключ, подходящий для проверки подписи, сообщение об ошибке содержит слово NOKEY , например:
warning: V3 DSA signature: NOKEY, key ID 0352860f
За дополнительными сведениями о проверке подписи пакета обратитесь к разделу 15.3 Проверка подписи пакета .
Предупреждение | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Замечание | |||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Подсказка | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Замечание | |||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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.
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 (RPM Package Manager)
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* .
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:
rpm -i package-file
rpm -U package-file
rpm -ivh package-file
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.
To query for a package using RPM issue following command:
rpm -q query-options package
Option a queries all installed packages on the system.
To erase a package, use the following command:
rpm -e erase-options package-name
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. ]
Источник