apt-get install -dry-run的输出是什么意思?
我想升级服务器以确保修补最近的OpenSSL错误。 因此,要检查我将要安装的东西的版本,我运行apt-get install --dry-run
,并看到如下行:
Inst openssl [1.0.1-4ubuntu5.11] (1.0.1-4ubuntu5.12 Ubuntu:12.04/precise-updates [amd64])
我意识到我不知道这意味着什么。 这是否意味着它将安装1.0.1-4ubuntu5.11
并且5.12
可用,或者我当前正在运行5.11
并且它将升级到5.12
?
根据要求,这是apt-cache policy openssl
的输出:
openssl: Installed: 1.0.1-4ubuntu5.11 Candidate: 1.0.1-4ubuntu5.12 Version table: 1.0.1-4ubuntu5.12 0 500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages 500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages *** 1.0.1-4ubuntu5.11 0 100 /var/lib/dpkg/status 1.0.1-4ubuntu3 0 500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
……我认为这样可以解决问题。 看起来它将从archive.ubuntu.com
或security.ubuntu.com
获取5.12
。 什么是前500
?
正如您已经知道的那样, apt-get --dry-run
的输出意味着您的系统上当前安装了openssl 1.0.1-4ubuntu5.11
,并且它将被openssl 1.0.1-4ubuntu5.12
替换为运行install命令。
apt-cache policy openssl
输出中的数字(500和100)表示给定存储库的优先级。 正如您所看到的, openssl 1.0.1-4ubuntu5.12
软件包可以从两个存储库中获得( precise-updates
和precise-security
),优先级为500.如果precise-security
优先级为700,则apt -get将首先尝试从该存储库下载该包。
你是对的,它将从http://archive.ubuntu.com安装openssl
1.0.1-4ubuntu5.12。
500
是源的优先级。 请参阅https://wiki.debian.org/AptPreferences