[LHR]: package を管理する (APT)

<Home> → <LHR> → <[LHR]: package を管理する (APT)>

はじめに

APT (Advanced Package Tool) は、Debian で使用されているパッケージ管理の一つです。

APT は dpkg や rpm を使用したパッケージ管理ソフトウェアのフロントエンドとして動作します。特に Network を通じたパッケージバージョン管理に優れたソフトウェアです。

現在では Debian は元より、Vine Linux でも公式に採用されています。非公式ではありますが Red Hat でも APT によるパッケージ管理を行っているサイトがあります。私は up2date の代わりとして使用しており、大変重宝しています。


基本的な使い方

apt-get update → apt-get upgrade でシステムの package を常に最新に置き換えることが出来ます。Windows Update のノリに近いかも。

リポジトリ情報を更新します (apt-get update)

# apt-get update

Install されている package を最新に置き換えます (apt-get upgrade)

# apt-get upgrade

使用例1

<dpkg> と同じく GNU Time を Install する例を挙げます。

package を Install します (apt-get install)

Install する前に確認しておきたい場合には -s(--simulate, --no-act) パラメータを追加します。

# apt-get install time
Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
time
0 packages upgraded, 1 newly installed, 0 to remove and 137 not upgraded.
Need to get 0B/30.4kB of archives. After unpacking 135kB will be used.
未選択パッケージ time を選択しています。
(データベースを読み込んでいます... 現在 96491 個のファイルとディレクトリがインストールされています。)
(.../archives/time_1.7-16_i386.deb から) time を展開しています...
time (1.7-16) を設定しています ...

package の詳細情報を表示します (apt-cache show)

# apt-cache show time
Package: time
Priority: standard
Section: utils
Installed-Size: 132
Maintainer: Dirk Eddelbuettel <edd@debian.org>
Architecture: i386
Version: 1.7-16
Depends: libc6 (>= 2.3.1-1)
Filename: pool/main/t/time/time_1.7-16_i386.deb
Size: 30374
MD5sum: b937701f85796f392e1e68993a0563f6
Description: The GNU time command.
(以下略)

package を Uninstall します (apt-get remove)

設定ファイルまで完全に削除する場合には --purge パラメータを追加します。

# apt-get remove time
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be REMOVED:
time
0 packages upgraded, 0 newly installed, 1 to remove and 137 not upgraded.
Need to get 0B of archives. After unpacking 135kB will be freed.
Do you want to continue? [Y/n]
(データベースを読み込んでいます... 現在 96499 個のファイルとディレクトリがインストールされています。)
time を削除しています...
Document `time' is not installed, cannot remove.

使用例2

リポジトリ内の情報から検索します (apt-cache search)

Download 出来る package 内の情報からキーワード検索します。例では「Bluetooth」に係わる情報を検索しています。

#結構、ありますね。

# apt-cache search bluetooth
flexmem - File Transfer to Flex.Memory on Siemens GSM Mobiles
affix-common - Common files of the Affix Bluetooth protocol stack for Linux.
affix-headers - Header files of the Affix Bluetooth protocol stack for Linux.
affix-source - Driver source for the Affix Bluetooth protocol stack for Linux.
bluez-hcidump - Analyses Bluetooth HCI packets
libbluetooth1 - Library to use the BlueZ Linux Bluetooth stack
libbluetooth1-dev - Development files for using the BlueZ Linux Bluetooth library
obexftp - File Transfer to Flex.Memory on Siemens GSM Mobiles
obexserver - Receive files with OBEX protocol
affix - User space utilities for the Affix Bluetooth protocol stack
bluez-pan - Personal area networking for Bluetooth devices
bluez-pcmcia-support - PCMCIA support files for BlueZ 2.0 Bluetooth tools
bluez-pin - Bluetooth PIN helper with D-BUS support
bluez-sdp - BlueZ Bluetooth SDP daemon and tool
bluez-utils - Utilities for controlling Bluetooth devices
libaffix-dev - Development files for the Affix Bluetooth protocol stack
libaffix2 - Libraries for the Affix Bluetooth protocol stack
libmultisync-plugin-irmc - IrMc Mobile plugin for MultiSync
libmultisync-plugin-irmc-bluetooth - Adds Bluetooth support to the IrMC plugin
libopietooth1-fb - Opie bluetooth library
libsdp2 - BlueZ Bluetooth SDP library
libsdp2-dev - Development files for BlueZ Bluetooth SDP library
multisync - A program to synchronize PIM data
op-bluepin-fb - Bluetooth pin application
op-bluetoothapplet-fb - Bluetooth Applet for Opie
op-bluetoothmanager-fb - Bluetooth Manager application

Proxy を越える場合の設定

環境変数 http_proxy、ftp_proxy を設定します。

例ではユーザー名「user」、パスワード「pass」、proxy サイト「192.168.1.10」、port number「8080」としてます。

#export http_proxy="http://user:pass@192.168.1.10:8080/"
#export ftp_proxy="http://user:pass@192.168.1.10:8080/"

Resource

お勧め

使用例

参考情報


<Home> → <LHR> → <[LHR]: package を管理する (APT)>
Copyright (c) 2003 Makoto NARA(Mc.N), All rights reserved.
<Terms of Use>

Valid CSS! Valid HTML 4.01!