RHEL/CentOS Yum Operations
The Yellowdog Updater, Modified has more features than most of us will ever need. Below are some hopefully useful examples that will help keep your system maybe secure by replacing old known bugs with new unknown, thus ensuring that only the NSA and people who hacked it have access to your kernel’s internals.
Security Updates
How does one go about installing the critical security updates. If you are feeling bold (and have good backups), you can just do “yum update”. However, if you are a professional sysamdin and are flying by the seat of your pants, I’d suggest using the awesome but little-known Yum security plugin:
# Install the plugin yum -y install yum-plugin-security # View available critical security upgrades yum --security check-update # View available Bugzilla updates for installed packages yum updateinfo list bugzillas # View a summary of advisories yum updateinfo summary # Update packages with security erratas to the latest security errata package yum --security update-minimal # Update packages with security erratas to the latest package version yum --security update
General Yum Commands
# List all available packages from defined repos yum list # List installed packages yum list installed # See which package provides a particular file or directory yum provides <pathname> # List/install/upgrade/uninstall software groups yum grouplist yum groupinstall '<group_name>' yum groupupdate '<group_name>' yum groupremove '<group_name>'
Repo Operations
# List enabled repos yum repolist # List all defined repos yum repolist all
Yum Verify
# Install Yum Utils and Verify plugins yum -y install yum-utils.noarch yum-verify # Verify packages containing pathname # Example below will show all packages with paths matching '*bin/*' pattern yum verify --verify-filenames='*bin/*' # Verify packages and re-install those with missing files # This can be useful for recovering damaged packages yum verify --verify-filenames='*bin/*' | grep "^[a-z].*:.*" | awk '{print $1}' | while read line ; doyum -y reinstall “${line}” ; done
You can find more information about verify and re-install operations here.