Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question is based on Popey's answer. I mounted my broken Ubuntu such that I can access it by Ubuntu Live CD. However, I did not manage to run one of the commands such that my X11 gets stuck at the startup.

How can you solve the following "resolve" problem?

root@ubuntu:/# sudo dpkg --configure -a
sudo: unable to resolve host ubuntu
share|improve this question

migrated from Nov 24 '09 at 13:38

This question came from our site for professional and enthusiast programmers.

Not related to programming. Should be moved to superuser or serverfault. – intgr Nov 24 '09 at 13:22
Indeed :/ Sorry for my answer ^^ – Toms Nov 24 '09 at 13:24
SuperUser, I think - it has little to do with servers. – paxdiablo Nov 24 '09 at 13:24
Don't apologize for the answer, @Toms. It'll still be there if this gets nudged to one of the other sites, and it is helpful. – paxdiablo Nov 24 '09 at 13:25
up vote 1 down vote accepted

Make sure your /etc/hosts file contains something like the following. The line should not contain anything other than "localhost".       localhost       ubuntu

or       localhost
x.x.x.x         ubuntu

(... where "x.x.x.x" is your system's IP address, and "ubuntu" is your system's hostname.)

share|improve this answer
don't do this! for ubuntu, leave the line alone (should list "localhost" only). use ubuntu if you need it, or any other number in 127.x.x.x. – quack quixote Nov 24 '09 at 19:07
corrected the example & clarified. – quack quixote Dec 28 '09 at 22:09

Isn't this stored in /etc/hostname?

Update: you might be able to change it--but then again this might require root.

share|improve this answer
How would you use the knowledge of the hostname in solving the problem? – Masi Dec 20 '09 at 20:37

This is a false issue. You don't need to use sudo once you have chrooted, because you're already root.

Just use

dpkg --configure -a

without sudo, and you'll be fine.

share|improve this answer
What about if I don't want to be root? That's my particular issue, I want to run a chrooted command with another user than root. – Eduard Luca Nov 16 '13 at 23:49
Use schroot for example. – ℝaphink Nov 19 '13 at 10:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.