💻To install a package
[root@alpha1 ajeet]# yum install nginx
If you face any difficulty in installation like resolving the hostname try any public DNS like 8.8.8.8 by updating your /etc/resolv.conf
or restart network manager below are the images of troubleshooting.
[root@alpha1 ajeet]# sudo systemctl restart NetworkManager
💻 To remove a package
[root@alpha1 ajeet]# yum remove nginx
💻 Update or Upgrade a Package
[root@alpha1 ajeet]# yum upgrade nginx
[root@alpha1 ajeet]# yum update nginx
Upgrade - will install the latest package, no rollback
Update - will install the latest package and keep the old package, we can rollback if needed
💻 Yum Option/History/Undo-Redo
💻 Search or Retrieve Package Info
[root@alpha1 ajeet]# yum search nginx
[root@alpha1 ajeet]# yum info nginx
💻 YUM vs DNF vs APT
Description | yum | dnf | apt |
Installs a package | yum install <package> | dnf install <package> | apt install <package> |
Removes a package | yum remove <package> | dnf remove <package> | apt remove <package> |
Updates installed packages to the latest versions | yum update | dnf upgrade | apt upgrade |
Searches for a package | yum search <package> | dnf search <package> | apt search <package> |
Lists all installed packages | yum list installed | dnf list installed | apt list --installed |
Lists available updates for installed packages | yum check-update | dnf check-update | apt list --upgradable |
Cleans up cached package files | yum clean all | dnf clean all | apt clean |
Updates the local package index | yum makecache | dnf makecache | apt update |
Displays detailed information about a package | yum info <package> | dnf info <package> | apt show <package> |
Upgrades the entire distribution (if available) | Not applicable | dnf system-upgrade | apt full-upgrade or apt dist-upgrade |
Upgrades installed packages to the latest versions | yum upgrade | dnf upgrade | apt upgrade |
💻 RPM to Try
Description | Command |
Install a package from a .rpm file | rpm -ivh <package.rpm> |
Upgrade a package from a .rpm file | rpm -Uvh <package.rpm> |
Remove a package | rpm -e <package> |
List installed packages | rpm -qa |
Show information about a package | rpm -qi <package> |
List files in an installed package | rpm -ql <package> |
Verify package integrity | rpm -V <package> |
Install a package and its dependencies | yum localinstall <package.rpm> |
Rebuild RPM package from source | rpmbuild -bb <specfile.spec> |
Extract contents of an RPM package | rpm2cpio <package.rpm> |
Compare two RPM packages | rpm -q --scripts <package1> <package2> |
Check dependencies for an RPM package | rpm -qpR <package.rpm> |
Query which package provides a file | rpm -qf <file> |
Query which package owns a file | rpm -q --whatprovides <file> |
Create an RPM database index | rpm --rebuilddb |
💻 Some more piping
Description | Command |
---|---|
List installed packages sorted by installation date |
|
Search for a package by keyword in installed packages |
|
Count the number of installed packages |
|
List the largest installed packages |
|
Remove all dependencies of a specific package |
|
Extract the contents of an RPM package and search for a file |
|
Show only package names without versions |
|
Show only package versions |
|
List dependencies for a package |
|
List files in an installed package starting with a specific prefix |
|
Thank you for joining me on this journey through Linux Process Management (LPM). I truly appreciate your passion and dedication to learning. Keep exploring, stay curious, and happy coding!