some useful "yum" and "rpm" commands:
# rpm --checksig <.rpm> (Need to check signature of an rpm)
# rpm -ivh <rpm-package> (Installing an rpm package)
# rpm -qpR <rpm-package> (Checking dependencies of rpm package before installing it)
# rpm -ivh --nodeps <rpm-package> (Installing a rpm without dependencies)
# rpm -qa <rpm> (Checking installed rpm)
# rpm -ql <package-name> (List of files of an installed rpm packages)
# rpm -qa --last (List recently installed rpm package)
# rpm -qa (List all installed rpm package)
# rpm -Uvh <rpm-package> (Upgrading an rpm package)
# rpm -e <rpm-package> (Removing an rpm package)
# rpm -e --nodeps <rpm-package> (removing without dependecies)
# rpm -qf /usr/bin/htpasswd (Query a file belongs to which rpm package)
# rpm -qi vsftpd (Query an information of an installed rpm package)
# rpm -qip <rpm-package> (Getting information of an rpm package before installing it)
# rpm -qdf /usr/bin/vmstat (Getting documentation details of a installed rpm package)
# rpm -Vp <rpm-package> (Verifying a package compares information of the package against the rpm database)
# rpm -Va (Verify all installed package)
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 (Importing a rpm GPG key)
# rpm -qa gpg-pubkey* (Listing installed gpg key)
Rebuilding a corrupted rpm database:
# cd /var/lib
# rm __db*
# rpm --rebuilddb
# rpmdb_verify Packages
YUM “Yellowdog Updater, Modified”
# yum install package (Installing a rpm package)
# yum install -y package (Installing a rpm package without prompting for y/n)
# yum remove package (Removing a package)
# yum -y remove package (Removing a package without prompting for y/n)
# yum update package (Updating a package and without prompting for y/n)
# yum -y update package
# yum list package (List of packages)
# yum search package (Searching for a package)
# yum info package (Getting info of package)
# yum list | less (List of available packages)
# yum provides /etc/httpd/conf/httpd.conf (Getting information of packages for a specific file belongs to which rpm)
# yum check-update (Checking available updates)
# yum grouplist (List all available groups package)
Installing, updating and removing a group package:
# yum install ”MySQL Database”
# yum update ”MySQL Database”
# yum remove ”MySQL Database”
Listing repository:
# yum repolist
# yum repolist all
Installing a package through a specific repository:
# yum --enablerepo=epel install phpmyadmin
Interactive yum shell which is providing you the shell where you can run multiple commands there:
# yum shell
# yum clean all (Cleaning of cache)
# yum provides */genkey (Checking which rpm is required for the command)
One thought on “Some useful “YUM” and “RPM” Commands”