Computer Janitor wiped out most of my packages

Bug #345939 reported by Huygens
4
Affects Status Importance Assigned to Milestone
computer-janitor (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: computer-janitor

Context:
I am trying Ubuntu Jaunty within a virtual machine. I'm updating it regularly, but I did not recently cleaned it up.
Therefore yesterday evening after the installation of a new kernel, I decided to remove the 2 older ones, and why not give it a go with Computer Janitor.

Steps taken:
1. Launched Computer Janitor;
2. After a while, it showed 2 older kernel that could be removed and a package that was called something like 'readline' (with something before or after);
3. I said ok, removed those packages.

What happened next:
1. It took quite a while and during the process, strangely things started to bug, like the Network Manager applet which crashed and cut me off internet, then firefox was gone, etc.
2. once it was done, I went to the 'System' menu to see with Synaptics what had happen, I was really surprise to see the menu almost empty, and all the others too. There was still Synaptic but it was telling me that gksu was not installed on my system and thus could not be launched.

My conclusions:
1. it seems that Computer Janitor removed much more than just the few packages that was listed (from memory only 3 packages where displayed, the 2 older kernel et this readline-cmd or something approaching)

What I was expecting:
1. Computer Janitor showed just a few packages that it will remove, it should just remove those, no more. Or warn the user before.
2. I was not expecting to crash my system! ;-)

Furthermore, I have tried to install the ubuntu-desktop package again, but I obtain errors that even a geek like me does not understand! Something like I have one broken package that prevent installation. Any tip to restore my system without re-installing it would be awesome. (Note, that if I have to trash it, it is no problem, it is just a vm with nothing important on it)

Revision history for this message
Huygens (huygens-25) wrote :

I manage to got at least my system back!

Here are the steps to recover it (note that some steps might not be useful, but I'm unsure):
1. reboot in recovery mode
2. choose the root prompt with network

And then:
dpkg-reconfigure -a
dpkg --configure -a

At that point, I had a missing file /sbin/udevadm which prevents any further change to my packages system. So I launch another VM with just Ubuntu Live CD, I have installed SSH (using synaptics), and I did a scp on the Ubuntu Live VM to get that missing udevadm file. So something like:
scp ubuntu@192.168.1.5:/sbin/udevadm /sbin/

Then I did again:
dpkg --configure -a
It did work this time, and I went on:
apt-get -f install
apt-get --fix-missing install
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get clean
apt-get autoremove
aptitude install ubuntu-desktop ubuntu-standard)
reboot

I have my system restored (or almost, the java, and a few other packages where still missing). No data loss.

Revision history for this message
to be removed (liw) wrote :

Huygens, as far as I know and can see from the code, computer-janitor does remove only the packages it shows. Could you send the /var/log/dpkg.log file from your computer, and attach it to this bug?

Changed in computer-janitor:
status: New → Incomplete
Revision history for this message
Huygens (huygens-25) wrote :

Hello Lars,
Thanks for your help with this bug.
You can find attached my dpkg.log file. The problem I have reported occured on March, 19th 2009 in the evening. I had a quick look at the file and I can see several updates from 21h00 until 22h00, just before I started cleaning up with Janitor. So if you look for the line below in the attached file, you should be more or less where the bug occured:
2009-03-19 22:40:05 startup packages remove

Revision history for this message
to be removed (liw) wrote :

Huygens, I see from the log that indeed a lot of packages were removed. I still don't see why. I also don't know how to reproduce this, which would help with debugging.

Changed in computer-janitor:
status: Incomplete → New
Revision history for this message
to be removed (liw) wrote :

Oh, things now make sense. computer-janitor uses python-apt and the default for python-apt is to remove reverse dependencies as well. I never thought it might do that until I started investigating this. I'll fix c-j so it only removes the packages it explicitly shows.

Changed in computer-janitor:
status: New → In Progress
to be removed (liw)
Changed in computer-janitor:
status: In Progress → Fix Committed
Revision history for this message
Huygens (huygens-25) wrote :

Hello Lars,
I'm glad you found this! Looks like the possible cause of this mayhem :-)
I have my virtual machine ready to test it again (I have several packages waiting to be cleaned) so I can run the test again! (I don't mind breaking my virtual machine, I have a backup and I know how to restore it now!)
One annoying thing about launchpad is that you do not know in which version of the package the fix has been committed. How do I know when I can make the test with the corrected Computer Janitor version?

to be removed (liw)
Changed in computer-janitor:
status: Fix Committed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package computer-janitor - 1.12.1-0ubuntu2

---------------
computer-janitor (1.12.1-0ubuntu2) jaunty; urgency=low

  * Fix gettext translation domain to be "computerjanitor" everywhere.
    (Closes: LP: #344704)
  * Fix NameError crash when closing an error dialog. Can't reproduce
    this, but I suspect it is some kind of weird race condition with
    threads and GTK+. (Closes: LP: #335828)
  * Fix typo on computerjanitorapp/app.py's help text for --no-act.
  * When a cruft is selected, scroll it into view after the label has
    been updated with the description. (Closes: LP: #349653)
  * plugins/unsupported_plugin.py: Don't mark as cruft stuff that has
    installed reverse dependencies. (Closes: LP: #345939)
  * data/computer-janitor.desktop.in: Use the right translation
    domain. (Closes: LP: #352770)

 -- Lars Wirzenius <email address hidden> Wed, 01 Apr 2009 17:20:45 +0300

Changed in computer-janitor (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Huygens (huygens-25) wrote :

I have tested the fixed release of Computer Janitor, and the bug is not reproducible. Furthermore, Computer Janitor effectively cleaned up the unnecessary packages !
So it works like a charm :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.