技術者になりたい何か

技術者になりたい何かの覚書的な何かです

パッケージ管理しりーず aptのリポジトリ (Debian系)

リポジトリの設定(apt用)

Debian系のリポジトリの設定ファイルは/etc/apt/sources.list

 

デフォルト

$ sudo cat /etc/apt/sources.list

# セキュリティ更新
deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

## Debian アーカイブミラー

# ベースリポジトリ
deb http://ftp.debian.org/debian jessie main contrib non-free
deb-src http://ftp.debian.org/debian jessie main contrib non-free

# 安定版更新
deb http://ftp.debian.org/debian jessie-updates main contrib non-free
deb-src http://ftp.debian.org/debian jessie-updates main contrib non-free

# 安定版バックポート
deb http://ftp.debian.org/debian jessie-backports main contrib non-free
deb-src http://ftp.debian.org/debian jessie-backports main contrib non-free

 

設定変更は

ここ(/etc/apt/sources.list)に追記することでリポジトリ追加、記述削除することでリポジトリ削除。
ちなみに先頭の#がアンコメントになるので、無効にしたいリポジトリの行をアンコメントして無効にすることも可能。

$ sudo apt-get update

で接続エラーが出るようなリポジトリが混じってる時は一旦アンコメントするのも良いだろう。

なお、上記ファイルを書き換えたのちは、キャッシュ更新の為必ず

$ sudo apt-get update
$ sudo apt-get upgrade

してから目的のパッケージを入れた方が良い。

 

追記するときはこんな感じ。

$ sudo emacs /etc/apt/sources.list

# セキュリティ更新
deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

## Debian アーカイブミラー

# ベースリポジトリ
deb http://ftp.debian.org/debian jessie main contrib non-free
deb-src http://ftp.debian.org/debian jessie main contrib non-free

# 安定版更新
deb http://ftp.debian.org/debian jessie-updates main contrib non-free
deb-src http://ftp.debian.org/debian jessie-updates main contrib non-free

# 安定版バックポート
deb http://ftp.debian.org/debian jessie-backports main contrib non-free
deb-src http://ftp.debian.org/debian jessie-backports main contrib non-free

#Deb-Multimedia Reposito
deb http://www.deb-multimedia.org wheezy main non-free
deb-src http://www.deb-multimedia.org wheezy main non-free

 

最後の

#Deb-Multimedia Reposito
deb http://www.deb-multimedia.org wheezy main non-free
deb-src http://www.deb-multimedia.org wheezy main non-free 

 

を追記。

この上で

$ sudo apt-get update
Ign http://ftp.jp.debian.org jessie InRelease
~~中略~~
Get:18 http://security.debian.org jessie/updates/contrib Translation-en [1,211 B]
Get:19 http://security.debian.org jessie/updates/main Translation-en [198 kB]
Hit http://ftp.jp.debian.org jessie/contrib Translation-en
Hit http://ftp.jp.debian.org jessie/main Translation-en
Hit http://ftp.jp.debian.org jessie/main Translation-ja
Hit http://ftp.jp.debian.org jessie/non-free Translation-en
Get:20 http://security.debian.org jessie/updates/non-free Translation-en [14 B]
Ign http://nginx.org jessie/nginx Translation-en_US
Ign http://nginx.org jessie/nginx Translation-en
Ign http://nginx.org jessie/nginx Translation-ja
Get:21 http://www.deb-multimedia.org wheezy InRelease [41.2 kB] ←ここから下
Ign http://www.deb-multimedia.org wheezy InRelease
Get:22 http://www.deb-multimedia.org wheezy/main Sources [47.2 kB]
Get:23 http://www.deb-multimedia.org wheezy/non-free Sources [2,932 B]
Get:24 http://www.deb-multimedia.org wheezy/main amd64 Packages [79.5 kB]
Get:25 http://www.deb-multimedia.org wheezy/non-free amd64 Packages [2,153 B]
Get:26 http://www.deb-multimedia.org wheezy/main Translation-en [39.2 kB]
Get:27 http://www.deb-multimedia.org wheezy/non-free Translation-en [2,933 B]
Ign http://www.deb-multimedia.org wheezy/main Translation-en_US
Ign http://www.deb-multimedia.org wheezy/main Translation-ja
Ign http://www.deb-multimedia.org wheezy/non-free Translation-en_US
Ign http://www.deb-multimedia.org wheezy/non-free Translation-ja
Fetched 1,207 kB in 17s (68.3 kB/s)
Reading package lists... Done

上記リポジトリの情報を読み込んでいるのが見られるはず。

また、読み込みが遅い時にはより速いミラーサイトに書き換えるなども試すことが可能。
パッケージダウンロードに利用するミラーサイトについて

要するにこの/etc/apt/sources.listがCentOSにおける/etc/yum.repos.d/epel.repoのようなものと思っておけば良い。

ちなみに/etc/apt/apt.confをはじめ、/etc/apt配下にいろいろ設定ファイルがあったりなかったりするが、
よほどのことが無い限り触ることは無いような。。。

 

Sponsored Link