Ubuntu

Ubuntu でのリポジトリの追加手順

aptで見つからないパッケージあった場合に、リポジトリへ追加する手順のメモです。(ubuntu18.04)

Ubuntuパッケージ検索でリポジトリ情報を調べる。

http://packages.ubuntu.com/ja/

上記ページの検索窓にキーワードを入れて検索。(例はffmpeg)


[検索結果]


bionic (18.04LTS) (video): Tools for transcoding, streaming and playing of multimedia files [universe]

7:3.4.4-0ubuntu0.18.04.1 [security]: amd64 i386

7:3.4.2-2 [ports]: arm64 armhf ppc64el s390x

amd64, i386[universe] に含まれていることがわかる。

repositoryの追加

とりあえず、現在のrepository情報を確認する。

$ cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu bionic main
deb http://archive.ubuntu.com/ubuntu bionic-security main
deb http://archive.ubuntu.com/ubuntu bionic-updates main

情報が無いようなので追加する。

$ sudo apt-add-repository universe
'universe' distribution component enabled for all sources.
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Get:4 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [8,570 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/universe Translation-en [4,941 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [74.7 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-security/universe Translation-en [42.3 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [214 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [101 kB]
Fetched 13.9 MB in 15s (960 kB/s)

追加したリポジトリーの確認。

$ cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu bionic main universe
deb http://archive.ubuntu.com/ubuntu bionic-security main universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe

 

(参考情報)apt-add-repositoryの追加方法


もし、apt-add-repositoryが無い場合は次のコマンドでインストールする。

$ sudo apt apt-add-repository

 

コメントを残す