Downgrading an RPM package in Linux is useful when a recent update causes compatibility issues or breaks applications. In this guide, you will learn how to downgrade RPM packages using yum and rpm, install specific versions, and safely handle dependencies and rollback scenarios.
Check Installed and Available RPM Versions
Before downgrading any package, always verify the current version and available versions. This helps avoid installing the wrong version and breaking dependencies.
Check installed package version using rpm
Use the following command to check the currently installed version:
rpm -qa | grep <package-name>Example:
rpm -qa | grep bashYou will see output like:
bash-4.2.46-29.el7_4.x86_64This confirms the currently installed version.
List all available versions using yum or dnf
To safely downgrade, you must first check which versions are available in your repository.
yum list --showduplicates <package-name>OR (for newer systems):
dnf list --showduplicates <package-name>Example:
yum list --showduplicates bashThis will show all available versions:
bash.x86_64 4.2.46-28.el7 repo
bash.x86_64 4.2.46-31.el7 repoIdentify correct version before downgrade
Before proceeding:
- Choose a version that is stable and compatible
- Avoid downgrading core packages blindly (like
glibc,systemd) - Prefer versions from official repositories
- Ensure the version is not too old, which may break dependencies
Downgrade RPM Using yum (Recommended Method)
yum downgradeis the safest method because it handles dependencies automatically.
Downgrade using local RPM file
If you already have the older RPM file:
yum downgrade /path/to/package.rpmExample:
yum downgrade /tmp/bash-4.2.46-28.el7.x86_64.rpmDowngrade using repository version
If the version exists in your repo:
yum downgrade <package-name>-<version>Example:
yum downgrade bash-4.2.46-28.el7.x86_64Skip confirmation using -y option
To avoid manual confirmation:
yum downgrade -y bash-4.2.46-28.el7.x86_64Verify downgrade success
Always verify after downgrade:
rpm -qa | grep <package-name>Example:
rpm -qa | grep bashImportant safety tips (DO NOT SKIP)
- Always test on a non-production system first
- Avoid downgrading multiple packages at once
- Do not interrupt the downgrade process
- Ensure system has internet access (for dependencies)
Install Specific Version of Package Using yum
Sometimes you don’t need a downgrade — you just want to install a specific version.
Install exact version from repository
Use:
yum install <package-name>-<version>Example:
yum install bash-4.2.46-28.el7.x86_64Prevent automatic upgrade during install
After installing a specific version, prevent it from being upgraded:
Install versionlock plugin:
yum install yum-plugin-versionlockLock the package:
yum versionlock add <package-name>Example:
yum versionlock add bashHandle multiple versions availability
If multiple versions exist:
yum list --showduplicates <package-name>Then choose the exact version carefully.
Downgrade RPM Using rpm Command (Force Method)
The rpm command can be used to downgrade packages directly, but this method does NOT handle dependencies automatically. Use this only when you are sure about the package compatibility.
Syntax using --oldpackage option
Use the following command to downgrade:
rpm -Uvh /path/to/package.rpm --oldpackageExample:
rpm -Uvh /tmp/bash-4.2.46-28.el7.x86_64.rpm --oldpackageThis will replace the newer version with the older one.
Difference between --oldpackage and --force
--oldpackage
Allows installing an older version over a newer one (safe for downgrade)--force
Forces installation regardless of conflicts (NOT recommended)
Example of force (avoid unless necessary):
rpm -Uvh /path/to/package.rpm --forceRisks of forcing RPM downgrade
Using rpm without dependency handling can lead to:
- Broken dependencies
- Application crashes
- System instability
- Package conflicts
Beginner advice:
- Prefer
yum downgradeoverrpm - Use
rpmonly when:- No repo version is available
- You fully understand dependencies
Downgrade Package with Dependencies Handling
When downgrading packages, dependency management is critical to avoid breaking the system.
How yum resolves dependencies automatically
When you use:
yum downgrade <package>Yum will:
- Check required dependencies
- Downgrade dependent packages if needed
- Prevent unsafe operations
This makes it the safest option.
What happens when dependencies mismatch
You may encounter errors like:
Error: Package: xyz requires abc >= versionThis means:
- The older version depends on a different version of another package
- Downgrade cannot proceed safely
Fix dependency issues during downgrade
Follow these steps:
- Check dependency requirements:
repoquery --requires <package-name>- Downgrade dependent packages together:
yum downgrade package1 package2- Use
yum shellfor controlled downgrade:
yum shellInside shell:
downgrade <package>
run- If needed, temporarily disable conflicting repos:
yum --disablerepo=<repo-name> downgrade <package>Beginner tip:
- Never ignore dependency errors
- Avoid using
--nodepsunless absolutely necessary
Rollback RPM Package After Update
If a recent update caused issues, you can rollback using yum history.
Using yum history undo
Check transaction history:
yum historyUndo a specific transaction:
yum history undo <ID>Example:
yum history undo 10Using yum history rollback
Rollback to a previous state:
yum history rollback <ID>Example:
yum history rollback 8This will revert all changes after that transaction.
Limitations of rollback in RPM-based systems
- Works only if history is available
- Not all dependencies may revert cleanly
- May fail if packages are no longer available in repo
- Not reliable for major system upgrades
Beginner advice:
- Use rollback for small changes only
- For critical systems, prefer backup/restore
Prevent Package Upgrade After Downgrade
After downgrading, you may want to prevent automatic upgrades.
Install yum-plugin-versionlock
Install plugin:
yum install yum-plugin-versionlockFor newer systems:
dnf install 'dnf-command(versionlock)'Lock package version using yum versionlock
Lock a package:
yum versionlock add <package-name>Example:
yum versionlock add bashVerify locked packages
Check locked packages:
yum versionlock listExample output:
bash-0:4.2.46-28.el7.*- Locked packages will not be upgraded during
yum update - Useful for production systems where stability is critical
Frequently Asked Questions
1. How do I downgrade an RPM package in Linux?
You can downgrade an RPM package using yum downgrade2. How to install a specific version of a package using yum?
Use yum install package-version to install a specific version. You can list available versions using yum list --showduplicates.3. What is the difference between yum and rpm for downgrade?
Yum resolves dependencies automatically, while rpm performs a direct installation. Yum is safer for most use cases, whereas rpm is used for manual or forced downgrades.4. Can I rollback a package update in Linux?
Yes, you can use yum history undo5. How to prevent package upgrade after downgrade?
You can lock the package version using yum versionlock addSummary
Downgrading RPM packages can help resolve compatibility issues, but it must be done carefully. Use yum downgrade whenever possible, as it safely handles dependencies. The rpm command should be used only for advanced or manual scenarios. Always verify versions, check dependencies, and consider locking packages after downgrade to prevent unintended upgrades.



![How to list packages in a yum group? [SOLVED]](/how-to-list-packages-in-a-yum-group/yum-grouplist-packages_hu_7b9bd0f2758b438a.webp)

![Could not resolve host: mirrors.rockylinux.org [SOLVED]](/could-not-resolve-host-mirrors-rockylinux-org/setup_offline_repo_hu_88da60d085e271b6.webp)



![Setup local YUM/DNF repo server Rocky Linux 8 [Step-by-Step]](/local-offline-yum-dnf-repo-http-rocky-linux-8/offline_repo_hu_32c0d634b123a436.webp)
