Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 stackoverflow.com Nov 24 '09 at 13:38

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

    
Indeed :/ Sorry for my answer ^^ – Toms 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 127.0.0.1 line should not contain anything other than "localhost".

127.0.0.1       localhost
127.0.1.1       ubuntu

or

127.0.0.1       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
2  
don't do this! for ubuntu, leave the 127.0.0.1 line alone (should list "localhost" only). use 127.0.0.2 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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .