Been a while since I fired up my Nethunter tablet, its such a great form factor, small and portable. It has not been used in anger yet, but I do like to keep all my devices updated. Especially with the latest versions of exploit-db fresh from the Kali repo’s 🙂
Unfortunately that task failed.
Issue: Apt fails to resolve http.kali.org, error below.
root@kali:~# apt-get update Err:1 http://http.kali.org/kali kali-rolling InRelease Temporary failure resolving 'http.kali.org' Reading package lists... Done W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease Temporary failure resolving 'http.kali.org' W: Some index files failed to download. They have been ignored, or old ones used instead.
The standard checks of /etc/resolv.conf to see if I was missing any DNS servers. Then the /etc/hosts file also in case anything weird was stopping the resolver from trying DNS. All looked normal.
Other things such as dig and apps such as Firefox were behaving normally. This meant it was not a networking issue or a real resolver issue system wise. It was unique to apt.
A web search provided the following check and fix.
grep 'apt' /etc/passwd| _apt:x:114:65534::/nonexistent:/bin/false
Update the ‘_apt’ UID to 0
_apt:x:0:65534::/nonexistent:/bin/false /etc/passwd format: username:password:UID:GID:user info:Home dir:command shell
Related Bug: apt-get errors
Explanation (sort of): seems like the user _apt had issues using the resolver, update the UID and things worked fine. No real explanation in the bug report other than it was fixed in later releases.
Note: The permission on /etc/resolv.conf were set to -rw—— but updating these so users could read the file did not fix this. So the original fix above still stands.
Hope this helps someone.