Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

    
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

3 Answers 3

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

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

 
discard

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.