cmdref.net - Command Reference

This site is command references for system engineers.

User Tools

Site Tools


Top     SiteMap

Sidebar

Top     SiteMap








Etc


Reference











.

os:linux:command:yum.html



Linux Command#Software

How to use yum Command in RHEL/CentOS

References

Commands List

Command Objective Example
yum -h
yum clean all Clean all cached files from any enabled repository.

Repository Setting

Command Objective
yum repolist ← only enable repository
yum repolist all
Check Repository
yum-config-manager Check Configuration
yum-config-manager --enable REPO_NAME Enable Reposigory
yum-config-manager --disable-repo REPO_NAME Disable repository
yum-config-manager --add-repo REPO_URL Add Repository

Searching Packages

Command Objective Example
yum search STRINGS Find any packages matching a string yum search mysql
yum search apache
yum provides COMMAND/LIBRARY yum provides nping
yum provides libstdc++.so.5
yum whatprovides XXXXX yum whatprovides libstdc++.so.5
yum info PACAGE Check Name, Arch, Version, Release, Description etc yum info lxc
yum deplist PACAGE check the dependences of the packages yum deplist vnc-server
yum deplist tree
yum check-update Checks whether updates exist for packages that are already installed on your system.
yum list Lists all packages that are available in all enabled repositories and all packages that are installed on your system.
You can confirm all rpm version.
yum list available
yum list extras
yum list installed It lists all the packages installed on the system.
You can confirm rpm version.
yum list installed |grep openssh
rpm -qa --last | less
← How to check installed packege order by installed date
yum list updates It lists the packages you can update
You can confirm rpm version.
yum list updates |grep openssh

Install, Remove, Update Packages

Command Objective Example
yum install PACKAGE
yum -y install PACKAGE
yum reinstall PACKAGE
yum localinstall XXXX.rpm
yum remove PACKAGE
yum update ← update all packages
yum update PACKAGE ← update only a package
yum upgrade upgrade is the same as the update command with the --obsoletes flag set.

Yum Groups

Command Objective Example
yum grouplist Lists installed groups and groups
yum groupinfo "GROUPNAME" Displays detailed information about a group.
yum groupinstall "GROUPNAME" Installs all the packages in a group. yum groupinstall "X Window System"
yum groupinstall "GNOME Desktop Environment"
yum groupremove "GROUPNAME" Removes all the packages in a group.
yum groupupdate "GROUPNAME" Updates all the packages in a group.


etc

Command Objective Example
yum history list all
yum history info N
yum history list all
yum history info 8


TIPS

How to Use Proxy

temporary

export http_proxy=http://192.168.0.10:9999/


/etc/yum.conf

[main]
export http_proxy=http://192.168.0.10:9999/
[main]
proxy=http://xx.xx.xx.xx:8080
proxy_username=username
proxy_password=password


Check Reposistory in all repo files

# grep -E "\[*\]|name|baseurl" /etc/yum.repos.d/*.repo


How to use only the specific repository

# yum --disablerepo=* --enablerepo=test-repo repolist
# yum --disablerepo=* --enablerepo=remi,epel search httpd







os/linux/command/yum.html.txt · Last modified: 2017/10/20 by admin