Sles

zypper 退出程式碼 106 - 如何修復?

  • January 7, 2018

在 SLES11.4 伺服器上想要安裝一個包:

SLES11SERVER:~ # zypper in -f telnet
Retrieving repository 'foobar_common' metadata [\]
File 'repomd.xml' from repository 'foobar_common' is unsigned, continue? [yes/no] (no): yes
Retrieving repository 'foobar_common' metadata [error]
Repository 'foobar_common' is invalid.
[|] Valid metadata not found at specified URL(s)
Please check if the URIs defined for this repository are pointing to a valid repository.
Warning: Disabling repository 'foobar_common' because of the above error.
Some of the repositories have not been refreshed because of an error.
Loading repository data...
Reading installed packages...
Forcing installation of 'telnet-1.2-134.24.1.x86_64' from repository 'SLES11-SP4-Pool'.
Resolving package dependencies...

The following package is going to be reinstalled:
 telnet

1 package to reinstall.
Overall download size: 54.0 KiB. No additional space will be used or freed after the operation.
Continue? [y/n/? shows all options] (y): y
Retrieving package telnet-1.2-134.24.1.x86_64 (1/1), 54.0 KiB (118.0 KiB unpacked)
Retrieving: telnet-1.2-134.24.1.x86_64.rpm [done]
Installing: telnet-1.2-134.24.1 [done]
SLES11SERVER:~ # echo $?
106
SLES11SERVER:~ #

根據手冊頁:

106 - ZYPPER_EXIT_INF_REPOS_SKIPPED
          Some repository had to be disabled temporarily because it failed to refresh. You should check your
          repository configuration (e.g.  zypper ref -f).

所以我做了一個“zypper ref -f”:

SLES11SERVER:~ # zypper ref -f
...
Retrieving repository 'foobar_common' metadata [/]
File 'repomd.xml' from repository 'foobar_common' is unsigned, continue? [yes/no] (no): yes
Retrieving repository 'foobar_common' metadata [error]
Repository 'foobar_common' is invalid.
[|] Valid metadata not found at specified URL(s)
Please check if the URIs defined for this repository are pointing to a valid repository.
Skipping repository 'foobar_common' because of the above error.
Forcing raw metadata refresh
...
Some of the repositories have not been refreshed because of an error.
SLES11SERVER:~ #

該軟體包已安裝(來自另一個儲存庫,此 foobar_common 未提供它),但在安裝軟體包後,我必須為 zypper 設置退出程式碼 0。

**問:**如何解決 zypper 不會給出退出程式碼 106 的問題?

我試過了:

  • 刪除/添加 foobar_common 倉庫,同樣的問題

問題出在儲存庫方面(回購操作團隊的PEBKAC :))

還有,zypper clean --all有幫助。

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