LoginSignup
43
48

More than 5 years have passed since last update.

Ubuntu14.04でapt-get updateできなかった時の対処法

Last updated at Posted at 2016-01-27

環境

マシン:自宅サーバー
OS:UbuntuServer 14.04.3

 エラー発生

とりあえず一通りの設定をして、「さて、apt-get updateするか」と思ったら、まさかのエラー。

$ sudo apt-get update
エラー http://jp.archive.ubuntu.com trusty InRelease

エラー http://security.ubuntu.com trusty-security InRelease

エラー http://jp.archive.ubuntu.com trusty-updates InRelease

エラー http://jp.archive.ubuntu.com trusty-backports InRelease

エラー http://security.ubuntu.com trusty-security Release.gpg
  'security.ubuntu.com' が一時的に解決できません
エラー http://jp.archive.ubuntu.com trusty Release.gpg
  'jp.archive.ubuntu.com' が一時的に解決できません
エラー http://jp.archive.ubuntu.com trusty-updates Release.gpg
  'jp.archive.ubuntu.com' が一時的に解決できません
エラー http://jp.archive.ubuntu.com trusty-backports Release.gpg
  'jp.archive.ubuntu.com' が一時的に解決できません
パッケージリストを読み込んでいます... 完了
...

解決方法

どうやらDNSの設定が上手いこといってないらしい。
/etc/resolvconf/resolv.conf.d/baseにDNSの設定を書き込んだらOK。

(ネット上には/etc/resolv.confに書けみたいな情報が落ちていたりするが、古い情報なので惑わされないようにしたい)

$ sudo vi /etc/resolvconf/resolv.conf.d/base
nameserver 8.8.8.8

保存後
$ sudo reboot
して
$ sudo apt-get update
したら、無事に実行することができた。

43
48
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
43
48