wiki:TipAndDoc/Linux/Packages

Version 15 (modified by mitty, 11 years ago) (diff)

--

Dynamic MMap ran out of room.

  • sudo aptitude update
    E: Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. Current value: 25165824. (man 5 apt.conf)
    E: Error occurred while processing samba-tools (NewVersion1)
    E: Problem with MergeList /var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_maverick-security_universe_binary-amd64_Packages
    W: Unable to munmap
    E: The package lists or status file could not be parsed or opened.
    

apt-get vs. aptitude

  • 以下、http://web.archive.org/web/20080612112414/http://foamy-capriccio.seesaa.net/article/47608276.html より抜粋して転載
    • 結論から言うと、「Ubuntuで使うなら今はapt-getに統一しておいた方がいいよ」ということらしいです。実際、非公式なUbuntuGuideのGeneral Notesのところでも
      All references to "aptitude" will be replaced with "apt-get". You may still use "aptitude" if you wish, however could cause dependency issues.
      
    • 以下、apt-getとaptitudeの違いをつらつらと。
      1. ログファイル
        • apt-getは特にログファイルを持っていません。そのかわり後ろで動くdpkgコマンドが /var/log/dpkg.log というログファイルを持っているようです。この中にはインストール・アンインストールしたパッケージの一覧が載っています。
        • aptitudeでもdpkgが後ろで動いていますが、dpkg.logとは別に /var/log/aptitude というファイルを管理しています。もし一度もaptitudeコマンドを使ったことがないのなら、ファイル自体が存在しません。
      2. インストール時
        • 主な違いは「推奨(recommends)パッケージ」の扱いです。apt-getは推奨パッケージを表示するだけに留めますが、aptitudeは推奨パッケージもインストールしようとします(たぶん提案(suggests)パッケージはインストールしません。推奨と提案の違いはこのエントリの質疑応答が参考になります)。
      3. アンインストール時
        • 主な違いは必要のなくなったパッケージ(孤児(orphan)パッケージと呼ばれるらしい)の扱いです。apt-getもaptitudeもあるパッケージをインストールしたとき、必要なパッケージも自動的にインストールしてくれますが、インストールしたパッケージを削除したとき、apt-getはそのパッケージだけを、aptitudeは(/var/log/aptitudeのログを元に)不要になったパッケージも削除します。
        • この不要パッケージに対する扱いの違いのために、aptitudeの愛用者が多かったようです。現在ではapt-get autoremoveコマンドでaptitude同様のことを独自のログファイルを作成することなく実現できます。
      • 実例
        • 仮想的なpackageXパッケージをapt-get、aptitudeの双方でインストールしたときの違いを見ていきましょう。まず、packageXに対する依存関係は以下のようになっているとします。
          • 依存:packageXdep
          • 推奨:packageXrec
          • 提案:packageXsug
        1. ケース1:aptitudeを使ってインストールし、aptitudeを使ってアンインストールする。
          • aptitude install packageX:packageXとpackageXdepとpackageXrecがインストールされる。
          • aptitude remove packageX:packageXとpackageXdepとpackageXrecがアンインストールされる。
          • 一緒にインストールされたパッケージはaptitudeのデータベースに基づいて全てアンインストールされる。
          • aptitudeのデータベースの整合性は維持される。
        2. ケース2:apt-getを使ってインストールし、apt-getを使ってアンインストールする。
          • apt-get install packageX:packageXとpackageXdepがインストールされる。
          • apt-get remove packageX:packageXのみがアンインストールされる。
          • 依存関係によってインストールされたパッケージは残ったままになる。
          • aptitudeのデータベースには触れないので整合性は維持される。
        3. ケース3:apt-getを使ってインストールし、apt-get --autoremoveを使ってアンインストールする。
          • apt-get install packageX:packageXとpackageXdepがインストールされる。
          • apt-get --autoremove remove packageX:packageXとpacageXdepがアンインストールされる。
          • 一緒にインストールされたパッケージは全てアンインストールされる。
          • aptitudeのデータベースには触れないので整合性は維持される。
        4. ケース4:apt-getを使ってインストールし、aptitudeを使ってアンインストールする。
          • apt-get install packageX:packageXとpackageXdepがインストールされる。
          • aptitude remove packageX:packageXがアンインストールされる。
          • packageXdepはaptitudeのデータベースに登録されていないので、アンインストールされない。
          • aptitudeのデータベースにおいてpackageXdepはインストールされていないことになっている。
        5. ケース5:aptitudeを使ってインストールし、apt-get --autoremoveを使ってアンインストールする。
          • aptitude install packageX:packageXとpackageXdepとpackageXrecがインストールされる。
          • apt-get --autoremove remove packageX:packageXとpackageXdepがアンインストールされる(packageXrecはどうなるか不明)。
          • packageXdepはaptitudeのデータベースに関係なくアンインストールされる。
          • aptitudeのデータベースにおいて、packageXdepはインストールされたままの状態になっている。
    • 追記(2007/12/17)
      • 案外、このエントリにやってくる人が多いようなので、いくつか修正・追記しておきました。とりあえず、ここに書いてあることは、非公式の情報を元に推論したものであり、事実と違う可能性があるので注意してください。実際、apt-getに統一した方がいいと書きましたが、DebianのMLやDebian GNU/Linux スレッドテンプレを見ると、積極的にaptitudeが使われています。これはDebianでは、SynapticのようなGUIは利用せずに端末上からインストールする方が多いために、aptitudeで統一した方がいろいろとログが残るし、特にオプションを指定しなくても「推奨」パッケージがインストールされるし、aptitudeにはCUI用のインターフェースも用意されているしと利点が多いからだと思われます。
    • この記事へのコメント
      1. こんばんは。aptitude のメンテナをやっているものなのでちょっと気になった点についてコメントです。「aptitudeは(/var/log/aptitudeのログを元に)不要になったパッケージも削除します」は嘘ですよ。/var/lib/apt/extended_states というデータベースがあり、依存関係で引き込まれて自動的にインストールされたか否かに関する情報がそこに含まれています。ログなんて飾りですよ。何ヶ月かすれば logrotate に消されてしまうものなので。;-) - Posted by noritada at 2008年01月10日 03:22
      2. aptitudeのメンテナさん直々に指摘していただけるなんて光栄です。ちゃんと確認もせずにふわふわな状態で嘘を書いてしまってすみません……。aptitude も(/var/lib/aptitude/pkgstatesだけでなく)/var/lib/apt/extended_statesを読み込んでくれるんですね。てことは、この二つを混用することによる問題って何が原因で起こるのでしょう。というか、問題自体も解決済みなのかな。やっぱちゃんと確認してからって話になっちゃいますね……。 - Posted by しぐま at 2008年01月11日 21:27

Preference control file for APT

  • APT_PREFERENCES(5)
    • Determination of Package Version and Distribution Properties

    the Archive: or Suite: line

    names the archive to which all the packages in the directory tree belong. For example, the line "Archive: stable" or "Suite: stable" specifies that all of the packages in the directory tree below the parent of the Release file are in a stable archive. Specifying this value in the APT preferences file would require the line:

    Pin: release a=stable

    the Codename: line

    names the codename to which all the packages in the directory tree belong. For example, the line "Codename: squeeze" specifies that all of the packages in the directory tree below the parent of the Release file belong to a version named squeeze. Specifying this value in the APT preferences file would require the line:

    Pin: release n=squeeze

    the Version: line

    names the release version. For example, the packages in the tree might belong to Debian GNU/Linux release version 3.0. Note that there is normally no version number for the testing and unstable distributions because they have not been released yet. Specifying this in the APT preferences file would require one of the following lines.

    Pin: release v=3.0 Pin: release a=stable, v=3.0 Pin: release 3.0

    the Component: line

    names the licensing component associated with the packages in the directory tree of the Release file. For example, the line "Component: main" specifies that all the packages in the directory tree are from the main component, which entails that they are licensed under terms listed in the Debian Free Software Guidelines. Specifying this component in the APT preferences file would require the line:

    Pin: release c=main

    the Origin: line

    names the originator of the packages in the directory tree of the Release file. Most commonly, this is Debian. Specifying this origin in the APT preferences file would require the line:

    Pin: release o=Debian

    the Label: line

    names the label of the packages in the directory tree of the Release file. Most commonly, this is Debian. Specifying this label in the APT preferences file would require the line:

    Pin: release l=Debian

package lists data are corrupt ?

  • aptitude update中に電源が落ちるなどして、不整合が起きた模様
  • $ sudo aptitude update
    W: GPG error: http://ftp.jp.debian.org squeeze-backports Release: The following signatures were invalid: NODATA 2
    W: GPG error: http://security.debian.org squeeze/updates Release: The following signatures were invalid: NODATA 2
    
    W: GPG error: http://ftp.jp.debian.org squeeze-backports Release: The following signatures were invalid: BADSIG AED4B06F473041FA Debian Archive Automatic Signing Key (6.0/squeeze) <ftpmaster@debian.org>
    W: GPG error: http://security.debian.org squeeze/updates Release: The following signatures were invalid: BADSIG AED4B06F473041FA Debian Archive Automatic Signing Key (6.0/squeeze) <ftpmaster@debian.org>
    
  • $ sudo rm -r /var/lib/apt/lists/*