Joe Wein’s blog

Comments from Yokohama, Japan

Update Manager hangs in Ubuntu 8.04 (and how to fix it)

May 17th, 2008 · 32 Comments

Last month I upgraded my notebook from Ubuntu 7.10 to 8.04 (“Hardy Heron”). Since then, whenever I tried tried to install the up to 133 updates that had become available, the Update Manager would hang indefinitely instead of prompting me for the user password.

If you’re in the same situation, the following tips might help you. Edit /etc/hosts with an editor of your choice (e.g. sudo vi /etc/hosts). There should be two entries with IPv4 addresses starting with 127.0.x.x, like this:

127.0.0.1 localhost
127.0.1.1 mycomputername.mydomain

Remove the domain name from the entry starting with 127.0.1.1, leaving only the computer name and save the file. Now try again.

When I made this change I got the password prompt as expected and all the updates where downloaded and applied.

Tags: Computers · Linux · software

32 responses so far ↓

  • 1 Bangstick // May 28, 2008 at 04:39

    Thank you….thank you. You just saved me for an OS install, as I could not find a solution for this.

    Your /etc/hosts edit worked a treat.

  • 2 spoon_1212 // May 28, 2008 at 05:12

    Thanks, this worked like a charm. I was having problems trying to get all of the updates to work in terminal. I managed to get about 50 them installed but 6 of them would not install for some reason. Anyway, this fixed the hang up and I’m downloading them now.

  • 3 Daniel Hegarty // May 28, 2008 at 18:31

    Spot on! being a Linux novice I had no idea what this SUDO business was all about. so after two hours of trawling the internet I figured it out. in Terminal you have to type:-

    gksudo gedit etc/hosts

    And then put in the admin password and you will be able to edit the file. Pritty lame of me I know, but just encase anyone else has the same issues.

  • 4 Sven Siegmund // May 28, 2008 at 20:53

    Didn’t work for me:
    sudo vi /etc/hosts returned
    Could not resolve host kazimir.
    I had to boot Knoppix mount the Ubuntu partition, and edit Ubuntu’s /etc/hosts on the the mounted partition. In ubuntu I could not write to the hosts file. chmod 644 hosts did not work as I was not permitted. sudo chmod 644 hosts on ubuntu could not resolve host /-: But with Knoppix or any other live CD I could fix that.

  • 5 Franklin // May 30, 2008 at 21:55

    Thanks Joe,

    Don’t know why but it did the trick.

  • 6 JD // May 31, 2008 at 02:03

    Thanks for this tip!
    Not only did this cure the Update Manager problem, it also solved a problem with many of the admin tasks not asking for a password and not running.

  • 7 Lollipop // May 31, 2008 at 02:35

    Thank you soooooo much! Works magic :) ))

  • 8 musashi // Jun 1, 2008 at 07:43

    yep worked for me too. Many thanks!

  • 9 Allard // Jun 4, 2008 at 16:24

    Thanks for the tip.

  • 10 shards // Jun 5, 2008 at 23:07

    Didn’t work
    I used the command u posted;in the Terminal i edited the document.Now how do I save the changes?

  • 11 phlebas // Jun 6, 2008 at 23:25

    @4– is it possible that

    $ sudo vi /etc/hosts

    actually gave the output:

    Could not resolve host kazimir.Password:

    I noticed the same thing (‘cept using emacs), but sudo was still running somehow and took my password.

  • 12 Simon Scullion » Update Manager hangs in Ubuntu 8.04 (and how to fix it) // Jun 10, 2008 at 07:26

    [...] I did, and a quick search on google lead me to this post on Joe Wein’s blog with a clear explanation on how to solve the issue: Last month I upgraded my [...]

  • 13 Rt Bitchalot // Jun 10, 2008 at 11:09

    Thank you so much for this fix. Worked like a charm on my Dell C600 Latitude laptop.

  • 14 adam d. // Jun 14, 2008 at 01:35

    it works, but with the consequence that anything looking for localhost no longer works. one tends to take ‘localhost’ for granted, so that can be any number of scripts and servers that may be lying around.

  • 15 adam d. // Jun 14, 2008 at 01:40

    this is the underlying problem

    https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/234879

  • 16 adam d. // Jun 14, 2008 at 01:46

    and wouldn’t you know the actual bug fix (of gksu) is only days away.

    https://bugs.launchpad.net/ubuntu/+source/gksu/+bug/91151

  • 17 Jason // Jun 23, 2008 at 04:28

    This worked me as well. Thanks!

  • 18 Rupen // Jul 21, 2008 at 18:36

    Thanks, that really helped..

  • 19 Adrian // Jul 26, 2008 at 10:15

    Just FYI – another workaround is to run update-manager as root.

    But your solution is more elegant, IMHO

  • 20 Phil // Aug 12, 2008 at 00:48

    If you have an issue with this resolution:

    First, check to see your network setup is correct. In may case, the hostname really needs to be defined correctly in the /etc/hosts file. You don’t have to removed the localhost line, but your assigned IP needs to be correctly defined.

    See this example:
    127.0.0.1 localhost
    10.250.1.25 mycomputer.mydomain

    Now, using a terminal window, I did an su to the root user, then you have the needed permissions to change the file. You cannot edit/save the /etc/hosts file from a standard user account – it is setup to disallow that type of thing for a reason.

    The last step, it may not be necessary, but I exited from the terminal session. Closed all open apps, and rebooted. I did this step because I don’t want to be surprised later. I have a single user setup, so it’s no big deal in my case. However, if you have a multi-user setup or server, schedule that reboot as soon as you can.

    Once, back up I was able to finally get through an update without hanging.

    Thanks for the helpful post.

  • 21 scottyb // Aug 29, 2008 at 12:35

    beautiful!

    new to ubuntu and forgot that to put “g” in front of “edit” lol.

    no more terminal updating for me! aka screw aptitude!

    thanks for this post!!!

  • 22 HCI3 // Sep 8, 2008 at 05:46

    That did it. Thanks for the post.

  • 23 globalcommunication // Oct 26, 2008 at 02:30

    I tried the gksudo gedit etc/hosts approach but the hosts file is empty. I tried to revert but the file has been deleted. I’ve hardly used this machine since installing (couldn’t get web access until last night) so I don’t think it can be anything I’ve done. Any ideas?

  • 24 JoeUser // Nov 12, 2008 at 15:09

    Thank you for the fix. I too am pretty new to Linux in general. Like Globalcommunication my etc/host file was blank in gedit from terminal. I had to do the frowned upon sudo nautilus and navigate to the file. Then I could see the contents in gedit.

  • 25 connectionfailure // Dec 8, 2008 at 23:35

    Actually I checked /etc/hosts but it was blank. In Apps->System->Network in the General tab I had some dumb name in the “Host name” field.
    After deleting it, and doing a sudo killall update-manager to knock off the hung software, when I relaunched update manager it worked properly again. Hurray for internetz! Hurray for Joe!

  • 26 Update Manager et al hanging | keyongtech // Jan 19, 2009 at 01:35

    [...] Re: Update Manager et al hanging On Tue, 10 Jun 2008 18:09:12 +0100, Mark wrote: > Hardy Heron… > > The Update Manager gets its lists, sometimes asks for password, and just > hangs until a quit is forced. Synaptic is given up on after about 10 > seconds, and Add/Remove Applications produces the lists, but won’t add > or remove anything. Are they all related? Yes > More importantly, is there a cure? Might want to try the following: http://www.joewein.net/blog/2008/05/…how-to-fix-it/ [...]

  • 27 yurixx // Jan 23, 2009 at 13:07

    Great! how on earth did you figure out how to do that? Worked like a charm.

  • 28 arunkumara // Jan 29, 2009 at 17:50

    Yeah.. it works for me also… Thank u very much………..!

    Have fun..

  • 29 newbie // Mar 5, 2009 at 09:04

    Thanks for the post. Being new to Ubuntu, I was stopped a while by the gksudo/sudo stuff in a terminal: it would not work for the same reason “unresolved host”.
    I recommend to use the tool selected through menus system->administration->network.
    Password is gently asked for, and the 127.0.1.1 entry can resolve nicely to the host name you type in.

    Thanks again.

  • 30 -Pete- // Sep 14, 2009 at 20:59

    Thank man, (:-)-|-<
    I'd preferred qedit at root console to /etc/hosts file.

    -Pete-

  • 31 Lipis // Sep 26, 2009 at 23:07

    nice.. computer name was wrong there.. So i just changed that and it worked :) without removing the address.. :)

    thanx..

  • 32 Alan Weeks // Dec 7, 2009 at 10:24

    Thanks! I had no idea what was causing problem.
    Your comment fixed it.

    Alan Weeks

Leave a Comment