redhat yum - ghdrako/doc_snipets GitHub Wiki

yum - YellowDog Updater Modified

Repositories

  • Software publishers - {Redhat, CentOS}
  • Third Party - {EPEL, RPMForge}
  • your own
  • authenticated

Register to satelite in developer-free subsription:

rm -rf /etc/sysconfig/rhn/systemid;yum clean all;subscription-manager clean;rm -rf /var/cache/yum/*;rm -rf /etc/yum.repos.d/*;yum -y localinstall http://s65capsule-mc.pkobp.pl/pub/katello-ca-consumer-latest.noarch.rpm; subscription-manager register --org="mc" --activationkey="actkey_gcp_rhel8_dev_free"

unregister

subscription-manager unregister

Lista repozytoriuw

subscription-manager repos --list

Help

yum --help
yum help

List package version

yum module list postgresql

yum list # list of package names from the repository
yum list available # list of all available packages
yum list installed # list of all installed packages
yum list installed httpd # is the specified package installed
yum list all # list of installed and available packages
yum list kernel # list of packages related to the kernel

Package info

yum info httpd # list of packages related to the kernel
yum deplist httpd # list of dependencies and required packages
yum provides '*bin/top' # find the package that contains the file

Install from local directory

yum localinstal <paclkage>.rpm

Checking For Updates

yum check-update

Upgrade whole system

yum upgrade

Updating a Single Package

yum update package_name

Updating All Packages and Their Dependencies

Running yum update on a regular basis is an important part of system maintenance, as it helps keep your system secure and running smoothly.

yum update

Updating Packages Automatically

To customize yum-cron, edit the /etc/sysconfig/yum-cron file

yum install yum-cron
chkconfig yum-cron on
service yum-cron start
service yum-cron status

Uninstall package using yum

yum list installed
yum list installed | grep <search_term>
yum remove <package>
yum remove <package_name> -y
yum remove <package_1> <package_2>
yum remove @"<group_name>"  # or yum group remove "<group_name>"

Searching Packages

yum search term…
yum search vim gvim emacs

Listing Packages

yum list glob_expression
yum list abrt-addon\* abrt-plugin\*
yum list all
yum list installed
yum list installed "krb?-*"
yum list available
yum list available gstreamer\*plugin\*
yum grouplist
yum repolist

yum info package_name
yum info abrt
yumdb info package_name
yumdb info yum
repoquery --list package_name

Installing Individual Packages

yum install package_name
yum install package_name package_name
yum install sqlite.i686
yum install perl-Crypt-\*
yum install /usr/sbin/named  

Extra Packages for Enterprise Linux (EPEL)

Example:

  • Epel,
  • Remi - Contains the latest versions of php and mysql. Requires Epel.
  • Atrpms
  • RPMForge
  • ELRepo In order to enable these repositories, you need to edit one of the following files accordingly:
  • /etc/yum.repos.d/epel.repo
  • /etc/yum.repos.d/remi.repo
  • /etc/yum.repos.d/atrpms.repo
  • /etc/yum.repos.d/rpmforge.repo

The value of the ENABLED parameter determines whether it is enabled (1) or disabled (0).

Install a repository .rpm

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

Set up only a section of a repository

$ sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
$ sudo yum-config-manager --disable remi-php54
$ sudo yum-config-manager --enable remi-php72

Manually set up a repository

create a .repo file within /etc/yum.repo.d

$ nano /etc/yum.repo.d/mysql57-community.repo
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql


$ yum-config-manager mysql57-community #  verify that repo is configured properly
⚠️ **GitHub.com Fallback** ⚠️