Linux+: Applications 04 – Yum Introduction

J

Jarret W. Buse

Guest
Linux+: Applications 04 – Yum Introduction

Now that we have covered the use of “rpm” for Red Hat Systems, we need to go over the “yum” utility. The “yum” utility is a command-line program used to download the packages you need and then call “rpm” to perform one of its five modes on the package.

NOTE: For those who may know more about Debian systems, “yum” is the same in nature as “apt”.


To use “yum”, you must have superuser privileges since it could make changes to the system.

  1. Install, Upgrade and Remove
  2. Queries
  3. Troubleshoot and Maintenance
  4. Manage Repositories
  5. Language Pack Management
  6. Other options


The “yum” utility can provide secure connections by using GNU Privacy Guard (GPG), or GnuPG. GPG provides signature verification on packages when it is enabled. GPG can be enabled for all repositories or only specific ones which are used by the Operating System (OS). Any signature verification which is incorrect will not be installed. You are assured that the package being downloaded can be trusted and has not been changed. Changed packages could cause your system harm.


To configure “yum” for GPG, the configuration file is located at /etc/yum.conf. The file has a section called “[main]” which is mandatory to be included in the file. Under the “[main]” section is a line starting with “gpgcheck=value”. The value is either a “0” or “1”. When the value is a “0”, then GPG is disabled. If the value is a “1”, the GPG is enabled.


NOTE: This is a global setting for all repositories. The option can be set individually under each repository entry.

The “rpm” Repositories are locations which contain “rpm” packages. Repositories can be added to the existing list to allow for more places to be searched for packages. The repository list is kept in the /etc/yum.conf file under its own section called “[repository]”. The repository can be added as a .repo file in the folder /etc/yum.repos.d/ which is read by “yum” when a repository list is needed.


NOTE: Adding unknown or untrusted repositories can pose a security risk and should not be done.


Under the [repository] sections are two required entries. The entries are “name=” and “baseurl=”. The “name” entry is a readable name for the repository

Once the .repo file is made, the file can be added by the command “yum-config-manager --add-repo repository_url”. The “repository_url” is the link to the .repo file. For example, an entry could be as follows:

[red-hat-additions-rpms]

name=Red Hat Linux Additional Packages

baseurl= https://cdn.redhat.com/content/dist.../$releasever/$basearch/additions/source/SRPMS

enabled=1

gpgcheck=0

Another option here is the “enabled=” entry is used to enable the repository to be used.

Another entry used in the “[main]” section of yum.conf is “plugins=”. If plugins are to be enabled then set the entry equal to “1” (“0” if the option is disabled). By enabling plugins, you can enhance the abilities of “yum”.

Each plugin will have a separate configuration file located in /etc/yum/pluginconf.d/. If you have a plugin called “plugin-a” there should exist a “plugin-1.conf” within the “etc/yum/pluginconf.d” folder. Each plugin configuration file has an entry in the “[main] section labeled “enabled=”. Like the other such entries, the option can be enabled (“1”) or disabled (“0”).


NOTE: If “plugins=0” is set in the “yum.conf” file, then all plugins are disabled even if the entry “enabled=1” is set for a specific plugin.

The basic syntax for “yum is “yum [subcommand] [package]”. Some specific subcommands may require other optional entries, but these will be noted in the specific section in which they are applicable.

Subcommand

autoremove – remove specified packages and any unneeded packages as well

check – check local RPM database for errors

check-update – checks repositories for any available updates

clean – removes cached packages

deplist – lists dependencies for specified package

downgrade – downgrades a package to an earlier version than the one installed

erase – removes package and dependencies from local system

find-repos-of-install – finds repository from which the package was found

fs – prevents language and documents for package to be installed

fssnapshot – lists LVM snapshots

groupinfo – lists information for a package group

groupinstall – install all packages in a specified group

grouplist – list installed and available package groups

help – lists yum command help information

history – list and use previous yum transactions

info – show specified package information

install – install specified package

langavailable – lists available languages

langinfo – lists packages available for languages

langinstall – install package for specific language

langlist – show installed languages

langremove – remove specified language

list – show package name for repositories

localinstall – install package from local system, HTTP or FTP

makecache – download repository information to local cache

needs-restarting – lists processes installed which needs a system reboot

provides – lists packages which contain a queried file

reinstall – reinstall a package (same version)

remove - removes package and dependencies from local system

repoclosure – get list of dependencies which are missing

repoinfo – show installed repository information

repolist – list enabled repositories

repoquery – query repositories and local RPM database

reposync – sync repositories to a local folder

repotrack – download package of all dependencies

repo-pkgs – uses packages in a repository

search – search the name and description of packages for a match

show-installed – list installed packages

swap – removes a package and installs another in its place

upgrade – updates a package even if it is obsolete

update – update one or all installed packages

update-to - update one or all installed packages to a specified version

updateinfo – displays information on package updates not installed

verifytree – verifies consistency of local yum database

yumdb – changes or checks the yum database

yumdownloader – download package to local folder

yum-complete-transaction – attempts to complete a failed yum transaction

This should supply a basic introduction to the use of “yum”. The other articles will cover more specific uses of “yum”.
 

Attachments

  • slide.jpg
    slide.jpg
    32.9 KB · Views: 107,914
Last edited:

Members online


Latest posts

Top