1

So I installed linuxdeploy on my phone to mess around with a debian linux. Installed debian 9 for arm64 and so far so good.

Only when I run any "sudo" command, I'm getting the following warning:

sudo: unable to resolve host localhost: no such file or directory

(I still get the root access though)

I've been looking on the web but did not find anyone with his exact error message.

I checked the following files:

/etc/hosts, it contains 1 line:

127.0.0.1 localhost

/etc/hostname, it contains 1 line:

localhost

Edit: as per asked in the comments below, I tried to run the command:

grep hosts /etc/nsswitch.conf

resulting in:

no such file or directory

A quick look at /etc folder indeed shows that this file is missing

Marc
  • 145
  • 1
  • 6
  • 2
    Please add the result of `grep hosts /etc/nsswitch.conf` to your question. First (or near first) element of the list should probably be `files`. – roaima Oct 30 '18 at 15:12
  • Thank you for your anwser, unfortunately it looks like this file does not exist as I receive the following message: "no such file or directory", looking at /etc confirmed this file is missing – Marc Oct 30 '18 at 15:52

1 Answers1

2

So thanks to roaima's comment I managed to understand I was missing the nsswitch.conf file from /etc folder.

Though I didn't understand why the file was missing, with the help of google I rebuilt the file as follows:

passwd: compat
group: compat
shadow: compat

hosts: files dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis

Then rebooted the system and my issue is now gone.

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
Marc
  • 145
  • 1
  • 6
  • 2
    Pleased it's sorted. When you can - which I think will be tomorrow - please accept your own answer (tick mark next to the vote buttons) so we can all see that this question was answered successfully. – roaima Oct 30 '18 at 17:18
  • Of course, it seems the minimum delay is 2 days, so I'll come by tomorrow ! Thanks again. – Marc Oct 31 '18 at 08:05