参考:https://www.if-not-true-then-false.com/2010/yum-downgrade-packages-on-fedora-centos-red-hat-rhel/
YUM降级基本用法
当包没有任何依赖关系时,降级是非常简单的。
YUM降级(没有依赖)
yum downgrade package
例:
yum downgrade hunspell-mr.noarch Setting up Downgrade Process Resolving Dependencies --> Running transaction check ---> Package hunspell-mr.noarch 0:20060920-5.fc13 set to be downgraded ---> Package hunspell-mr.noarch 0:20060920-6.fc14 set to be erased --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Downgrading: hunspell-mr noarch 20060920-5.fc13 fedora 62 k Transaction Summary ================================================================================ Downgrade 1 Package(s) Total download size: 62 k Is this ok [y/N]: y Downloading Packages: hunspell-mr-20060920-5.fc13.noarch.rpm | 62 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : hunspell-mr-20060920-5.fc13.noarch 1/2 Cleanup : hunspell-mr-20060920-6.fc14.noarch 2/2 Removed: hunspell-mr.noarch 0:20060920-6.fc14 Installed: hunspell-mr.noarch 0:20060920-5.fc13 Complete!
YUM降级(有依赖)
对于具有依赖关系的包,YUM降级更加困难。YUM降级不会自动解决依赖关系,因此必须手动完成。
YUM降级包和依赖关系
yum downgrade lib1 lib2 package
示例:手动检查包依赖项
yum downgrade sqlite Setting up Downgrade Process Resolving Dependencies --> Running transaction check ---> Package sqlite.i686 0:3.6.22-1.fc13 set to be downgraded ---> Package sqlite.i686 0:3.6.23-1.fc14 set to be erased --> Finished Dependency Resolution Error: Package: sqlite-devel-3.6.23-1.fc14.i686 (@rawhide/12) Requires: sqlite = 3.6.23-1.fc14 Removing: sqlite-3.6.23-1.fc14.i686 (@rawhide/12) sqlite = 3.6.23-1.fc14 Downgraded By: sqlite-3.6.22-1.fc13.i686 (fedora) sqlite = 3.6.22-1.fc13 You could try using --skip-broken to work around the problem SQLite包依赖于sqlite-devel包,因此必须降级(sqlite-devel和sqlite): yum downgrade sqlite-devel sqlite Setting up Downgrade Process Resolving Dependencies --> Running transaction check ---> Package sqlite.i686 0:3.6.22-1.fc13 set to be downgraded ---> Package sqlite.i686 0:3.6.23-1.fc14 set to be erased ---> Package sqlite-devel.i686 0:3.6.22-1.fc13 set to be downgraded ---> Package sqlite-devel.i686 0:3.6.23-1.fc14 set to be erased --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Downgrading: sqlite i686 3.6.22-1.fc13 fedora 309 k sqlite-devel i686 3.6.22-1.fc13 fedora 80 k Transaction Summary ================================================================================ Downgrade 2 Package(s) Total download size: 389 k Is this ok [y/N]: y Downloading Packages: (1/2): sqlite-3.6.22-1.fc13.i686.rpm | 309 kB 00:00 (2/2): sqlite-devel-3.6.22-1.fc13.i686.rpm | 80 kB 00:00 -------------------------------------------------------------------------------- Total 438 kB/s | 389 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : sqlite-3.6.22-1.fc13.i686 1/4 Installing : sqlite-devel-3.6.22-1.fc13.i686 2/4 Cleanup : sqlite-devel-3.6.23-1.fc14.i686 3/4 Cleanup : sqlite-3.6.23-1.fc14.i686 4/4 Removed: sqlite.i686 0:3.6.23-1.fc14 sqlite-devel.i686 0:3.6.23-1.fc14 Installed: sqlite.i686 0:3.6.22-1.fc13 sqlite-devel.i686 0:3.6.22-1.fc13 Complete!