Yum

# https://www.centos.org/docs/5/html/yum/
# http://linux.duke.edu/projects/yum/

The Alert Icon is part of the up2date application, which enables you to easily install system updates.

You may use any of the following formats to specify a package in a yum operation: name, name.architecture, name-version, name-version-release, name-version-release.architecture, and epoch:name-version-release.architecture.

The system-config-packages utility can ONLY be used if you do not update any packages and install only from the CD/DVD. This utility will fail if updates have been done.

Packages repository cache directories: /var/cache/yum/.

Put user specific aliases and functions in ~/.bashrc
# Aliases (linux commands + software)
alias free='free -m'
alias grep='grep --color'
alias grepx='grep -n --color'
alias ls='ls -hv --color --show-control-chars --group-directories-first'
alias ll='ls -hlv --color --show-control-chars --group-directories-first'
alias nethogs='nethogs egiga0'
alias psa='ps -e -o pid,pcpu,pmem,rss,ni,state,stat,start,time,nlwp,comm,cmd'
alias tailn='tail -f nohup.out'
alias tailf='tail -f'

To install the package tsclient, enter the command:
su -c 'yum install tsclient'
To install the package group MySQL Database, enter the command:
su -c 'yum groupinstall "MySQL Database"'
When you install a service, CentOS does not activate or start it. To configure a new service to run on bootup, choose Desktop->System Settings->Server Settings->Services, or use the chkconfig and service command-line utilities.

To update the tsclient package to the latest version, type:
su -c 'yum update tsclient'

To remove the tsclient package from your system, use the command:
su -c 'yum remove tsclient'
To remove all of the packages in the package group MySQL Database, enter the command:
su -c 'yum groupremove "MySQL Database"'

To search for a specific package by name, use the list function:
su -c 'yum list tsclient'
To view details about a package:
su -c 'yum info tsclient'
To search for version 0.132 of the application, use the command:
su -c 'yum list tsclient-0.132'
Use the standard wildcard characters to run any search option with a partial word or name: ? to represent any one character, and * to mean zero or more characters. Always add the escape character (\) before wildcards. To list all packages with names that begin with tsc, type:
su -c 'yum list tsc\*'

The search option checks the names, descriptions, summaries and listed package maintainers of all of the available packages:
su -c 'yum search mysql'

The provides function checks both the files included in the packages and the functions that the software provides. This option requires yum to download and read much larger index files than with the search option:
To search for all packages that include files called libneon, type:
su -c 'yum provides libneon'
To search for all packages that either provide a MTA (Mail Transport Agent) service, or include files with mta in their name:
su -c 'yum provides MTA'

CentOS systems automatically use the CentOS Project repositories. These include [base], [updates], [addons], [centosplus], [contrib], [extras], and [testing]. Some of these repositories are not enabled by default, because they might change core packages. The enabled repositories are [base], [updates], [addons], and [extras].
To perform a full system update, type this command:
su -c 'yum update'
To activate automatic daily updates, enter this command:
su -c '/sbin/chkconfig --level 345 yum on; /sbin/service yum start'

To add an extra repository, place a definition file in the /etc/yum.repos.d/ directory. The names of repository definition files end with .repo.
Default yum repositories are automatically used as up2date channels. If you want to add other channels for up2date, you must manually configure up2date to use these channels. To do so, edit the /etc/sysconfig/rhn/sources file.

To manually add a public key to your rpm keyring, use the import feature of the rpm utility. To import the file GPG-PUB-KEY.asc, type the following command:
su -c 'rpm --import GPG-PUB-KEY.asc'
to import the file GPG-PUB-KEY.asc on the web site www.therepository.com use this command:
su -c 'rpm --import http://www.therepository.com/GPG-PUB-KEY.asc'

To purge the package data files, use this command:
su -c 'yum clean headers'
Run this command to remove all of the packages held in the caches:
su -c 'yum clean packages'

Enter this command to manually install the package tsclient-0.132-4.i386.rpm:
su -c 'yum localinstall tsclient-0.132-4.i386.rpm'

You can list yum groups with:
yum grouplist 
and for more (hidden) groups including the group ids, try ("group list" is equivalent to "grouplist"):
yum group list hidden | grep -i "X Window System"
To install Xfce group:
yum groups install "Xfce" 

Lists the repository ID, name, and number of packages it provides for each enabled repository:
yum repolist
# including disabled:
yum repolist all
# see also:
ll /etc/yum.repos.d
# enable a repository:
yum-config-manager --enable InstallMedia
# or edit repo file, e.g. (set enabled=1):
nano /etc/yum.repos.d/packagekit-media.repo

yum install yum-utils
# list files from mate-system-monitor.x86_64 package:
repoquery -l mate-system-monitor.x86_64

# list group content
yum group info "General Purpose Desktop"

# List installed packages with YUM
yum list installed

# list dependencies:
yum deplist openssl.x86_64
repoquery --requires --resolve git2u-core -> shows required packages
repoquery --requires git2u-core -> shows required files from packages required

# List the files in git2u-core-2.10.0-1.ius.el6.x86_64.rpm requiring libcrypto.so.10:
rpm -q --filerequire -p git2u-core-2.10.0-1.ius.el6.x86_64.rpm | grep libcrypto.so.10

# List packages on which git2u-core-2.10.0-1.ius.el6.x86_64.rpm package depends:
rpm -q --requires -p git2u-core-2.10.0-1.ius.el6.x86_64.rpm

# install a package with no dependencies checking:
wget https://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/git2u-core-2.10.0-1.ius.el6.x86_64.rpm
rpm -i --nodeps git2u-core-2.10.0-1.ius.el6.x86_64.rpm
# you then may continue to install depending packages with yum as usual:
yum install git2u-gitweb

# list repository content
yum list available | grep 'case sensitive repository id here'

# search for gcc package
yum list \*gcc\*
# install gcc
yum install gcc

# add a repository
yum-config-manager --add-repo http://www.nasm.us/nasm.repo

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.