綾小路龍之介の素人思考

[debian] deborphanで挙げられたパッケージをaptitude自動削除

自動削除することの可否はおいて置いて、こういうことできますよということ。

以下のようにして削除する。deborphanでリストアップされるパッケージは単独でインストールされたライブラリなどが多い気がする。

# deborphan --guess-all | sort | xargs --max-args 1 aptitude why | grep "^Unable" | sed -e "s/^Unable to find a reason to install \(.*\)\.$/\1/" | xargs aptitude -y purge
The following packages will be REMOVED:
  libbit-vector-perl{u} libcarp-clan-perl{u} libdata-random-perl{u} libdate-calc-perl{u} libdatetime-format-strptime-perl{p} libfile-modified-perl{u}
  libgd-gd2-perl{u} libhook-lexwrap-perl{u} libhtml-display-perl{u} libhtml-tableextract-perl{u} libhtml-tokeparser-simple-perl{u}
  libio-compress-base-perl{p} libio-compress-zlib-perl{p} liblocale-maketext-lexicon-perl{p} libmail-pop3client-perl{p} libmime-perl{p} libparent-perl{u}
  libterm-shell-perl{u} libtest-exception-perl{p} libtest-www-selenium-perl{p} libunicode-japanese-perl{p} libwww-mechanize-formfiller-perl{u}
  libwww-mechanize-shell-perl{p} libxml-filter-buffertext-perl{u} libxml-sax-writer-perl{p}
0 packages upgraded, 0 newly installed, 25 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 5,800 kB will be freed.
(Reading database ... 71010 files and directories currently installed.)
Removing libwww-mechanize-shell-perl ...
Processing triggers for man-db ...
(Reading database ... 71000 files and directories currently installed.)
Removing libwww-mechanize-formfiller-perl ...
Removing libdata-random-perl ...
Removing libdate-calc-perl ...
Removing libbit-vector-perl ...
Removing libcarp-clan-perl ...
Processing triggers for man-db ...
(Reading database ... 70875 files and directories currently installed.)
Removing libdatetime-format-strptime-perl ...
Processing triggers for man-db ...
(Reading database ... 70869 files and directories currently installed.)
Removing libfile-modified-perl ...
Removing libgd-gd2-perl ...
Removing libhook-lexwrap-perl ...
Removing libhtml-display-perl ...
Removing libhtml-tableextract-perl ...
Removing libhtml-tokeparser-simple-perl ...
Processing triggers for man-db ...
(Reading database ... 70738 files and directories currently installed.)
Removing libio-compress-base-perl ...
Removing libio-compress-zlib-perl ...
Removing liblocale-maketext-lexicon-perl ...
Removing libmail-pop3client-perl ...
Removing libmime-perl ...
Processing triggers for man-db ...
(Reading database ... 70674 files and directories currently installed.)
Removing libparent-perl ...
Removing libterm-shell-perl ...
Processing triggers for man-db ...
(Reading database ... 70657 files and directories currently installed.)
Removing libtest-exception-perl ...
Removing libtest-www-selenium-perl ...
Removing libunicode-japanese-perl ...
Removing libxml-sax-writer-perl ...
Processing triggers for man-db ...
(Reading database ... 70607 files and directories currently installed.)
Removing libxml-filter-buffertext-perl ...
Processing triggers for man-db ...

パッケージを削除したことでさらに削除できるパッケージが増える事もあるので、再度同じコマンドを実行

# deborphan --guess-all | sort | xargs --max-args 1 aptitude why | grep "^Unable" | sed -e "s/^Unable to find a reason to install \(.*\)\.$/\1/" | xargs aptitude -y purge
The following packages will be REMOVED:
  libhttp-server-simple-perl{u} libsub-uplevel-perl{p} libwww-mechanize-perl{p}
0 packages upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 500 kB will be freed.
(Reading database ... 70600 files and directories currently installed.)
Removing libwww-mechanize-perl ...
Processing triggers for man-db ...
(Reading database ... 70580 files and directories currently installed.)
Removing libhttp-server-simple-perl ...
Processing triggers for man-db ...
(Reading database ... 70565 files and directories currently installed.)
Removing libsub-uplevel-perl ...
Processing triggers for man-db ...

リファレンス

  1. Man page of FIND
  2. Man page of XARGS
  3. Man page of SED

ソーシャルブックマーク

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

ChangeLog

  1. Posted: 2010-03-03T07:26:09+09:00
  2. Modified: 2010-03-03T07:26:09+09:00
  3. Generated: 2017-04-11T23:09:18+09:00