如何在安装软件包之前知道将要安装的软件包的版本?

如何在安装软件包之前知道将要安装的软件包的版本?

我可以添加一个ppa可以改变存储库中包版本的内容 - 例如 Inkscape 有一个开发版本。

在我使用 安装“Inkscape”之前sudo apt-get install inkscape,我如何知道将安装哪个版本?

答案1

使用apt-cache policy

$ apt-cache policy gitlab-ce
gitlab-ce:
  Installed: 8.6.1-ce.0
  Candidate: 8.7.0-ce.0
  Version table:
     8.7.0-ce.0 0
        500 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty/main amd64 Packages
     8.6.7-ce.0 0
        500 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty/main amd64 Packages
     8.6.6-ce.0 0
        500 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty/main amd64 Packages
     8.6.5-ce.0 0
        500 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty/main amd64 Packages
     8.6.4-ce.0 0
        500 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty/main amd64 Packages
     8.6.3-ce.0 0
        500 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty/main amd64 Packages
     8.6.2-ce.0 0
        500 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty/main amd64 Packages
 *** 8.6.1-ce.0 0
        500 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     8.6.0-ce.0 0
        500 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty/main amd64 Packages
     8.5.11-ce.1 0
        500 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty/main amd64 Packages
     8.5.10-ce.0 0
        500 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty/main amd64 Packages

将选取列为 的版本Candidate。当前版本(如果有)将列为Installed并用星号标记。

相关内容