Red Hat Package Manager and YUM are powerful package managers that allow the administrator to install, remove, and obtain package information. It is a software distribution method widely used in various Linux distributions, such as Red Hat Enterprise Linux, CentOS, and Fedora.
Red Hat RPM and YUM Package Management makes it possible to install packages , perform software updates, software groups, and dozens of other tasks. It’s as powerful as dpkg and apt-get.
This package manager performs in a way simple installation, maintenance, and removal of software packages.
Each rpm package contains binary programs, configuration files, documentation, and information from
how they should be installed and their dependencies.
This utility maintains a database of all installed packages and their files, version control, and dependencies.
In some special situations, the database may become corrupt. The package manager has special functions to recover its integrity.
The rpm packages have the following nomenclature:
We can also find packages with names on package-version format.src.rpm. These packages contain the source files for a software and are mostly architecturally independent.
The rpm package manager is used by various Linux distributions. But the packages may differ in information. additional from one distribution to another. Always try to use packages made specifically for your distribution.
This manager also controls dependencies between packages. They contain information about the dependencies of each application, and this information is used during your installation or removal.
If the installation of a new package requires another, rpm will alert the administrator.
The rpm command is responsible for installing, removing, updating, converting the packages. This command is first organized into operating modes, which may be: querying, verifying, integrating, installing, removing, updating, and reconstructing the rpm database. Each operating mode may or may not contain several options available.
The most common operating modes are:
# rpm {-q|—query} [query options] package_name
Example:
# rpm —q bash
bash-2.05b-207
# rpm {-v|—Verify} package_name
Example:
# rpm -V snort-2.0.1-98.i586.rpm
package snort-2.0.1-98.i586.rpm is not installed
# rpm {-K|—CheckSig} package_name
Example:
# rpm -K libpcap-0.7.2-37.i586.rpm
libpcap-0.7.2-37.i586.rpm: sha1 md5 gpg OK
# rpm {-i|—install} [installation options] package_name
Example:
# rpm —i libpcap-0.7.2-37.i586.rpm
# rpm —ivh libpcap-0.7.2-37.i586.rpm
Preparing… ######################################## [100%]
1:libcap ##################################################### [100%]
# rpm {-u|—upgrade} [installation options] package_name
Example:
# rpm -U libpcap-0.7.2-37.i586.rpm
package libpcap-0.7.2-37 is already installed
# rpm {-e|—erase} [removal options] package_name
Example:
# rpm —and libpcap-0.7.2-37.i586.rpm
# rpm {—initdb|—rebuilddb}
Example:
# rpm —initdb
# rpm {—qPr}
Example:
# rpm —QPr BitTorrent-5.2.2-1-python2.4.noarch.rpm
/usr/bin/python2.4
python >= 2.3
python (abi) = 2.4
python-crypto >= 2.0
python-psyco
python-twisted >= 2.0
python-zopeinterface
rpmlib (CompressedFilenames) = 2.6
# rpm {—ivh –nodeps}
Example:
# rpm -ivh –nodeps BitTorrent-5.2.2-1-python2.4.noarch.rpm
Preparing… ######################################## [100%]
1:BitTorrent #################################################### [100%]
# rpm {—qa –last}
Example:
# rpm -qa –last
kernel-headers.x86_64 Fri 06 Mar 2019 11:55:01 BRT
graphviz-gd.x86_64 Fri 06 Mar 2019 11:55:00 BRT
file-devel.x86_64 & nbsp; Fri, Mar 06, 2019 11:55:00 PDT
# rpm {—qf file}
Example:
# rpm -qf /usr/bin/htpasswd
httpd24-tools-2.4.10-15.58.amzn1.x86_64
# rpm {—qi package_name}
Example:
# rpm -qi httpd24
Name: httpd24
Version: 2.4.10
Release: 15.58.amzn1
Architecture: x86_64
Install Date: Fri 13 Feb 2015 21:56:14 BRST
Group & nbsp;: System Environment/Daemons
Size: 3792099
# rpm {—Go}
Example:
# rpm -Go
to
S.5… T. c /etc/sysconfig/svnserve
… L… c /etc/localtime
..?… /usr/sbin/glibc_post_upgrade.x86_64
S.5… T. c /etc/httpd/conf/httpd.conf
..?… /usr/sbin/suexec
The options of
The most frequent package information queries are:
The options for installing and updating packages most frequent are:
The options for uninstalling the packages are:
Prefer when updating a package to a higher version new use the —U mode. So the oldest package will be removed, the new one will be installed and the settings will be maintained.
Yum is an acronym for Yellow Dog Updater, Modified. It is a tool used to manage the installation and removal of packages in Linux distributions, which use the RPM system.
It is a file package manager similar to APT-GET that automatically deals with dependencies by computing them and solving what must be done to treat them.
It has a configuration file that specifies which repositories YUM should use to search and download
the RPM packages.
New RPM-based Linux will always have the YUM package manager installed. If you need to install YUM, it can be found on the site http://yum.baseurl.org.
The installation command is:
# rpm -ivh yum.rpm
YUM requires you to configure the package repositories in the yum.conf configuration file
Example:
# vi /etc/yum.conf
name=Fedora Core 3 — Fedora US mirrorbaseurl= http://SERVERNAME/fedora/fedora/$releasever/$basearch/RPMS.os
name=Fedora Core 3 Updates — Fedora US mirrorbaseurl=http://SERVERNAME/fedora/fedora/$releasever/$basearch/RPMS.updates
In addition to the /etc/yum.conf configuration file, YUM allows you to place repository configuration files in the /etc/yum.pos.d/ directory. This directory contains the settings for each repository.
You can add extra repositories or “beta-test” software repositories in the repository list of YUM.
Some yum commands:
See the examples:
# yum install postgresql
Resolving Dependencies
Install 2 Package (s)
Is this ok [Y/n]: and
Package (s) data still to download: 3.0 M
(1/2): postgresql-9.0.4-5.fc15.x86_64.rpm ; | 2.8 MB 00:11
(2/2): postgresql-libs-9.0.4-5.fc15.x86_64.rpm | 203 kB 00:00
——————————————————————————————
Total & nbsp; 241 Kb/s | 3.0 MB 00:12
Running Transaction
Installing: postgresql-libs-9.0.4-5.fc15.x86_64
1/2
Installing: postgresql-9.0.4-5.fc15.x86_64 2/2
Complete!
# yum update
Plugins loaded: priorities, update-motd, upgrade-helper
amzn-main/latest
; Resolving dependencies
–> Performing transaction verification
—> The aws-cli.noarch package 0:1 .7.5-1.2.amzn1 will be updated
—> The aws-cli.noarch package 0:1 .7.12-1.3.amzn1 will be an update
–> Completed dependency resolution
& nbsp; Resolved dependencies
===============================================================
Package Arq. Repo Tam version.
============================================================================
Installing:
kernel & nbsp; x86_64 3.14.34-27.48.amzn1 amzn-updates 16 M
Updating:
; aws-cli noarch 1.7.12-1.3.amzn1 amzn-updates 604 k
Transaction Summary
& nbsp; ========================================================================== Install 1 Package (+4 Dependent packages)
Upgrade 1 Package
Total download size: 16 M
Is this ok [Y/d/n]:
# yum remove postgresql
Resolving Dependencies
—> Package postgresql.x86_64 0:9 .0.4-5.fc15 will be erased
Is this ok [Y/n]: and
Running Transaction
Erasing ;: postgresql-9.0.4-5.fc15.x86_64 1/1
Removed:
postgresql.x86_64 0:9 .0.4-5.fc15
Complete!
# yum search Firefox
Loaded plugins: langpacks, soon, refresh-packagekit
============== N/S Matched: Firefox ==========================
firefox.x86_64: Mozilla Firefox Web browser
gnome-do-plugins-firefox.x86_64: gnome-do-plugins for Firefox
Mozilla- firetray-firefox.x86_64: System tray extension for firefox
mozilla-adblockplus.noarch: Adblocking extension for Mozilla Firefox
mozilla-noscript.noarch: JavaScript list extension for Mozilla Firefox
Name and summary matches only, use “search all” for everything.
# yum info mysql
yum info mysql
Plugins loaded: priorities, update-motd, upgrade-helper
newrelic & nbsp; & nbsp; 59/59
Installed packages
Name: mysql
Architecture & nbsp;: noarch
Version: 5.5
Release: 1.6.amzn1
Size: 0.0
Repo: installed
# yum list
Installed packages
GeoIP.x86_64 1.4.8-1.5.amzn1 & nbsp; @amzn -main
GeoIP-Devel.x86_64 1.4.8-1.5.amzn1 @amzn -main
Pyyaml.x86_64& nbsp; 3.10-3.6.amzn1 installed
acl.x86_64 & nbsp; 2.2.49-6.9.amzn1 installed
acpid.x86_64 1.0.10-2.1.6.amzn1 installed
alsa-lib.x86_64 1.0.22-3.9.amzn1 installed
apr.x86_64 1.5.0-2.11.amzn1 @amzn -updates
(…)
# yum provides /etc/sysconfig/nfs
Plugins loaded: priorities, update-motd, upgrade-helper
1:nfs-utils-1.2.3-39.15.amzn1.x86_64: NFS utilities and supporting clients and daemons for the kernel NFS server
Repo: amzn-main
Result from:
File name: /etc/sysconfig/nfs
# yum replist
repo id repo name status
amzn-main/latest AMZN-Main-Base 5.019
amzn-updates/latest AMZN-Updates-Base 1.085
newrelic/x86_64 & nbsp; New Relic packages 59
republican: 6,163
The yumdownloader command does the downloading RPM files from the YUM repositories. It is useful for you to download the packages for later installation, or when you are going to install packages in several machines, without the need to download the same package several times.
Example:
$ yumdownloader httpd24
amzn-main/latest | 2.1 kB 00:00
amzn-updates/latest | 2.3 kB 00:00
httpd24-2.4.10-15.58.amzn1.x86_64.rpm & nbsp; | 1.3 MB 00:00
The sudo command on Linux executes a given command as if it were another user.…
The ss command on Linux is extremely useful for investigating sockets, providing various information about…
Free Linux command shows the amount of total memory in use and available, as well…
The shell has structures for testing conditions and executing certain program sequences several times (loop),…
The /etc/fstab file stores the configuration of which devices should be mounted and what is…
The Netcat Command in Linux or nc is a utility used to do “almost anything”…
This website uses cookies.