38

When I log into my Ubuntu terminal tty1, I get a message

failed to connect to http://changelogs.ubuntu.com/meta-release

I try various things, then I get an error message telling me

could not resolve us.archive.ubuntu.com

If I ping us.archive.ubuntu.com -c 4:

ping: archive.ubuntu.com: name  or service not known

And the same message for sudo apt-get update.

I did not set any proxy; I left it blank during install.

My internet connectivity is apparently disabled and I could not configure it.

I tried rebooting but nothing changed.

Zanna
  • 70,465
habib
  • 389
  • FWIW, I got this message on changing broadband provider (and hence DNS servers). – A Browne Aug 10 '20 at 08:31
  • Please rephrase to make it a question, and also make it clear if you are trying to allow the message of the day to include changelogs, or are you trying to disable this feature. Please show research effort. – null Sep 02 '20 at 14:33

3 Answers3

52

I had this same problem with 17.10, but I'm betting the same applies to other recent versions as well.

Those MOTD messages are generated by scripts in /etc/update-motd.d. The exact script that generates that specific line is /etc/update-motd.d/91-release-upgrade, which also runs /usr/lib/ubuntu-release-upgrader/release-upgrade-motd. This last script will check for new releases and write output into /var/lib/ubuntu-release-upgrader/release-upgrade-available.

The script will only update the file every 24 hours. So if you wait long enough, the file will go stale and the script will update the file anyway. But, if you want to update it immediately, just remove /var/lib/ubuntu-release-upgrader/release-upgrade-available and run /etc/update-motd.d/91-release-upgrade and it should start working correctly.

I created this problem because when I first setup my 17.10 server, I had a typo in my DNS server address.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
  • 10
    Because I can't comment on the answer of @anthony-cascianelli (reputation < 50) I'm posting an answer instead. After removing /var/lib/ubuntu-release-upgrader/release-upgrade-available, run /usr/lib/ubuntu-release-upgrader/release-upgrade-motd instead of /etc/update-motd.d/91-release-upgrade. This is what worked for me. – eiro Jan 24 '18 at 07:03
  • 5
    In my case, simply removing /var/lib/ubuntu-release-upgrader/release-upgrade-available was enough.

    Next time you login, it will see there's no cache and run the check script automatically.

    – Dave S Sep 29 '18 at 11:16
  • Oh my god. Thank you, man. There was lots of other suggestions around the internet for this error. The were talking about support for https proxies and whatnot - which seemed strange to me. Your answer was exact on the spot: I also had a DNS problem the first boot, which then evidently literally tainted this file "forever" (i.e. for 24 hours). – stolsvik Nov 18 '18 at 13:24
  • 1
    I got the same problem on Ubuntu Server 18.04. The error message is the same except it has -lts at the end. In my case there appears to have been no configuration error. The error message showed up after the system has been running for weeks without any problems. So apparently the error message can show up spontaneously. Too bad this question is closed as a duplicate, since your answer clearly shows that the bad output can persist even if none of the problems mentioned in the supposed duplicate are present. – kasperd Feb 24 '19 at 20:35
  • 1
    Since this is still a topic of discussion (and I just had to research this too) : The original report is about a bug that has been fixed: https://askubuntu.com/a/1154537/793416 – TonyG Jun 28 '19 at 01:41
  • ditto. upvoted the answers with the solutions that worked for systems that have no network problems at all. – pdwalker Nov 11 '19 at 05:43
  • This still happens in 18.04, and not due to the certificate bug that pdwalker mentions, so the (unaccepted) answer is still very relevant. In the case of my 18.04 install, the MOTD is simply incorrect for whatever reason. Removing the release-upgrade-available file and re-logging in resolves it. @Zanna could you accept, or provide a comment? Johnny's answer below is identical, more direct. – Scott Prive May 24 '20 at 14:22
  • @DaveS Thank you. This worked like a charm. – Prashanth Muthurajaiah Jun 23 '21 at 06:26
12

The failed to connect status is possibly coming from a static text file. Here's how to regenerate said file in Ubuntu 18.04:

$ sudo rm /var/lib/ubuntu-release-upgrader/release-upgrade-available
$ sudo /usr/lib/ubuntu-release-upgrader/release-upgrade-motd

(This comes from a mix of Anthony Cascianelli's answer plus eiro's comment, compiled into a concise answer and thus easier for my team to read and execute.)

3

If you have a proxy like apt-cacher configured make sure changelogs.ubuntu.com is listed in the allowed locations in /etc/apt-cacher/apt-cacher.conf.

allowed_locations = archive.ubuntu.com,changelogs.ubuntu.com
allowed_ssl_locations = archive.ubuntu.com,changelogs.ubuntu.com