RPM and YUM Package Management in Linux
Binaries:
Fundamental factors justifying the existence of packages:
- Operating Units: Prevents installation of a package if not all necessary dependencies are installed.
- Automation of Installation/Uninstallation: Allows users to try a utility and immediately remove it without leaving residual files.
- Trivial Update Utility: Installation of a newer version of software is done automatically.
- Control of Configuration Files: Updating a package does not remove configuration files. Guarantees conservation of user information.
All packages, both .deb and .rpm, have a minimum set of features, including:
- List of dependencies with other packages, including the minimum required version, if appropriate.
- Content of the package, structured in directories.
- Script files that run during installation for testing, making changes to the system, or fixing issues.
RPM Packages
Basically, RPM installs programs by executing the following command as root:
# rpm -U name_of_file.rpm
(The program will automatically update or install.)
Applications like Kpackage or the “Add or Remove Software” option in Fedora simplify installation via a graphical menu. A common issue is conflicts with dynamic libraries, requiring the installation of other programs for the desired software to work.
To solve this, a utility called urpmi
checks for dependencies, downloads them from the internet, and installs them alongside the desired program.
The main difference between installing packages with the RPM installer and the YUM package manager is that YUM can calculate and find dependencies between packages, download them if available, and install them.
YUM Configuration
The main YUM configuration file is located at /etc/yum.conf
, and its structure is simple:
[main] Section
Configures system-wide options, such as temporary storage directory (cache), debug level, log file, etc. These options are summarized as follows:
cachedir
– Directory for YUM cache files.reposdir
– Directory to search for YUM repository files, default is/etc/yum.repos.d
.assumeyes
– 1 or 0, tells YUM whether to ask for confirmation when the answer is YES. Default is 0.exclude
– List of packages to be excluded from updates. Should be a space-separated list; wildcards *, ?, etc., are allowed.exactarch
– 1 or 0; a value of 1 makes YUM only update packages for the installed architecture. YUM will not install an i686 package to update an i386 package.obsoletes
– Enables YUM to search for and update obsolete packages; 0 disables this feature. Default is 0.distroverpkg
– Package used to determine the installed distribution version; can be any installed package. Default isredhat-release
for Fedora Core distributions.retries
– Number of retries before returning an error; 0 means never stop retrying. Default is 6.showdupesfromrepos
– 1 to show any duplicate packages in the repository, 0 to show only the latest version of a package. Default is 0.installonlypkgs
– List of packages that can only be installed, not updated; kernel updates fall into this category. Default is kernel, kernelsmp, kernel-bigmem, kernel-enterprise, kernel-debug, kernel-unsupported.gpgcheck
– 1 or 0. Tells YUM whether to check the GPG signature of packages. If in the [main] section, this applies to all repositories and locally installed RPM packages.
[Repository] Section
Configures each repository (parcel distribution site) individually. In recent Fedora Core distributions, repositories can also be stored separately under /etc/yum.repos.d/name_repository.repo
. Options for this section/file are:
[servera]
– Unique name for each repository, a single word in brackets [].name
– Descriptive name for the repository.baseurl
– URL to the directory where the repository’s “header” is located. Can be http://, ftp://, or file:///. Multiple URLs can be specified as follows:baseurl=url://server1/path/to/repository/
url://server2/path/to/repository/
url://server3/path/to/repository/
Do not use more than one
baseurl
entry in a repository.gpgcheck
– Same as in [main], but only for this repository.mirrorlist
– Specifies a URL containing a list of baseurls.exclude
– Same as in [main], but only for this server.includepkgs
– The opposite ofexclude
. A list of packages to use from this repository. Only listed packages are available.
YUM Options
yum install
,yum groupinstall
– Install the latest version of the specified package or group, considering all necessary dependencies.yum update
,yum groupupdate
– Update the package to the latest version and attend to all required dependencies. Can be run without specifying a package to update all upgradeable packages. Add the-obsoletes
flag to update packages from earlier versions, useful for upgrading an entire system.yum check-update
– Performs the same function asupdate
but only checks for and informs about updates.yum upgrade
– Upgrade an entire system. Equivalent toyum update -obsoletes
.