SIer だけど技術やりたいブログ

CentOS パッケージの更新履歴やバグを確認する

linux

yum-cronでパッケージを自動更新していると、いつの間にかパッケージが思った動作をしなくなることがある。このとき、調べた方法のメモ。

検証バージョン

]$ uname -a
Linux localhost.localdomain 3.10.0-957.1.3.el7.x86_64 #1 SMP Thu Nov 29 14:49:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
]$ yum --version
3.4.3
...

パッケージの更新履歴を確認する

まず、コマンドが、どのパッケージに含まれているかを調べる。

]$ which ls
alias ls='ls --color=auto'
        /usr/bin/ls
]$ rpm -qf /usr/bin/ls
coreutils-8.22-23.el7.x86_64

次に、yumリポジトリから更新履歴を見る。

# 概要を表示する
]$ sudo yum history packages-list coreutils
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, langpacks
ID     | Action(s)      | Package
-------------------------------------------------------------------------------
    41 | Updated        | coreutils-8.22-11.el7.x86_64                       EE
    41 | Update         |           8.22-23.el7.x86_64                       EE
     1 | Install        | coreutils-8.22-11.el7.x86_64

## 詳細を表示する
]$ sudo yum history package-info coreutils
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, langpacks
Transaction ID : 41
Begin time     : Fri Dec 28 10:14:22 2018
Package        : coreutils-8.22-11.el7.x86_64
State          : Updated
Size           : 14567245
Build host     : worker1.bsys.centos.org
Build time     : Tue Jun 10 10:08:24 2014
Packager       : CentOS BuildSystem <http://bugs.centos.org>
Vendor         : CentOS
License        : GPLv3+
URL            : http://www.gnu.org/software/coreutils/
Source RPM     : coreutils-8.22-11.el7.src.rpm
Commit Time    : Fri Jan 24 21:00:00 2014
Committer      : Daniel Mach <dmach@redhat.com>
Reason         : user
From repo      : anaconda
Installed by   : System <unset>

...

バージョンがわかったら、更新履歴を表示する。

]$ rpm --changelog -q coreutils | head -n 10
* Fri Jun 15 2018 Kamil Dudka <kdudka@redhat.com> - 8.22-23
- update description of the -a/--all option in df.1 man page (#1553212)
- sort -M: fix memory leak when using multibyte locale (#1540059)

* Wed Jan 24 2018 Kamil Dudka <kdudka@redhat.com> - 8.22-22
- mv -n: do not overwrite the destination (#1526265)

* Mon Dec 04 2017 Kamil Dudka <kdudka@redhat.com> - 8.22-21
- timeout: revert the last fix for a possible race (#1439465)

公式ページを見る

rpmから、公式ページを探す。

]$ rpm -qi coreutils
Name        : coreutils
...
URL         : http://www.gnu.org/software/coreutils/

サイトにアクセスすれば、マニュアルが見れる。

バグを確認する

公式ページからたどれることが多い。

ソースコードをダウンロードする

yumdownloader を使えば、ソースコードがダウンロードできる。

]$ yumdownloader --source coreutils-8.22-23.el7.x86_64
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, langpacks
Enabling updates-source repository
Enabling pgdg96-source repository
Enabling base-source repository
Enabling extras-source repository
Enabling docker-ce-stable-source repository
Enabling epel-source repository
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: ftp.iij.ad.jp
 * epel-source: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
coreutils-8.22-23.el7.src.rpm
]$ rpm2cpio coreutils-8.22-23.el7.src.rpm | cpio -id
11298 blocks
]$ tar -xJf coreutils-8.22.tar.xz