GENERAL YUM COMMANDS
yum install ||
yum localinstall # outdated; can just use yum install these days
yum remove
yum update
yum search
yum whatprovides|provides
yum deplist
yum info
--downloadonly
--disablerepo=*
--enablerepo=*
yum list installed | grep
yum list available
yum list all
yum grouplist
yum groupinfo
yum history
yum history info
yum history redo
yum history undo
yum rollback
MAKE YR OWN CUSTOM REPO
mkdir -p /myrepo/install /myrepo/download
# make the directories
yum install --downloadonly --installroot=/myrepo/install --releasever= --downloaddir=/myrepo/download
# chroot the install env so yum will download ALL the deps, not just the ones that your current machine needs
createrepo --database /myrepo/download
# make it a repo
vi /etc/yum.repos.d/myrepo.repo
[offline]
name=My custom repo
baseurl=file:///myrepo/download
enabled=0
gpgcheck=1
gpgkey=>
# make the .repo file
# edit the GPG keyfile location to be the right one!
repoclosure --repoid=myrepo
# check dependencies
yum --nogpgcheck --disablerepo=\* --enablerepo=myrepo install
# install from this repo!
# --nogpgcheck maybe needed
OTHER YUM MAGIC
if you get this error:
error: unpacking of archive failed on file : cpio: lsetfilecon
then the problem is related to selinux improper file contexts
to workaround, run yum with:
--setopt=tsflags="nocontexts"
MORE INFO
https://www.thegeekdiary.com/centos-rhel-how-to-create-and-host-yum-repository-over-httpd/
yum cheatsheet from RHEL, semi-outdated, hosted here for convenience: caiser.net/magic/cheatsheets/yum.pdf