2

I am trying to update rPi B+'s ArchLinux with sudo pacman -Syyu and I get following error:

[user@comp001 ~]# pacman -Syyu
:: Synchronizing package databases...
error: failed retrieving file 'core.db' from mirror.archlinuxarm.org : Could not resolve host: mirror.archlinuxarm.org
error: failed to update core (download library error)
error: failed retrieving file 'extra.db' from mirror.archlinuxarm.org : Could not resolve host: mirror.archlinuxarm.org
error: failed to update extra (download library error)
error: failed retrieving file 'community.db' from mirror.archlinuxarm.org : Could not resolve host: mirror.archlinuxarm.org
error: failed to update community (download library error)
error: failed retrieving file 'alarm.db' from mirror.archlinuxarm.org : Could not resolve host: mirror.archlinuxarm.org
error: failed to update alarm (download library error)
error: failed retrieving file 'aur.db' from mirror.archlinuxarm.org : Could not resolve host: mirror.archlinuxarm.org
error: failed to update aur (download library error)
error: failed to synchronize any databases
error: failed to init transaction (download library error)
[user@comp001 ~]#

I can access to web from PC, router settings are ok (rPi is running dhcp client and it gets from router permanent ip), I can ping ip addresses:

[user@comp001 ~]# ping -Uv 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=53 time=29.6 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=53 time=29.4 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=53 time=28.5 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=53 time=29.2 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=53 time=29.9 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=53 time=29.0 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=53 time=27.8 ms
^C
--- 8.8.8.8 ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6008ms
rtt min/avg/max/mdev = 27.843/29.109/29.979/0.683 ms
[user@comp001 ~]#

but I cannot ping web address:

[root@octopustest ~]# ping google.com
ping: unknown host google.com
[root@octopustest ~]#

I have another rPi B+ (same model and both are running archlinux, first with kernel Linux rpiOK 3.18.5-1-ARCH #1 PREEMPT Fri Jan 30 19:56:39 MST 2015 armv6l GNU/Linux and the second one, problematic, with kernel Linux rpiUPDATEPROBLEM 3.18.3-1-ARCH #1 PREEMPT Fri Jan 23 22:10:31 MST 2015 armv6l GNU/Linux), with same setup in relation with router (permanent ip address) and I can run pacman -Syyu without problems. But I've found a difference between resolv.conf configurations:

First rPi, with new hostname rpiOK has following resolv.conf setup:

[user@rpiOK etc]$ ls -asl resolv*
0 lrwxrwxrwx 1 root root  32 Jan  1  1970 resolv.conf -> /run/systemd/resolve/resolv.conf
4 -rw-r--r-- 1 root root 254 Sep 22 23:08 resolvconf.conf
[user@rpiOK etc]$

Second rPi, with new hostname rpiUPDATEPROBLEM, has following resolv.conf setup:

[user@rpiUPDATEPROBLEM etc]# ls -asl resolv*
4 -rwxrwxrwx 1 root root  26 Jan 25  2015 resolv.conf
4 -rw-r--r-- 1 root root 254 Jan 24  2015 resolvconf.conf
[root@rpiUPDATEPROBLEM etc]#

Does the problem lie here (I can ping same web address, google.com from PC without problems)?

2
  • 1
    How is your Pi connected to the net (through the PC)? Can you ping anything (like the local router) from the Pi? What does the PC have to do with anything? Feb 4, 2015 at 19:05
  • @SteveRobillard, from PC everything works fine. Router setup is ok, I can ping server 192.168.0.101 inside LAN from rPi, so rPi has valid IP. Feb 4, 2015 at 19:31

3 Answers 3

4

It looks like a DNS resolution problem; this is the process by which domain names such as "mirror.archlinuxarm.org" or "google.com" get turned into IP addresses, which they must be in order for the system to contact the external server. For that purpose, the system first contacts a DNS resolver; generally your ISP provides this and the system gets their addresses from the router during DHCP lease negotiation.

If this gets messed up, you can specify them explicitly yourself. 8.8.8.8 is actually not the address for google.com, it's for Google's own public DNS resolver. You can make use of that by adding to the top of /etc/resolv.conf:

nameserver 8.8.8.8
nameserver 8.8.4.4

After you save the file web look-ups should work normally.

2
  • 2
    Service systemd-resolved was down (do not know why), I've enabled it via sudo systemctl enable systemd-resolved, restarted it via sudo systemctl restart systemd-resolved, turned OFF router and switcher, then turned them both ON, and then I've managed to update archlinux via sudo pacman -Syyu without problems. Feb 4, 2015 at 20:10
  • Thanks! In my case I had two IPv6 DNS servers in /etc/resolv.conf but no IPv6 connectivity. The system showed the same symptoms. Removing them and leaving only the two Google DNS servers in the file solved the issue.
    – pklaus
    Apr 30, 2015 at 8:58
3

If the problem is not solved by simply changing DNS nameservers, then you might want to try disabling IPv6. This issue isn't specific to the raspberry pi, as it seems to affect other platforms/systems running ArchLinux:

Google Search for ArchLinux, Pacman, IPv6

In order to disable IPv6 on the RaspberryPi2, edit the cmdline.txt file in the boot directory and append ipv6.disable=1.

According to the ArchWiki page regarding IPv6:

Warning: Disabling the IPv6 stack can break certain programs which expect it to be enabled. FS#46297

Alternatively, adding ipv6.disable_ipv6=1 instead will keep the IPv6 stack functional but will not assign IPv6 addresses to any of your network devices.

2

If @goldilocks' solution does not work, which it did not for me, you can always do a DNS lookup on the failing hostnames and use your /etc/hosts file to map the IP addresses to the hostnames.

I had to go back and forth from pinging the failed mirror host names on another machine to test and get the IP addresses, mapping them on my arch server's hosts file, and running pacman -Syyu until it stopped spitting this error.

I hope this helps anyone get through the same hurdles I hit.

2
  • 1
    It is better to fix DNS resolution.
    – RalfFriedl
    Aug 18, 2019 at 0:13
  • I agree, but that wasn't working for me. I could ping the repos by host name from my DNS server, but not my arch machine - even though other host names could be pinged from my arch. This was just a necessary workaround to get it to upgrade.
    – JayRugMan
    Aug 22, 2019 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.