done is better than perfect

自分が学んだことや、作成したプログラムの記事を書きます。

Change apt source (Ubuntu 14.04)

If sudo apt-get update command failed like this:

W: Failed to fetch http://jp.archive.ubuntu.com/ubuntu/dists/trusty/InRelease--

W: Failed to fetch http://jp.archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease--

W: Failed to fetch http://jp.archive.ubuntu.com/ubuntu/dists/trusty-backports/InRelease--

W: Failed to fetch http://jp.archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg  Unable to connect to jp.archive.ubuntu.com:http:

W: Failed to fetch http://jp.archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg  Unable to connect to jp.archive.ubuntu.com:http:

W: Failed to fetch http://jp.archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg  Unable to connect to jp.archive.ubuntu.com:http:

W: Some index files failed to download. They have been ignored, or old ones used instead.

You should change apt source!

If you live in Japan region, change from //jp.archive.ubuntu/com from //ftp.jaist.ac.jp

Input this command

sudo sed -i".bak" -e 's/\/\/jp.archive.ubuntu.com/\/\/ftp.jaist.ac.jp/g'  /etc/apt/sources.list

You can now update and upgrade faster than before!