1

I get following error whenever i do something like:

sudo apt-get install sddm
sudo: unable to resolve host dhcppc1

It happened when i upgrade from 14.04 to 16.04.


/etc/hosts

127.0.0.1       localhost.localdomain localhost
127.0.1.1       mlibre-ThinkPad-E555
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Update

I have another problem. whenever i reboot system, this problem happen again.

/etc/hostname

localhost

2 Answers 2

2

Your computer's name (hostname) is set to dhcppc1, but dhcppc1 is not in /etc/hosts and it cannot be resolved by DNS. The way your /etc/hosts looks your computer's name should be mlibre-ThinkPad-E555. You must resolve this mismatch.

5
  • fixed by: sudo hostname localhost. i have another problem. question updated. Commented Nov 28, 2016 at 15:18
  • 1
    Well you did set your hostname to localhost. So naturally /etc/hostname contains localhost. Commented Nov 28, 2016 at 15:22
  • yeh. but seems, something change hostname in startup. Commented Nov 28, 2016 at 15:23
  • It seems that your DHCP server is setting a hostname. Look at a similar case. Commented Nov 28, 2016 at 15:28
  • Yeh. tnx. fixed by changing: sudo nano /etc/dhcp/dhclient.conf. remove host-name form request line. Commented Nov 28, 2016 at 15:45
0

First of all try rebooting your system. If the problem persists then try these-

Sol-1 Go to system-settings-> system-details. And there in the overview panel, rename your device to the same device name as mentioned in the /etc/hosts.

This method will change the device name in the etc/hostname without asking you for the admin password.

Sol-2 Type the following in the terminal

sudo gedit ~/etc/hosts

(Although the error will appear here but the terminal will accept your password). There modify the device name to the same name as in etc/hostname file.

This should resolve the mismatch in the hosts and hostname file.

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.