0

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
2
  • Indeed :/ Sorry for my answer ^^
    – Toms
    Nov 24, 2009 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, 2009 at 13:25

2 Answers 2

1

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.)

2
  • 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. Nov 24, 2009 at 19:07
  • corrected the example & clarified. Dec 28, 2009 at 22:09
0

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.

2
  • 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. Nov 16, 2013 at 23:49
  • Use schroot for example.
    – raphink
    Nov 19, 2013 at 10:01

You must log in to answer this question.

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