You are not logged in.
On my desktop machine, `checkupdates` requires sudo to provide relevant results.
$ checkupdates | wc -l
returns nothing, takes a second to finish
$ sudo checkupdates | wc -l
returns 7, takes a while to check as expected
I was wondering why my statusbar using this script kept saying I have 0 updates when my laptop using the same script had updates.
I googled and found that someone also had the same issue but fixed his by restarting. It's been several days since and restarting and updating did not fix the issue. Someone also recommended that I
rm -rf /tmp/checkup-db-*
but again, that did not fix the issue.
Last edited by mindstormer (2017-03-07 02:19:54)
Offline
What is the output of
ls -al /usr/bin/checkupdates
?
Offline
-rwxr-xr-x 1 root root May 18 2016 /usr/bin/checkupdates
Hmm... that's not the default permissions/ownership? I didn't do anything to it--should I
chown $USER:$USER /usr/bin/checkupdates
?
Last edited by mindstormer (2017-02-21 04:33:54)
Offline
Those permissions look normal. For the most part, everything in /usr/bin should be owned by root.
Offline
Someone also suggested I use strace to maybe see what files it is trying to open and failing but I don't know if that's helpful and I have no idea how to interpret the really long output.
Offline
What are the permissions on the db in /tmp?
Offline
Just as a sanity check, try
pacman -Qkk pacman
and make sure it doesn't report anything unusual.
Offline
@jasonwryan
The two databases are 755, owned by $USER:$USER and root:root for checkup-db-$USER and check-up-db-root respectively.
@circleface
`pacman -Qkk pacman` outputs the following:
backup file: pacman: /etc/pacman.conf (Modification time mismatch)
backup file: pacman: /etc/pacman.conf (Size mismatch)
pacman: 349 total files, 0 altered files
Offline
Do you have fakeroot installed?
Offline
Yes, I have fakeroot installed via base-devel group.
Offline
@ayekat No, it does not.
Offline
strace checkupdates 2>&1 | tee checkupdates.strace
paste checkupdates.strace somewhere so one can inspect it for errors or unexpected behavior
Offline
I'm having a very similar (possibly the same) problem, except in my case, checkupdates without sudo simply hangs. (See here.) I decided to manually do what checkupdates does to see what the issue is, and this is as far as I got:
% mkdir -p /tmp/checkup-db-brian ~
% ln -s /var/lib/pacman/local /tmp/checkup-db-brian ~
% fakeroot -- pacman -Sy --dbpath /tmp/checkup-db-brian --logfile /tmp/checkup-db-brian/log ~
:: Synchronizing package databases...
error: failed retrieving file 'core.db' from ftp.uni-hannover.de : Resolving timed out after 10519 milliseconds
error: failed retrieving file 'core.db' from repo.itmettke.de : Resolving timed out after 10521 milliseconds
error: failed retrieving file 'core.db' from mirror.selfnet.de : Resolving timed out after 10520 milliseconds
error: failed retrieving file 'core.db' from archlinux.nullpointer.io : Resolving timed out after 10521 milliseconds
error: failed retrieving file 'core.db' from ftp.halifax.rwth-aachen.de : Resolving timed out after 10520 milliseconds
error: failed retrieving file 'core.db' from archlinux.honkgong.info : Resolving timed out after 10521 milliseconds
error: failed retrieving file 'core.db' from mirrors.prometeus.net : Resolving timed out after 10520 milliseconds
error: failed retrieving file 'core.db' from archlinux.mailtunnel.eu : Resolving timed out after 10521 milliseconds
^C
Interrupt signal received
Compare with:
% sudo pacman -Sy --dbpath /tmp/checkup-db-brian --logfile /tmp/checkup-db-brian/log ~
[sudo] password for brian:
:: Synchronizing package databases...
core 123.9 KiB 264K/s 00:00 [--------------------------------------------------------] 100%
extra 1676.3 KiB 187K/s 00:09 [--------------------------------------------------------] 100%
community 3.8 MiB 466K/s 00:08 [--------------------------------------------------------] 100%
So, for some reason with fakeroot I get a timeout for every single mirror in my mirrorlist.
NB: OP said that their checkupdates "takes a second to finish", whereas in my case it hangs. The difference could be that OP has just one or just a couple mirrors in mirrorlist, whereas I have 20 (obtained with "reflector -n 20 ...").
Offline
fakeroot -- ping www.google.com
Offline
Seems to work, aside from the error about libfakeroot.so, which I'm not sure how to interpret:
% ping -c3 www.google.com ~
PING www.google.com (216.58.204.4) 56(84) bytes of data.
64 bytes from lhr35s07-in-f4.1e100.net (216.58.204.4): icmp_seq=1 ttl=54 time=193 ms
64 bytes from lhr35s07-in-f4.1e100.net (216.58.204.4): icmp_seq=2 ttl=54 time=101 ms
64 bytes from lhr35s07-in-f4.1e100.net (216.58.204.4): icmp_seq=3 ttl=54 time=99.4 ms
--- www.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 99.479/131.475/193.934/44.170 ms
%
% fakeroot -- ping -c3 www.google.com ~
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
PING www.google.com (216.58.204.4) 56(84) bytes of data.
64 bytes from lhr35s07-in-f4.1e100.net (216.58.204.4): icmp_seq=1 ttl=54 time=1815 ms
64 bytes from lhr35s07-in-f4.1e100.net (216.58.204.4): icmp_seq=2 ttl=54 time=795 ms
64 bytes from lhr35s07-in-f4.1e100.net (216.58.204.4): icmp_seq=3 ttl=54 time=104 ms
--- www.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2019ms
rtt min/avg/max/mdev = 104.213/905.134/1815.287/702.801 ms, pipe 2
Offline
ok?
fakeroot -- dig ftp.uni-hannover.de
fakeroot -- curl -v 'http://ftp.uni-hannover.de/archlinux/core/os/x86_64/core.db' > /dev/null
Offline
OK, now we're getting somewhere: "fake -- dig" works both with and without "sudo", but "fakeroot -- curl" fails (i.e. hangs) without "sudo", as does "fakeroot -- wget". Huh.
Last edited by brianb (2017-03-05 17:55:23)
Offline
Someone else appears to have had this exact same problem 2 years ago: [SOLVED] Fakeroot can't resolve a host. DNS issue ? (curl/wget). There's a solution at the very bottom, which says to "place 'dns' in /etc/nssswitch.conf on line 9", but I already have 'dns' there:
# Begin /etc/nsswitch.conf
passwd: compat mymachines systemd
group: compat mymachines systemd
shadow: compat
publickey: files
hosts: files mymachines resolve [!UNAVAIL=return] dns myhostname
networks: files
protocols: files
services: files
ethers: files
rpc: files
netgroup: files
# End /etc/nsswitch.conf
Offline
nslookup ftp.uni-hannover.de
fakeroot -- nslookup ftp.uni-hannover.de
Since the latter is likely gonna fail:
strace nslookup ftp.uni-hannover.de 2>&1 | tee nslookup.strace.good
fakeroot -- strace nslookup ftp.uni-hannover.de 2>&1 | tee nslookup.strace.bad
Offline
Solved! I figured it out: I needed to enable "systemd-resolved.service". Following the wiki entry for systemd-networkd, I did:
# rm /etc/resolv.conf
# systemctl enable systemd-resolved.service
# ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
# systemctl restart systemd-resolved.service
Everything works fine now!
(I recently installed Arch a new laptop, and during the setup process, I must've enabled "systemd-networkd" without also enabling "systemd-resolved". Somehow, I managed to go a month without noticing any issue, except for the fact that my xmobar status bar would freeze every hour, because it was trying to run "checkupdates". Lo and behold...)
I hope this solution works for OP, too.
Offline
I had systemd-networkd and system-resolved services already enabled, but
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
seems to fix it for me. I'm not sure how... Thanks.
Offline