Package Management in RedHat/CentOS/Fedora¶
Fedora —> CentOS Stream —> RHEL
RPM package Format¶
.rpm file includes all configuration and files required to install software packages
https://mirror.stream.centos.org
AppStream more outer softwares, and BaseOS more core softwares
inspect rpm file¶
Install rpm file¶
Remove or uninstall rpm package¶
DNF (Dandified Yum)¶
Search package name¶
Install epel¶
Repositories in RHEL / CentOS / Fedora¶
yum and dnf will search packages in the repositories configured in /etc/dnf/dnf.conf or /etc/yum.repos.d/*.repo
:::info Need not required refresh of the repositories, everytime we install the package or upgrade the repositories definition list gets refreshed :::
Check what functionality a package can provide to the system¶
What provides filesystem
Check what functionality is required by the package if it is to be installes¶
What requires by package
Level of Dependencies¶
Optional Dependencies (weak): Recommended and Suggests¶
dnf repoquery --recommends packagename and dnf repoquery --suggests <package-name>
Disable weak dependencies¶
In the file /etc/dnf/dnf.conf make this false install_weak_deps=False or add it manually in new line
or use command dnf install <package-name> —setopt=install_weak_deps=False
:::info Pre-Install Dependency > Dependency > Recommends > Suggest :::
Remove / Keep dependencies while uninstall¶
clean_requiements_on_remove=False then run dnf autoremove
Remove package not dependency¶
Marking package to be installed by user¶
- When any package is installed, all its dependencies are marked as dependencies
- When any dependencies are installed using dnf or yum then it will be marked as dependency
- When any dependencies are installed using apt then it will be marked as user installed package
- To make any dependency to be marked as user installed using dnf or yum, the run
dnf mark install <package> - While removing packages, marked packages will not be removes even if it is dependency
Update and downgrade in RHEL / FEDORA / CentOS¶
Downgrade¶
dnf downgrade <package>
dnf downgrade <package-version>
List duplicates:¶
dnf list python3 —showduplicates
Prevent Packages from upgrade¶
dnf upgrade --exclude=python3
or dnf upgrade --exclude=python3,other-packages
Exclude permanently¶
in /etc/dnf/dnf.conf
Paste this line
excludepkgs=[packages]
Automatically keep the system upto date
DNF Modules¶
dnf module list
dnf module enable [module]:[stream]/[profile]
dnf module remove --all <nodejs>
dnf module disable <package>
dnf module reset <packages>
Repository: epel-release¶
EPEL: Extra Package for Enterprise Linux
This is community driven project,