apt updateに失敗するようになったときの対応

昨日まではapt update ができてたけど、突然できなくなったりしました。

`/etc/apt/sources.list` を変更してリポジトリサーバの向き先を変える。

`sudo vim /etc/apt/sources.list`
VimのコマンドCLIで以下を実行
`:%s;http://az01.clouds.archive.ubuntu.com/ubuntu/; http://ftp.riken.go.jp/Linux/ubuntu/;g`
↑公式から理化学研究所に変更

＜日本国内のダウンロードサイト＞
http://www.ubuntulinux.jp/ubuntu/mirrors


変更前　`/etc/apt/sources.list`

```
deb http://az01.clouds.archive.ubuntu.com/ubuntu/ xenial main restricted
deb-src http://az01.clouds.archive.ubuntu.com/ubuntu/ xenial main restricted

deb http://az01.clouds.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb-src http://az01.clouds.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

deb http://az01.clouds.archive.ubuntu.com/ubuntu/ xenial universe
deb-src http://az01.clouds.archive.ubuntu.com/ubuntu/ xenial universe
deb http://az01.clouds.archive.ubuntu.com/ubuntu/ xenial-updates universe
deb-src http://az01.clouds.archive.ubuntu.com/ubuntu/ xenial-updates universe

deb http://az01.clouds.archive.ubuntu.com/ubuntu/ xenial multiverse
deb-src http://az01.clouds.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://az01.clouds.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
deb-src http://az01.clouds.archive.ubuntu.com/ubuntu/ xenial-updates multiverse

deb http://az01.clouds.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://az01.clouds.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse


```

変更後　`/etc/apt/sources.list`

```
deb http://ftp.riken.go.jp/Linux/ubuntu/ xenial main restricted
deb-src http://ftp.riken.go.jp/Linux/ubuntu/ xenial main restricted

deb http://ftp.riken.go.jp/Linux/ubuntu/ xenial-updates main restricted
deb-src http://ftp.riken.go.jp/Linux/ubuntu/ xenial-updates main restricted

deb http://ftp.riken.go.jp/Linux/ubuntu/ xenial universe
deb-src http://ftp.riken.go.jp/Linux/ubuntu/ xenial universe
deb http://ftp.riken.go.jp/Linux/ubuntu/ xenial-updates universe
deb-src http://ftp.riken.go.jp/Linux/ubuntu/ xenial-updates universe

deb http://ftp.riken.go.jp/Linux/ubuntu/ xenial multiverse
deb-src http://ftp.riken.go.jp/Linux/ubuntu/ xenial multiverse
deb http://ftp.riken.go.jp/Linux/ubuntu/ xenial-updates multiverse
deb-src http://ftp.riken.go.jp/Linux/ubuntu/ xenial-updates multiverse

deb http://ftp.riken.go.jp/Linux/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://ftp.riken.go.jp/Linux/ubuntu/ xenial-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

```