Ticker

6/recent/ticker-posts

yum cheat sheet



Info:
Display all the information related to a package:
[satish@host]$ sudo yum info httpd
[satish@host]$ yum install selinux* -y


List:
List all the installed package:
[satish@host]$ sudo yum list installed | grep ansible
List all the available package:
[satish@host]$ sudo yum list available  | grep ansible
[satish@host]$ sudo yum list ansible


Search:
Search package Name:
[satish@host]$ sudo yum search httpd


Provides:
Find the package that gives information of the queried file:
[satish@host]$ sudo yum provides /etc/nginx/nginx.conf


Dependency List:
List all the dependency of a particular package:
[satish@host]$ sudo yum deplist docker


Update:
Update a particular package:
[satish@host]$ sudo yum update httpd
Update only security related update:
[satish@host]$ sudo yum update --security


Clean:
Clean all metadata of packages from cache:
[satish@host]$ sudo yum clean all


Makecache:
Download all the package data to cache:
[satish@host]$ sudo yum makecache
[satish@host]$ sudo yum makecache fast


Repolist:
Display all the enabled repositories:
[satish@host]$ sudo yum repolist
Display all the disabled and enabled Repository:
[satish@host]$ sudo yum repolist all


yum --showduplicates:
It displays all the available version of mentioned package:
[satish@host]$ sudo yum list available httpd --showduplicates 
[satish@host]$ sudo yum list docker-ce --showduplicates | sort -r
It displays all the available version of mentioned package except from the mentioned package:
[satish@host]$ sudo yum list available nginx --showduplicates --disablerepo=rhel-7-server-rpms 


Subscription-manager:
[satish@host]$ sudo subscription-manager unregister
[satish@host]$ sudo subscription-manager list -available
[satish@host]$ sudo subscription-manager list


Add repo to yum repository:
[satish@host]$ sudo yum-config-manager --add-repo repository_url


swap:

Remove and install package using single command:

[satish@host]$ yum swap httpd nginx

It will remove httpd and install nginx
Will keep updating this blog, stay tuned !!

Post a Comment

0 Comments