Yum

百勝安裝,格式 - ‘packageName.archName-versionNumber’ 說沒有包

  • September 8, 2015

當我嘗試yum install body_guard從我的本地倉庫執行時,它顯示以下包詳細資訊,

---> Package body_guard.x86_64 0:0.2-0313 will be updated
---> Package body_guard.x86_64 0:0.2-0315 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================
===
Package                               Arch                           Version                            Repository                       Size
===============================================================================================================================================
Updating:
body_guard                         x86_64                         0.2-0315                           my-sg                          18 M

當我嘗試安裝相同 yum 軟體包的舊版本(比如 312)時,它失敗了No package body_guard.x86_64-0.2-0312 available

我使用 hypen 作為包名和版本號之間的分隔符(格式為packageName.archName-versionNumber),並發出命令,

yum install body_guard.x86_64-0.2-0312

在這樣做時yum --showduplicates,我可以看到存在一個版本號為 -0.2-312

yum 手冊頁

Specifying package names
             A  package can be referred to for install,update,list,remove etc
             with any of the following:

             name
             name.arch
             name-ver
             name-ver-rel
             name-ver-rel.arch
             name-epoch:ver-rel.arch
             epoch:name-ver-rel.arch

             For example: yum remove kernel-2.4.1-10.i686

我認為你放錯了 {arch} 它應該是最後,正確的語法是:

yum install <package_name>-<version>-<rel>.<arch>  

嘗試:

yum install body_guard-0.2-0312.x86_64

引用自:https://unix.stackexchange.com/questions/228210