Tuesday, February 12, 2019

Useful Yum commands

Few useful yum commands

  1. yum list installed - Gives a list of already installed packages
  2. yum history list   - Gives a list yum installs. Note that one can install multiple packages and their dependencies in a single invocation. Example, yum install docker-ce, docker-ce-cli
  3. yum history info   - Gives the details of yum invocation for each of the historical entry above.
  4. /var/log/yum.log - also contains log of yum installs
  5. yum list docker-ce --showduplicates | sort -r  - Shows all the versions that are present for docker and sorts them.

To find difference in packages between installs -

  • Before installation - 

rpm -qa --qf '%{NAME}.%{ARCH}\n' | sort > old-installed-rpms.txt

  • After installation - 

rpm -qa --qf '%{NAME}.%{ARCH}\n' | sort > new-installed-rpms.txt

  • Diff - 
diff old-installed-rpms.txt new-installed-rpms.txt | grep '^<'



No comments: