Introduction
RPM (Red Hat Package Manager) is a powerful package management system used in many Linux distributions, including Red Hat, CentOS, Fedora, and others. It allows users to install, upgrade, and manage software packages on their Linux systems. In this guide, we’ll explore 20 practical examples of RPM commands to help you effectively manage packages on your Linux system.
Prerequisites
Before proceeding, ensure you have:
- A Linux system with RPM package manager installed
- Root access to your system
Practical Examples
- Install Package:
rpm -ivh package.rpm
– Installs a package from a .rpm file. - Upgrade Package:
rpm -Uvh package.rpm
– Upgrades an existing package to a newer version. - Remove Package:
rpm -e package_name
– Removes a package from the system. - List Installed Packages:
rpm -qa
– Lists all installed packages on the system. - Query Package Information:
rpm -qi package_name
– Displays detailed information about a specific package. - Search for a Package:
rpm -q package_name
– Searches for a specific package on the system. - List Files in a Package:
rpm -ql package_name
– Lists all files installed by a package. - Verify Package Integrity:
rpm -V package_name
– Verifies the integrity of installed files for a package. - List Dependencies of a Package:
rpm -qR package_name
– Lists all dependencies required by a package. - Extract Files from a Package:
rpm2cpio package.rpm | cpio -idmv
– Extracts files from a .rpm package. - Show Package Scripts:
rpm -q --scripts package_name
– Displays pre-installation and post-installation scripts of a package. - Check for Duplicates:
rpm -Va
– Checks for duplicate files among installed packages. - Verify Signature of a Package:
rpm -K package.rpm
– Verifies the digital signature of a .rpm package. - Import GPG Key:
rpm --import /path/to/gpg_key
– Imports a GPG key used for package verification. - Check Disk Space Used by Packages:
rpm -q --queryformat "%{SIZE} %{NAME}\n" | sort -nr | less
– Displays disk space used by installed packages. - Query Package Changelog:
rpm -q --changelog package_name
– Displays the changelog of a package. - Query Package Documentation:
rpm -qd package_name
– Displays documentation files included in a package. - Check for Obsolete Packages:
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} %{ARCH}\n' -a | sort -u
– Checks for obsolete packages on the system. - Rebuild RPM Database:
rpm --rebuilddb
– Rebuilds the RPM package database. - Check for Package Updates:
yum check-update
– Checks for available updates for installed packages.
Conclusion
These 20 practical examples of RPM commands in Linux will help you effectively manage packages on your Linux system. By mastering these commands, you can install, upgrade, query, and verify packages with ease, ensuring smooth operation of your Linux system.
RDS CAL (Client Access License)
Keywords: windows vps uk, windows vps, uk windows vps, windows vps hosting uk, vps windows server, uk vps windows, vps windows, servidor vps windows, vps uk windows, vps with windows, virtual private server windows, windows virtual private server, windows vps server uk, vps for windows, servidores vps windows, vps windows uk, windows vps hosting, vps windows hosting, windows vps server, windows virtual private servers, vps on windows, vps windows servers, cheap windows vps uk, windowsvps, windows desktop vps, buy vps windows, windows server vps, windows 10 vps uk, rds services, rds cal, remote desktop services, remote desktop hosting
#windowsvps #vpshosting #ukvps #virtualserver #windowsvpsuk #vpsserver #hostingvps #cloudvps #windowsvpshosting #cheapvps #vpswithwindows #windowsserver #servervps #vpssolutions #vpswindows #rdscal #remotedesktop #remotedesktopvps #rds #windowsrds