R.A. Epigonos et al.

[debian] debsumsで壊れたパッケージを探し、修正する。

システムのアップデートをした後とか、なんだか調子が悪いということがある。再インストールする前に、せめてパッケージの破壊がないかどうかぐらいはチェックしておきたい。

まずはチェックを行う。"debsums: no md5sums for ****"という出力はそれぞれのパッケージにチェックサムがないことが原因なので、何らかの変更があったファイルを意味しているわけではない。ここでもんだいなのは、ファイルパスと共に表示されたファイルと、"debsums: missing file ****"という表示である。

# debsums -c
debsums: no md5sums for binutils
debsums: no md5sums for dhcp3-client
debsums: no md5sums for dhcp3-common
debsums: no md5sums for dhcp3-server
debsums: no md5sums for emacsen-common
debsums: no md5sums for g++
debsums: no md5sums for git
debsums: no md5sums for git-core
debsums: no md5sums for gnuplot
debsums: no md5sums for klogd
debsums: no md5sums for libreadline-dev
debsums: no md5sums for mawk
debsums: no md5sums for netbase
/usr/bin/pod2latex
/usr/bin/config_data
/usr/share/perl/5.10.1/constant.pm
/usr/share/perl/5.10.1/ExtUtils/Manifest.pm
/usr/share/perl/5.10.1/ExtUtils/MANIFEST.SKIP
/usr/share/perl/5.10.1/Module/Build/Compat.pm
/usr/share/perl/5.10.1/Module/Build/YAML.pm
/usr/share/perl/5.10.1/Module/Build/Notes.pm
/usr/share/perl/5.10.1/Module/Build/Base.pm
/usr/share/perl/5.10.1/Module/Build/Platform/VOS.pm
/usr/share/perl/5.10.1/Module/Build/Platform/Windows.pm
/usr/share/perl/5.10.1/Module/Build/Platform/darwin.pm
/usr/share/perl/5.10.1/Module/Build/Platform/os2.pm
/usr/share/perl/5.10.1/Module/Build/Platform/aix.pm
/usr/share/perl/5.10.1/Module/Build/Platform/RiscOS.pm
/usr/share/perl/5.10.1/Module/Build/Platform/Default.pm
/usr/share/perl/5.10.1/Module/Build/Platform/VMS.pm
/usr/share/perl/5.10.1/Module/Build/Platform/MacOS.pm
/usr/share/perl/5.10.1/Module/Build/Platform/MPEiX.pm
/usr/share/perl/5.10.1/Module/Build/Platform/EBCDIC.pm
/usr/share/perl/5.10.1/Module/Build/Platform/Unix.pm
/usr/share/perl/5.10.1/Module/Build/Platform/Amiga.pm
/usr/share/perl/5.10.1/Module/Build/Platform/cygwin.pm
/usr/share/perl/5.10.1/Module/Build/API.pod
/usr/share/perl/5.10.1/Module/Build/ModuleInfo.pm
/usr/share/perl/5.10.1/Module/Build/Dumper.pm
/usr/share/perl/5.10.1/Module/Build/PodParser.pm
/usr/share/perl/5.10.1/Module/Build/PPMMaker.pm
/usr/share/perl/5.10.1/Module/Build/Cookbook.pm
/usr/share/perl/5.10.1/Module/Build/ConfigData.pm
/usr/share/perl/5.10.1/Module/Build/Version.pm
/usr/share/perl/5.10.1/Module/Build/Config.pm
/usr/share/perl/5.10.1/Module/Build.pm
/usr/share/perl/5.10.1/Locale/Country.pm
/usr/share/perl/5.10.1/Locale/Script.pm
/usr/share/perl/5.10.1/Locale/Constants.pm
/usr/share/perl/5.10.1/Locale/Currency.pm
/usr/share/perl/5.10.1/Locale/Language.pm
/usr/share/perl/5.10.1/Locale/Constants.pod
/usr/share/perl/5.10.1/Locale/Script.pod
/usr/share/perl/5.10.1/Locale/Currency.pod
/usr/share/perl/5.10.1/Locale/Language.pod
/usr/share/perl/5.10.1/Locale/Country.pod
/usr/share/perl/5.10.1/Pod/LaTeX.pm
debsums: no md5sums for python-dev
debsums: no md5sums for sysklogd

debsums: missing file /usr/share/doc/xpdf-reader/changelog.Debian.gz (from xpdf-reader package)
debsums: missing file /usr/share/doc/xpdf-reader/changelog.gz (from xpdf-reader package)
debsums: missing file /usr/share/doc/xpdf-reader/copyright (from xpdf-reader package)
debsums: missing file /usr/share/doc/xpdf-utils/changelog.Debian.gz (from xpdf-utils package)
debsums: missing file /usr/share/doc/xpdf-utils/changelog.gz (from xpdf-utils package)
debsums: missing file /usr/share/doc/xpdf-utils/copyright (from xpdf-utils package)

xpdf-readerパッケージに含まれるべきファイルが見つからないといわれるのでこのパッケージを再インストールする。インストールしようとしてもインストール済みなのでインストールできない。

# aptitude install xpdf-reader
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

# aptitude reinstall xpdf-reader
The following packages will be REINSTALLED:
  xpdf-reader
0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 46.9 kB of archives. After unpacking 0 B will be used.
Get:1 http://ftp.jp.debian.org/debian/ squeeze/main xpdf-reader all 3.02-12 [46.9 kB]
Fetched 46.9 kB in 0s (95.7 kB/s)
(Reading database ... 67789 files and directories currently installed.)
Preparing to replace xpdf-reader 3.02-12 (using .../xpdf-reader_3.02-12_all.deb) ...
Unpacking replacement xpdf-reader ...
Setting up xpdf-reader (3.02-12) ...

再インストール後に再度チェックすると、ファイルがないといわれていたメッセージが消えていることが判る。

# debsums -c
debsums: no md5sums for binutils
debsums: no md5sums for dhcp3-client
debsums: no md5sums for dhcp3-common
debsums: no md5sums for dhcp3-server
debsums: no md5sums for emacsen-common
debsums: no md5sums for g++
debsums: no md5sums for git
debsums: no md5sums for git-core
debsums: no md5sums for gnuplot
debsums: no md5sums for klogd
debsums: no md5sums for libreadline-dev
debsums: no md5sums for mawk
debsums: no md5sums for netbase
/usr/bin/pod2latex
/usr/bin/config_data
/usr/share/perl/5.10.1/constant.pm
/usr/share/perl/5.10.1/ExtUtils/Manifest.pm
/usr/share/perl/5.10.1/ExtUtils/MANIFEST.SKIP
/usr/share/perl/5.10.1/Module/Build/Compat.pm
/usr/share/perl/5.10.1/Module/Build/YAML.pm
/usr/share/perl/5.10.1/Module/Build/Notes.pm
/usr/share/perl/5.10.1/Module/Build/Base.pm
/usr/share/perl/5.10.1/Module/Build/Platform/VOS.pm
/usr/share/perl/5.10.1/Module/Build/Platform/Windows.pm
/usr/share/perl/5.10.1/Module/Build/Platform/darwin.pm
/usr/share/perl/5.10.1/Module/Build/Platform/os2.pm
/usr/share/perl/5.10.1/Module/Build/Platform/aix.pm
/usr/share/perl/5.10.1/Module/Build/Platform/RiscOS.pm
/usr/share/perl/5.10.1/Module/Build/Platform/Default.pm
/usr/share/perl/5.10.1/Module/Build/Platform/VMS.pm
/usr/share/perl/5.10.1/Module/Build/Platform/MacOS.pm
/usr/share/perl/5.10.1/Module/Build/Platform/MPEiX.pm
/usr/share/perl/5.10.1/Module/Build/Platform/EBCDIC.pm
/usr/share/perl/5.10.1/Module/Build/Platform/Unix.pm
/usr/share/perl/5.10.1/Module/Build/Platform/Amiga.pm
/usr/share/perl/5.10.1/Module/Build/Platform/cygwin.pm
/usr/share/perl/5.10.1/Module/Build/API.pod
/usr/share/perl/5.10.1/Module/Build/ModuleInfo.pm
/usr/share/perl/5.10.1/Module/Build/Dumper.pm
/usr/share/perl/5.10.1/Module/Build/PodParser.pm
/usr/share/perl/5.10.1/Module/Build/PPMMaker.pm
/usr/share/perl/5.10.1/Module/Build/Cookbook.pm
/usr/share/perl/5.10.1/Module/Build/ConfigData.pm
/usr/share/perl/5.10.1/Module/Build/Version.pm
/usr/share/perl/5.10.1/Module/Build/Config.pm
/usr/share/perl/5.10.1/Module/Build.pm
/usr/share/perl/5.10.1/Locale/Country.pm
/usr/share/perl/5.10.1/Locale/Script.pm
/usr/share/perl/5.10.1/Locale/Constants.pm
/usr/share/perl/5.10.1/Locale/Currency.pm
/usr/share/perl/5.10.1/Locale/Language.pm
/usr/share/perl/5.10.1/Locale/Constants.pod
/usr/share/perl/5.10.1/Locale/Script.pod
/usr/share/perl/5.10.1/Locale/Currency.pod
/usr/share/perl/5.10.1/Locale/Language.pod
/usr/share/perl/5.10.1/Locale/Country.pod
/usr/share/perl/5.10.1/Pod/LaTeX.pm
debsums: no md5sums for python-dev
debsums: no md5sums for sysklogd
debsums: missing file /usr/share/doc/xpdf-utils/changelog.Debian.gz (from xpdf-utils package)
debsums: missing file /usr/share/doc/xpdf-utils/changelog.gz (from xpdf-utils package)
debsums: missing file /usr/share/doc/xpdf-utils/copyright (from xpdf-utils package)

残りのパッケージも再インストール。

# aptitude reinstall xpdf-utils
The following packages will be REINSTALLED:
  xpdf-utils
0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 46.9 kB of archives. After unpacking 0 B will be used.
Get:1 http://ftp.jp.debian.org/debian/ squeeze/main xpdf-utils all 3.02-12 [46.9 kB]
Fetched 46.9 kB in 0s (156 kB/s)
(Reading database ... 67789 files and directories currently installed.)
Preparing to replace xpdf-utils 3.02-12 (using .../xpdf-utils_3.02-12_all.deb) ...
Unpacking replacement xpdf-utils ...
Setting up xpdf-utils (3.02-12) ...

壊れているファイル名からこのファイルが含まれるパッケージを検索するには、dpkg --searchを使う。ここではperl, perl-base, perl-modulesがヒットしたということになる。

# dpkg --search /usr/bin/pod2latex
perl: /usr/bin/pod2latex
# dpkg --search /usr/bin/config_data
perl: /usr/bin/config_data
# dpkg --search /usr/share/perl/5.10.1/constant.pm
perl-base: /usr/share/perl/5.10.1/constant.pm
# dpkg --search /usr/share/perl/5.10.1/ExtUtils/Manifest.pm
perl-modules: /usr/share/perl/5.10.1/ExtUtils/Manifest.pm
# dpkg --search /usr/share/perl/5.10.1/Pod/LaTeX.pm
perl-modules: /usr/share/perl/5.10.1/Pod/LaTeX.pm

ヒットしたパッケージを再インストール。

# aptitude reinstall perl perl-base perl-modules
The following packages will be REINSTALLED:
  perl perl-base perl-modules
0 packages upgraded, 0 newly installed, 3 reinstalled, 0 to remove and 0 not upgraded.
Need to get 8,237 kB of archives. After unpacking 0 B will be used.
Get:1 http://ftp.jp.debian.org/debian/ squeeze/main perl-base i386 5.10.1-17 [986 kB]
Get:2 http://ftp.jp.debian.org/debian/ squeeze/main perl i386 5.10.1-17 [3,769 kB]
Get:3 http://ftp.jp.debian.org/debian/ squeeze/main perl-modules all 5.10.1-17 [3,482 kB]
Fetched 8,237 kB in 2s (3,926 kB/s)
(Reading database ... 67789 files and directories currently installed.)
Preparing to replace perl-base 5.10.1-17 (using .../perl-base_5.10.1-17_i386.deb) ...
Unpacking replacement perl-base ...
Processing triggers for man-db ...
Setting up perl-base (5.10.1-17) ...
(Reading database ... 67789 files and directories currently installed.)
Preparing to replace perl 5.10.1-17 (using .../perl_5.10.1-17_i386.deb) ...
Unpacking replacement perl ...
Preparing to replace perl-modules 5.10.1-17 (using .../perl-modules_5.10.1-17_all.deb) ...
Unpacking replacement perl-modules ...
Processing triggers for man-db ...
Setting up perl-modules (5.10.1-17) ...
Setting up perl (5.10.1-17) ...

再度壊れているパッケージをチェック。エラーはなくなった様子。

# debsums -c
debsums: no md5sums for binutils
debsums: no md5sums for dhcp3-client
debsums: no md5sums for dhcp3-common
debsums: no md5sums for dhcp3-server
debsums: no md5sums for emacsen-common
debsums: no md5sums for g++
debsums: no md5sums for git
debsums: no md5sums for git-core
debsums: no md5sums for gnuplot
debsums: no md5sums for klogd
debsums: no md5sums for libreadline-dev
debsums: no md5sums for mawk
debsums: no md5sums for netbase
debsums: no md5sums for python-dev
debsums: no md5sums for sysklogd

debsums: no md5sums forを消したいと思うがあまり気にしないほうが良さそうだ。以下のようにしてdpkg-reconfigure debsumsしてYesを押してみたが変わらず。

# dpkg-reconfigure debsums
Package configuration
  ┌─────────────────────────┤ Configuring debsums ├──────────────────────────┐
  │                                                                          │
  │ Not all packages contain debsums information. However, apt can be        │
  │ configured to generate debsums files for installed packages              │
  │ automatically. This may be useful for checking system integrity later,   │
  │ but it should not be relied upon as a security measure.                  │
  │                                                                          │
  │ Should debsums files be generated automatically by apt-get?              │
  │                                                                          │
  │                    <Yes>                       <No>                      │
  │                                                                          │
  └──────────────────────────────────────────────────────────────────────────┘
Replacing config file /etc/apt/apt.conf.d/90debsums with new version

先のメッセージを読むと、パッケージがインストールされたタイミングでチェックサムを生成するらしいので、debsums: no md5sums forと表示されたパッケージを再インストールすればよい。

# debsums -l
binutils
dhcp3-client
dhcp3-common
dhcp3-server
emacsen-common
g++
git
git-core
gnuplot
klogd
libreadline-dev
mawk
netbase
python-dev
sysklogd
# aptitude reinstall `debsums -l`
The following packages will be REINSTALLED:
  binutils dhcp3-client dhcp3-common dhcp3-server emacsen-common g++ git git-core gnuplot klogd libreadline-dev mawk netbase python-dev sysklogd
0 packages upgraded, 0 newly installed, 15 reinstalled, 0 to remove and 0 not upgraded.
Need to get 8,974 kB of archives. After unpacking 0 B will be used.
Get:1 http://ftp.jp.debian.org/debian/ squeeze/main mawk i386 1.3.3-15 [81.4 kB]
Get:2 http://ftp.jp.debian.org/debian/ squeeze/main netbase all 4.45 [20.7 kB]
Get:3 http://ftp.jp.debian.org/debian/ squeeze/main binutils i386 2.20.1-16 [3,811 kB]
Get:4 http://ftp.jp.debian.org/debian/ squeeze/main emacsen-common all 1.4.22 [18.8 kB]
Get:5 http://ftp.jp.debian.org/debian/ squeeze/main g++ i386 4:4.4.5-1 [1,372 B]
Get:6 http://ftp.jp.debian.org/debian/ squeeze/main git i386 1:1.7.2.3-2.2 [4,857 kB]
Get:7 http://ftp.jp.debian.org/debian/ squeeze/main git-core all 1:1.7.2.3-2.2 [1,328 B]
Get:8 http://ftp.jp.debian.org/debian/ squeeze/main gnuplot all 4.4.0-1.1 [1,020 B]
Get:9 http://ftp.jp.debian.org/debian/ squeeze/main libreadline-dev i386 6.1-3 [866 B]
Get:10 http://ftp.jp.debian.org/debian/ squeeze/main python-dev all 2.6.6-3+squeeze5 [922 B]
Get:11 http://ftp.jp.debian.org/debian/ squeeze/main dhcp3-client all 4.1.1-P1-15 [25.2 kB]
Get:12 http://ftp.jp.debian.org/debian/ squeeze/main dhcp3-common all 4.1.1-P1-15 [24.8 kB]
Get:13 http://ftp.jp.debian.org/debian/ squeeze/main dhcp3-server all 4.1.1-P1-15 [25.7 kB]
Get:14 http://ftp.jp.debian.org/debian/ squeeze/main klogd i386 1.5-6 [43.1 kB]
Get:15 http://ftp.jp.debian.org/debian/ squeeze/main sysklogd i386 1.5-6 [61.8 kB]
Fetched 8,974 kB in 2s (4,379 kB/s)
(Reading database ... 67789 files and directories currently installed.)
Preparing to replace mawk 1.3.3-15 (using .../mawk_1.3.3-15_i386.deb) ...
Unpacking replacement mawk ...
Preparing to replace netbase 4.45 (using .../archives/netbase_4.45_all.deb) ...
Unpacking replacement netbase ...
Preparing to replace binutils 2.20.1-16 (using .../binutils_2.20.1-16_i386.deb) ...
Unpacking replacement binutils ...
Preparing to replace emacsen-common 1.4.22 (using .../emacsen-common_1.4.22_all.deb) ...
emacsen-common: Handling removal of emacsen flavor emacs
emacsen-common: Handling removal of emacsen flavor emacs23
emacsen-common: purging byte-compiled files for emacs23
Unpacking replacement emacsen-common ...
Preparing to replace g++ 4:4.4.5-1 (using .../g++_4%3a4.4.5-1_i386.deb) ...
Unpacking replacement g++ ...
Preparing to replace git 1:1.7.2.3-2.2 (using .../git_1%3a1.7.2.3-2.2_i386.deb) ...
Unpacking replacement git ...
Preparing to replace git-core 1:1.7.2.3-2.2 (using .../git-core_1%3a1.7.2.3-2.2_all.deb) ...
Unpacking replacement git-core ...
Preparing to replace gnuplot 4.4.0-1.1 (using .../gnuplot_4.4.0-1.1_all.deb) ...
Unpacking replacement gnuplot ...
Preparing to replace libreadline-dev 6.1-3 (using .../libreadline-dev_6.1-3_i386.deb) ...
Unpacking replacement libreadline-dev ...
Preparing to replace python-dev 2.6.6-3+squeeze5 (using .../python-dev_2.6.6-3+squeeze5_all.deb) ...
Unpacking replacement python-dev ...
Preparing to replace dhcp3-client 4.1.1-P1-15 (using .../dhcp3-client_4.1.1-P1-15_all.deb) ...
Unpacking replacement dhcp3-client ...
Preparing to replace dhcp3-common 4.1.1-P1-15 (using .../dhcp3-common_4.1.1-P1-15_all.deb) ...
Unpacking replacement dhcp3-common ...
Preparing to replace dhcp3-server 4.1.1-P1-15 (using .../dhcp3-server_4.1.1-P1-15_all.deb) ...
Unpacking replacement dhcp3-server ...
Preparing to replace klogd 1.5-6 (using .../archives/klogd_1.5-6_i386.deb) ...
Unpacking replacement klogd ...
Preparing to replace sysklogd 1.5-6 (using .../sysklogd_1.5-6_i386.deb) ...
Unpacking replacement sysklogd ...
Processing triggers for man-db ...
Setting up mawk (1.3.3-15) ...
Setting up netbase (4.45) ...
Setting up binutils (2.20.1-16) ...
Setting up emacsen-common (1.4.22) ...
emacsen-common: Handling install of emacsen flavor emacs
emacsen-common: Handling install of emacsen flavor emacs23
emacsen-common: byte-compiling for emacs23
Wrote /etc/emacs23/site-start.d/00debian-vars.elc
Wrote /usr/share/emacs23/site-lisp/debian-startup.elc
Setting up g++ (4:4.4.5-1) ...
Setting up git (1:1.7.2.3-2.2) ...
Setting up git-core (1:1.7.2.3-2.2) ...
Setting up gnuplot (4.4.0-1.1) ...
Setting up libreadline-dev (6.1-3) ...
Setting up python-dev (2.6.6-3+squeeze5) ...
Setting up dhcp3-client (4.1.1-P1-15) ...
Setting up dhcp3-common (4.1.1-P1-15) ...
Setting up dhcp3-server (4.1.1-P1-15) ...
Setting up klogd (1.5-6) ...
Stopping kernel log daemon....
Starting kernel log daemon....
Setting up sysklogd (1.5-6) ...
Stopping system log daemon....
Starting system log daemon....

最後に確認。これで一切表示されなくなった。

# debsums -c

リファレンス

  1. Debian Cleanup Tip #4: find broken packages and reinstall them | apt-get install debian-wizard
  2. [debian-users:48861] Re: /root/.bash_history cleared
  3. Debian クイックリファレンス - Debian パッケージ管理
  4. Linux - FreeStyleWiki
  5. dpkg-reconfigure debsums - Google 検索
  6. debsums 大活躍 — takaki's web
  7. Debian パッケージに含まれるファイルのチェック
  8. 20041015 - tito's wiki
  9. 2010-06-24 - karasuyamatenguの日記
  10. TH Blog
  11. 不正侵入の発見
  12. 宇宙光線がプログラムをクラッシュさせる - karasuyamatenguの日記
  13. 2009-05-09 - masakiの雑記帳

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2009-10-05T22:41:38+09:00
  2. Modified: 2009-10-05T22:41:38+09:00
  3. Generated: 2024-11-18T23:09:12+09:00