🌐 🇵🇱 Polski · 🇬🇧 EN
In this part, we will perform exactly the same tasks as in the previous one, but using YUM, a more flexible tool. The "yum" command provides access to a package repository containing tons of packages for installation, upgrading, and removal, where these operations are performed automatically. The YUM tool also handles dependency resolution, which is something we cannot do with RPM.
YUM command syntax: # yum [options] command
YUM command options:
- -c Specifies the location of the configuration file
- -q Sets installation to run quietly (no output)
- -y Sets automatic "yes" for prompts during installation
- -v Displays verbose output during each step of the process
YUM commands:
- clean - Removes cached data
- erase - Removes a package from the system
- grouplist - Displays available package groups
- groupinstall - Installs packages from a group
- info - Displays information about a given package
- install - Installs a package on the system
- search - Allows searching for a package in the repository
- update - Upgrades a package version
YUM has its configuration file located at /etc/yum.conf, which contains basic settings for its operation. These options include information on where YUM caches files before installation, how much information should be generated in logs, and where the log file is located. Usually, the default settings are sufficient, but you should know where to change these settings if necessary.
INSTALLING AND REMOVING SOFTWARE PACKAGES
Let's start by installing the postfix package from the repository:
# yum install -y postfix
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirrors.bluehost.com
* base: mirror.cisp.com
* extras: mirror.5ninesolutions.com
* updates: mirror.steadfast.net
Setting up Install Process
Resolving Dependencies
—> Running transaction check
—-> Package postfix.x86_64 2:2.6.6-2.el6 set to be updated
—> Finished Dependency Resolution
Dependencies Resolved
==============================================================================
Package Arch Version Repository Size
==============================================================================
Installing:
postfix x86_64 2:2.6.6-2.el6 base 2.0 M
Transaction Summary
==============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 2.0 M
Downloading Packages:
postfix.x86_64 2:2.6.6-2.el6.rpm | 3.6 MB 00:02
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : postfix-2.6.6-2.el6.x64_86 1/1
Installed:
postfix.x86_64 2:2.6.6-2.el6
Complete!
We can also perform an update by changing the command from install to update.
# yum update -y postfix
We will see if dependencies are resolved, and the installation of the newer version will begin. If we no longer need SMTP, we can remove the package from the system:
# yum remove -y postfix
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
—> Running transaction check
—-> Package postfix.x86_64 2:2.6.6-2.el6 set to be erased
—> Finished Dependency Resolution
Dependencies Resolved
====================================================================
Package Arch Version Repository Size
==============================================================================
Removing:
postfix x86_64 2:2.6.6-2.el6 installed 9.7 M
Transaction Summary
==============================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 1 Package(s)
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : 2:postfix-2.6.6-2.el6.x86_64 1/1
Removed:
postfix.x86_64 2:2.6.6-2.el6
Complete!
A great advantage of the YUM tool is that instead of updating individual packages on the system, you can update all packages at once.
# yum list updates
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirrors.bluehost.com
* base: mirror.cisp.com
* extras: mirror.5ninesolutions.com
* updates: mirror.steadfast.net
Updated Packages
NetworkManager.x86_64 1:0.7.0-10.el6_5.1 updates
NetworkManager-glib.x86_64 1:0.7.0-10.el6_5.1 updates
acl.x86_64 2.2.39-6.el6 base
acpid.x86_64 1.0.4-9.el6_4.2 base
at.x86_64 3.1.8-84.el6 base
[output truncated]
From this list, you can select packages to update; however, if we want to perform a full update, we use the command:
# yum update
In the YUM tool, we also have available lists of grouped packages that can be installed together. For example, if we want to install software packages for the system's graphical user interface (GUI), we can use the "grouplist" command:
This can be useful for installing a group of packages related to the Emacs editor:
# yum groupinstall Emacs
SEARCHING FOR PACKAGES
Unlike RPM, with YUM we get access to a repository of packages that we can install on the system. Let's see how to search for a given package in the repository.
# yum search postfix
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirrors.bluehost.com
* base: mirror.cisp.com
* extras: mirror.5ninesolutions.com
* updates: mirror.steadfast.net
============================= Matched: postfix ===============================
postfix.x86_64 : Postfix Mail Transport Agent
spamassassin.x86_64 : Spam filter for email which can be invoked from mail
delivery agents
As a result of the "search" switch, we get a list of packages matching the entered phrase.
If we are interested in detailed information about a given package, we use "info":
# yum info postfix
Loaded plugins: fastestmirror
Repository spacewalk is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* addons: centos.aol.com
* base: mirror.rackspace.com
* extras: mirror.atlanticmetro.net
Available Packages
Name : postfix
Arch : x86_64
Epoch : 2
Version : 2.6.6
Release : 2.el6
Size : 9.7 M
Repo : base
Summary : Postfix Mail Transport Agent
URL : http://www.postfix.org
License : IBM Public License
Description : Postfix is a Mail Transport Agent (MTA), supporting LDAP, SMTP
AUTH (SASL),
: TLS
To clear the information stored in the YUM cache, use this command:
# yum clean all
Loaded plugins: fastestmirror
Cleaning up Everything
Cleaning up list of fastest mirrors
Comments