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 sqlite-devel  #要加上依赖

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!
Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐