====== package manager =====
===== apt-get =====
* パッケージを検索\\
apt-cache search <検索キーワード>
* パッケージインストール\\
apt-get install <パッケージ名>
* パッケージを削除(/etc 以下の設定ファイルは残す)\\
apt-get remove <パッケージ名>
* パッケージを削除(/etc 以下の設定ファイルも削除)\\
apt-get --purge remove <パッケージ名>
* パッケージリストの更新\\
apt-get update
* インストール済みパッケージの更新\\
apt-get upgrade
* 更新するパッケージを一覧表\\
apt-get -s upgrade\\
(-s:simulation)
* パッケージの依存関係を表示\\
apt-cache showpkg <パッケージ名>
* 整合性をチェック\\
apt-get check
* ローカルに置いたパッケージファイルからインストール
- mkdir /usr/src/deb
- apt-ftparchive packages . | gzip -c9 > Packages.gz
- apt-ftparchive sources . | gzip -c9 > Sources.gz
- vi /etc/apt/sources.list\\
以下の行を追加
deb file:/usr/src/deb/ ./
- apt-get update
- apt-get install <パッケージ名>\\
(パッケージ名 != ファイル名, 例:tcpdump)
* バージョン番号を指定してパッケージをインストール\\
apt-get install <パッケージ名>=<バージョン番号>\\
(例) apt-get install tcpdump=3.9.4-2ubuntu0.2
===== dpkg =====
* インストール済みパッケージ一覧\\
dpkg -l
または
dpkg -l <パッケージ名>
* インストール済みパッケージをワイルドカード検索の例\\
dpkg -l "*<パッケージ名>*"
* インストール済みパッケージの削除(/etc 以下の設定ファイルは残す)\\
dpkg -r <パッケージ名>
* インストール済みパッケージの削除(/etc 以下の設定ファイルも削除)\\
dpkg --purge <パッケージ名>
* ディススク上のファイルが含まれるパッケージを検索\\
dpkg -S <パッケージ名>
* パッケージに含まれるファイル一覧を表示\\
dpkg -L <パッケージ名>