Could not resolve 'localhost'

Asked by Ivan

When I run Synaptic Package Manager I get a error Could not resolve 'localhost'

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Ralph Janke
Solved:
Last query:
Last reply:
Revision history for this message
Pramod Dematagoda (pmdematagoda) said :
#1

Please post the outputs of:-
cat /etc/hosts

and

cat /etc/hostname

Revision history for this message
Ivan (wired1141) said :
#2

Output of cat /etc/hosts is # The following lines are desirable for IPv6 capable hosts
Output of cat /etc/hostname is me-desktop

Revision history for this message
Best Ralph Janke (txwikinger) said :
#3

The file "/etc/hosts" should have the following entry:

127.0.0.1 localhost

Please open a terminal, and execute

sudo nano /etc/hosts

and include the line above at the beginning of the file. Save it, and your problem should be solved.

Hope this helps.

Revision history for this message
Ivan (wired1141) said :
#4

Thanks Ralph Janke, that solved my question.