LoginSignup
0
2

More than 5 years have passed since last update.

[apt][aptitude] パッケージの過去バージョンも含めた取得可能バージョンを調べる方法

Last updated at Posted at 2017-03-02

GitLabのアップデートの前にパッケージのバージョンを見たかったため、やり方を調べたメモ

apt の場合

apt-cache policy <package name> を使用する

aptの場合
$ sudo apt-get update
$ apt-cache policy gitlab-ce | head
gitlab-ce:
  Installed: 8.16.1-ce.0
  Candidate: 8.17.2-ce.0
  Version table:
     8.17.2-ce.0 0
        500 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty/main amd64 Packages
     8.17.1-ce.2 0
        500 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty/main amd64 Packages
     8.17.0-ce.0 0
        500 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty/main amd64 Packages
特定バージョンの最新バージョン名を取得
$ export specific_version=8.11.0
$ apt-cache policy gitlab-ce | tail -n +5 | grep -v "http" | awk '{print $1}' | sort -r | grep ${specific_version} | head -n 1
8.11.0-ce.1

aptitude の場合

aptitude versions <package name> を使用する。
aptitudeはaptと逆順表示なので注意。

aptitudeの場合
$ sudo aptitude update
$ aptitude versions gitlab-ce | tail
p   8.16.3-ce.0                                   trusty                    500
p   8.16.3-ce.1                                   trusty                    500
p   8.16.4-ce.0                                   trusty                    500
p   8.16.5-ce.0                                   trusty                    500
p   8.16.5-ce.1                                   trusty                    500
p   8.16.6-ce.0                                   trusty                    500
p   8.16.7-ce.0                                   trusty                    500
p   8.17.0-ce.0                                   trusty                    500
p   8.17.1-ce.2                                   trusty                    500
p   8.17.2-ce.0                                   trusty                    500

参考

Check package version using apt-get/aptitude? - Unix & Linux Stack Exchange

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2