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

2
  • 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. Commented Oct 30, 2018 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 Commented Oct 30, 2018 at 15:52

1 Answer 1

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.

2
  • 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. Commented Oct 30, 2018 at 17:18
  • Of course, it seems the minimum delay is 2 days, so I'll come by tomorrow ! Thanks again. Commented Oct 31, 2018 at 8:05

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.