apt-get

提供: セキュリティ
移動: 案内検索
スポンサーリンク

apt-get (Advanced Packaging Tool)とは、Debian用のパッケージ管理システムです。

読み方

apt-get
あぷとげっと

概要

apt-getは、DebianやUbuntuで使用されています。 apt-getのフロントエンドとして、aptitudeがあります。

使い方

インストールやダウンロード

パッケージのインストール

apt-get install パッケージ名

ソースコードのダウンロード

apt-get source パッケージ名

ソースパッケージをコンパイルするために必要なパッケージのインストール

apt-get build-dep パッケージ名

更新

リポジトリの更新

apt-get update

インストール済のパッケージの更新

apt-get upgrade

ディストリビューションの更新

apt-get dist-upgrade

検索

パッケージの検索

apt-cache search 検索キーワード

パッケージ情報の表示

apt-cache show パッケージ名

削除

パッケージの削除

apt get remove パッケージ名

パッケージの設定ファイルを含めた削除

apt-get purge パッケージ名

不要なパッケージの自動削除

依存されてないライブラリなどを削除します。

apt-get autoremove

インストールされたファイルを調べる

dpkgコマンドを使用します。

dpkg -L tmux

実行例です。

$ dpkg -L tmux
/.
/usr
/usr/bin
/usr/bin/tmux
/usr/share
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/tmux.1.gz
/usr/share/doc
/usr/share/doc/tmux
/usr/share/doc/tmux/NEWS.Debian.gz
/usr/share/doc/tmux/NOTES
/usr/share/doc/tmux/examples
/usr/share/doc/tmux/examples/n-marriott.conf
/usr/share/doc/tmux/examples/t-williams.conf
/usr/share/doc/tmux/examples/vim-keys.conf
/usr/share/doc/tmux/examples/h-boetes.conf
/usr/share/doc/tmux/examples/tmux_backup.sh
/usr/share/doc/tmux/examples/bash_completion_tmux.sh
/usr/share/doc/tmux/examples/screen-keys.conf
/usr/share/doc/tmux/examples/tmux.vim.gz
/usr/share/doc/tmux/copyright
/usr/share/doc/tmux/TODO.gz
/usr/share/doc/tmux/FAQ.gz
/usr/share/doc/tmux/changelog.Debian.gz

アップデートできないとき

ログインするとアップデート可能なパッケージがあると表示されます。

Welcome to Ubuntu 12.04.3 LTS (GNU/Linux 3.2.0-24-generic-pae i686)
 
 * Documentation:  https://help.ubuntu.com/
 
30 packages can be updated.
18 updates are security updates.
 
Last login: Sun Dec  8 00:55:43 2013 from master00.local

アップデートできる、といいつつ、apt-getでupdate/upgradeを実行すると「以下のパッケージは保留されます」とメッセージが表示されて、アップデートできないときがあります。

user@u1:~$ sudo apt-get update
user@u1:~$ sudo apt-get upgrade
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下のパッケージは保留されます:
  ginn hplip hplip-data libgrip0 libhpmud0 libsane-hpaio libunity-2d-private0
  libunity-core-5.0-5 linux-generic-pae linux-headers-generic-pae
  linux-image-generic-pae printer-driver-hpcups printer-driver-hpijs unity
  unity-2d-common unity-2d-panel unity-2d-shell unity-2d-spread unity-common
  unity-services update-notifier update-notifier-common
アップグレード: 0 個、新規インストール: 0 個、削除: 0 個、保留: 22 個。
user@u1:~$ sudo apt-get dist-upgrade
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
アップグレードパッケージを検出しています ... 完了
以下のパッケージが新たにインストールされます:
  libframe6 libgeis1 libgrail5 linux-headers-3.2.0-57
  linux-headers-3.2.0-57-generic-pae linux-image-3.2.0-57-generic-pae patch
  printer-driver-postscript-hp
以下のパッケージはアップグレードされます:
  ginn hplip hplip-data libgrip0 libhpmud0 libsane-hpaio libunity-2d-private0
  libunity-core-5.0-5 linux-generic-pae linux-headers-generic-pae
  linux-image-generic-pae printer-driver-hpcups printer-driver-hpijs unity
  unity-2d-common unity-2d-panel unity-2d-shell unity-2d-spread unity-common
  unity-services update-notifier update-notifier-common
アップグレード: 22 個、新規インストール: 8 個、削除: 0 個、保留: 0 個。
62.6 MB のアーカイブを取得する必要があります。
この操作後に追加で 183 MB のディスク容量が消費されます。
続行しますか [Y/n]? y

関連項目




スポンサーリンク