Red Hat Linux Reference Guide

Linux Introduction

VI-EDITOR

Process Management

Linux Installation

Disk Partitions & File System Management

Logical Volume Management - LVM

User & Group Administration

Package Management

Network File System - NFS

Domain Naming System - DNS

Apache HTTP Web Server

KickStart Installations

FTP server

BOOT PROCESS

Dynamic Host Configuration Protocol - DHCP

Job Scheduling

File Links

Swap Management

Log Management

Performance Management

Linux Troubleshooting

Linux Summary

Start Preparation Smartly

We have the collection to start prepartion smartly.

Start Assessment

Red Hat Linux Reference Guide

  DevOps Tech Hub

116 Followers

What is Swap?


YUM Introduction

  • YUM stands for Yellow dog Updater, Modified because it is based on YUP, the Yellow dog Updater. 
  • YUM resolvs package dependencies automatically.
  • YUM can handle multiple software reposities so that YUM can get the required packages from any of the repositories configured.
  • Can specify which version of package needs to be installed as YUM can search for same version of package from reposities.

Steps Involved in Installaing a Package using YUM:

  • Check for any dependencies that required for the installation
  • Check for the reposities configured if the dependency pakcages are available
  •  List all the dependency pakcage list that needs to be installed 
  • Once you approve the dependency list then YUM proceed for download and installation of the packages.

 If Red Hat Enterprise Linux is installed with a valid registration key, then  installation process sets up repositories at the Red Hat Network (RHN ) server automatically. If the System is not registered with RHN then reposities needs to be configured manually using the packages that are available within the Linux image. 

Package that are required as pre-requisites to  configure own YUM Server Repository:

  •  Createrepo
  •  Deltarpm
  •  Python-deltarpm

Configuration Files used to configure YUM Server Repository:

  • /etc/yum.conf
  • /etc/yum.repos.d/<reponame>.repo
  • /var/ftp/pub

How to configure YUM server  using  RHEL DVD dump: 

  • Create dump of RHEL CD
    • Mount  the  cdrom  and  create  the  RHEL  dump  to  /var/ftp/pub/RHEL6  location

  • Install the required packages from CD to configure YUM server 

  • Create repository 

  • Create .repo file in /etc/yum.repos.d directory

  • Here  baseurl directive locates  the  location  of the repository either  in  the  local  system (file )  or  remote  system (ftp)  or  from  the  Redhat  channel (http).
  • Verify the YUM repository working :

How to Manage packages using YUM:

How to install a package:

 

How to remove package


How to see the YUM history (> RHEL6 Version)

How to see list of specific Package

How to see updates are available for specific package

How to update a package to the latest version:

Kernel package update require system reboot to load the latest kernel version. For other package updates system reboot not required.

[iwayQ@ ~]$yum update kernel
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:4.14.181-140.257.amzn2 will be installed
 --> Finished Dependency Resolution

Dependencies Resolved

================================================================================================
Package Arch Version Repository Size
================================================================================================
Installing:
  kernel           x86_64           4.14.181-140.257.amzn2            amzn2-core            20 M

Transaction Summary
================================================================================================
 Install  1 Package

Total download size: 20 M
Installed size: 100 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
kernel-4.14.181-140.257.amzn2.x86_64.rpm | 20 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : kernel-4.14.181-140.257.amzn2.x86_64 1/1
   Verifying  : kernel-4.14.181-140.257.amzn2.x86_64                                         1/1

Installed:
   kernel.x86_64 0:4.14.181-140.257.amzn2

Complete!
 [iwayQ@ ~]$

How to Rollback YUM transaction:

Below example show transaction no. 4 is  rollbacked successfully.

[iwayQ@ ~]$yum history
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
ID | Login user | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
4 | EC2 ... <ec2-user> | 2020-06-27 08:32 | Erase | 2
3 | EC2 ... <ec2-user> | 2020-06-27 08:29 | Install | 1
2 | EC2 ... <ec2-user> | 2020-06-27 08:25 | Install | 9
1 | System <unset> | 2020-06-26 13:00 | Update | 1
history list
[iwayQ@ ~]$yum history undo 4
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Undoing transaction 4, from Sat Jun 27 08:32:30 2020
Erase httpd-2.4.43-1.amzn2.x86_64 @amzn2-core
Erase mod_http2-1.15.3-2.amzn2.x86_64 @amzn2-core
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.43-1.amzn2 will be installed
---> Package mod_http2.x86_64 0:1.15.3-2.amzn2 will be installed
 --> Finished Dependency Resolution

Dependencies Resolved

================================================================================================
Package Arch Version Repository Size
================================================================================================
Installing:
httpd x86_64 2.4.43-1.amzn2 amzn2-core 1.3 M
  mod_http2            x86_64            1.15.3-2.amzn2              amzn2-core            146 k

Transaction Summary
================================================================================================
 Install  2 Packages

Total download size: 1.5 M
Installed size: 4.4 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): mod_http2-1.15.3-2.amzn2.x86_64.rpm | 146 kB 00:00:00
(2/2): httpd-2.4.43-1.amzn2.x86_64.rpm | 1.3 MB 00:00:00
------------------------------------------------------------------------------------------------
Total 10 MB/s | 1.5 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mod_http2-1.15.3-2.amzn2.x86_64 1/2
Installing : httpd-2.4.43-1.amzn2.x86_64 2/2
Verifying : httpd-2.4.43-1.amzn2.x86_64 1/2
   Verifying  : mod_http2-1.15.3-2.amzn2.x86_64                                              2/2

Installed:
   httpd.x86_64 0:2.4.43-1.amzn2                mod_http2.x86_64 0:1.15.3-2.amzn2

Complete!
 [iwayQ@ ~]$


Edwiki spots:

List of YUM options:

  • install 
    • Is  used  to install the latest version of a package or group of  packages while ensuring that all dependencies are satisfied. 
  • Update  
    • If run without any packages, update will update every  currently   installed  package
  • check-update 
    • Implemented so you could know if your machine  had  any  updates   that  needed  to  be  applied  without running it interactively.         
  • upgrade 
    •     Is the same as the update command with the --obsoletes flag set.
  • remove or erase 
    • Are  used  to  remove  the specified packages from the system as well as removing any packages which depend on the package  being removed.
  • list
    • Is  used  to  list various information about available packages;
  • provides or whatprovides
    • Is used to find out which package provides some feature or file.
  • Search
    • Is used to find any packages matching a string in  the  description,
  • info 
    • Is  used  to  list  a  description and summary information about  available packages
  • clean
    • Is  used  to clean up various things which accumulate in the yum cache directory over time
  • resolvedep
    • Is  used  to list packages providing the specified dependencies,at most one package is listed per dependency.
  • localinstall
    • Is used to install a set of local rpm  files.  If  required  the enabled repositories will be used to resolve dependencies.
  • localupdate
    • Is used to update the system by specifying local rpm files.
  • deplist
    • Produces  a  list  of all dependencies and what packages provide those dependencies for the given packages.
  • --version
    • Reports the yum version number and exits.
  • --enablerepo=
    • Enables specific repositories by id or glob that have been  disabled in the configuration file using the enabled=0 option.
  • --disablerepo=
    • Disables specific repositories by id or glob.
  • --obsoletes
    • This  option  only  has  affect  for an update, it enables yum´s obsoletes processing logic.
  • --exclude=package
    • Exclude  a  specific package by name or glob from updates on all  repositories.


Previous Next