apt-get
(Advanced packaging tool - get) はdebパッケージを管理するLinuxコマンドである。パッケージのダウンロードからインストールまで一括で行うことができる。
Debian 並びにその派生ディストリビューションである Ubuntu 及び Linux Mint で apt-get コマンドを使用できる。
debは、DebianやUbuntuで採用されているパッケージ管理システムである。debパッケージファイルの拡張子は.rpmである。
apt-get [option] [command] [package]
apt-get
コマンドには次に示すオプションを指定できる。
-d
--download-only
apt-get
のサブコマンドを以下に示す。
apt-get update
はパッケージリストを更新するコマンドである。
パッケージリストが古いと、パッケージのインストール失敗することがある。
$ sudo apt install gcc
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
そのようなときは、パッケージリストを更新するとインストールできるようになる。
$ sudo apt-get update
apt-get
コマンドに関するファイルには次のものがある。
Advanced Packaging Tool (APT)とは、Debian用に開発されたパッケージ管理システムである。
リポジトリの設定は、/etc/apt/sources.listファイルに記載されている。
deb file:///home/horiuchi/installer/packages ./
apt-get コマンドの設計上のミスを克服したものが apt コマンドである。
apt-get コマンドは Debian 系の Linux で使用できる。
系統 | OS | 対応 |
---|---|---|
Debian | Debian | ✓ |
elementary OS | ✓ | |
Linux Mint | ✓ | |
MX Linux | ✓ | |
Ubuntu | ✓ | |
Zorin OS | ✓ | |
Red Hat | CentOS Stream | ✗ |
Fedora | ✗ | |
Red Hat Enterprise Linux | ✗ | |
Slackware | Salix OS | ✗ |
Slackware | ✗ | |
その他Linux | Arch Linux | ✗ |
Gentoo Linux | ✗ | |
openSUSE | ✗ | |
Manjaro | ✗ | |
UNIX | FreeBSD | ✗ |
macOS | ✗ |
Software in the Public Interest (2023) 6.2. aptitude、apt-get、apt コマンド Debian 管理者ハンドブック