When working with RPM-based systems where package managers like yum/dnf aren't available (minimal installations, recovery environments, or legacy systems), downgrading packages requires manual intervention. The standard yum downgrade
or dnf downgrade
commands won't be available in these scenarios.
Before proceeding, ensure you have:
- The target RPM package file (example-2.4.rpm in your case)
- Root privileges (use
sudo -i
if necessary) - Basic RPM command knowledge
- Backup of important data
First check currently installed version:
rpm -q example-package
# Output: example-package-3.2-1.el7.x86_64
Use RPM's --oldpackage
flag with force options:
rpm -Uvh --oldpackage example-package-2.4-1.el7.x86_64.rpm
Breaking down the command:
-U
for upgrade (works for downgrades too)-v
for verbose output-h
for hash marks progress--oldpackage
allows installation of older version
If you encounter dependency errors, you may need to:
rpm -Uvh --oldpackage --nodeps example-package-2.4-1.el7.x86_64.rpm
Warning: --nodeps
skips dependency checks and might break your system. Only use when absolutely necessary and you understand the consequences.
Confirm the version change:
rpm -q example-package
# Should now show: example-package-2.4-1.el7.x86_64
If the above method fails, try removing the package completely first:
rpm -e example-package
rpm -ivh example-package-2.4-1.el7.x86_64.rpm
File conflicts: Add --replacefiles
flag if files from different packages overlap.
Configuration preservation: RPM typically preserves modified config files with .rpmnew extensions.
Transaction errors: Check /var/lib/rpm/__db*
files and try rebuilding the database:
rm -f /var/lib/rpm/__db*
rpm --rebuilddb
For batch processing, create a script:
#!/bin/bash
for pkg in *.rpm; do
rpm -Uvh --oldpackage "$pkg"
done
When working with RPM-based systems that lack package managers like YUM or DNF, downgrading packages requires manual intervention. This situation commonly occurs in:
- Minimal installations without package managers
- Air-gapped systems with restricted access
- Legacy systems where package managers are unavailable
Before proceeding with the downgrade, take these essential steps:
# Check currently installed version
rpm -q package-name
# Verify dependencies
rpm -qpR package-2.4.rpm
# Create system backup (recommended)
tar -czvf system-backup-$(date +%Y%m%d).tar.gz /etc /var/lib/rpm
Execute these commands in sequence for a clean downgrade:
# Remove current version (preserve config files)
rpm -e --nodeps package-name
# Install older version
rpm -ivh --oldpackage package-2.4.rpm
# Verify successful installation
rpm -V package-name
When dealing with dependency problems during manual downgrades:
# Force installation (use with caution)
rpm -ivh --nodeps --force package-2.4.rpm
# Check file conflicts
rpm -qp --conflicts package-2.4.rpm
# Resolve file conflicts by renaming existing files
mv /path/to/conflicting/file /path/to/conflicting/file.bak
After successful installation, perform these checks:
# Verify package version
rpm -q package-name
# Check file integrity
rpm -V package-name
# Test basic functionality
package-name --version
package-name --help
If you have RPM history records, consider this method:
# View installation history
rpm -qa --last
# Rollback to previous version
rpm -Uvh --rollback 'package-name-2.4'