cannot purge config files for linux-ubuntu-modules-2.6.22-12-generic

Bug #149836 reported by mon
112
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-restricted-modules-2.6.24 (Ubuntu)
Invalid
Low
Timo Aaltonen
Gutsy
Won't Fix
Undecided
Unassigned
linux-ubuntu-modules-2.6.22 (Ubuntu)
Invalid
Undecided
Unassigned
Gutsy
Fix Released
Undecided
Unassigned
linux-ubuntu-modules-2.6.24 (Ubuntu)
Fix Released
Medium
Unassigned
Gutsy
Invalid
Undecided
Unassigned

Bug Description

Hi

I cannot remove this package's config files:

sudo dpkg --purge linux-ubuntu-modules-2.6.22-12-generic
(Leyendo la base de datos ...
105816 ficheros y directorios instalados actualmente.)
Desinstalando linux-ubuntu-modules-2.6.22-12-generic ...
Purgando ficheros de configuración de linux-ubuntu-modules-2.6.22-12-generic ...
FATAL: Could not open '/boot/System.map-2.6.22-12-generic': No such file or directory
update-initramfs: Generating /boot/initrd.img-2.6.22-12-generic
Cannot find /lib/modules/2.6.22-12-generic
update-initramfs: failed for /boot/initrd.img-2.6.22-12-generic
dpkg: error al procesar linux-ubuntu-modules-2.6.22-12-generic (--purge):
 el subproceso post-removal script devolvió el código de salida de error 1
Se encontraron errores al procesar:
 linux-ubuntu-modules-2.6.22-12-generic

I'm running gutsy x86 up to date with kernel 2.6.22-13

Revision history for this message
Feng Chao (chaofeng) wrote :

same to me ,both linux-ubuntu-modules-2.6.22- * can not be purged

Revision history for this message
Matti Lindell (mlind) wrote :

I reckon this error happens when corresponding linux-image package has been removed before linux-ubuntu-modules is purged. linux-ubuntu-modules .postrm shouldn't be doing depmod or update-initramfs anymore in this case. You can probably workaround this issue by manually creating /lib/modules/2.6.22-12-generic directory and then trying to purge linux-ubuntu-modules.

Changed in linux-ubuntu-modules-2.6.22:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Rafael Belmonte (eaglescreen) wrote :

I have the same problem:
See the screen shot please.

Revision history for this message
Loye Young (loyeyoung) wrote :

This is a result of using dpkg (or apt-get) for command line package management instead of aptitude, which is the upstream recommended command line package manager. Neither dpkg and apt-get handle dependencies nearly as gracefully as aptitude. Dpkg was never intended to do so. Apt-get does have better dependency handling, but aptitude was written in part to significantly improve dependency handling over apt-get. Synaptic by default uses apt-get, in part because of the installed base of machines that have exclusively used apt-get in the past. (IMHO, it's time to fix Synaptic.) The upstream Debian Manual is recommending that everyone switch to aptitude. (For a more complete analysis, see Larry Garfield's excellent article at http://www.garfieldtech.com/blog/your-debian-aptitude

But I digress. To fix your issue, try the following:
1. Become root, update aptitude, and sync dpkg and apt:
<code>
yourname@yourhost:/~# sudo -s
Password: [yourpasswordhere]
root@yourhost: /~# aptitude update
root@yourhost: /~# sync-available
</code>
2. Reinstall linux-image-2.6.22-12-generic and linux-ubuntu-modules-2.6.22-12-generic:
<code>
root@yourhost: /~# aptitude install linux-image-2.6.22-12-generic linux-ubuntu-modules-2.6.22-12-generic
</code>
You will need to read carefully the messages from aptitude, which provides much more helpful information that you are probably accustomed to using dpkg or apt-get. Aptitude will try to identify and solve dependency problems with your installation. If you have been using dpkg and/or apt-get on a machine for a while, you will likely have some, so ensure that you understand what it's doing.

3. Then purge both:
<code>
root@yourhost: /~# aptitude purge linux-image-2.6.22-12-generic linux-ubuntu-modules-2.6.22-12-generic
</code>
Again, read the screen. In this case, there will likely be some dependencies that need fixing. Aptitude will suggest solutions. Read and think about the choices it gives you. If you don't like the choice suggested, tell it and it will try to come up with another.

4. After you are done, EXIT ROOT and the terminal:
<code>
root@yourhost: /~# exit
yourname@yourhost:/~# exit
</code>

Report back on if this fixes your issues.

Revision history for this message
Rafael Belmonte (eaglescreen) wrote :

One problem is that linux-image-2.6.22-12-generic and linux-ubuntu-modules-2.6.22-12-generic packages has been disapeared from repositories, and if someone has cleaned package, he cannot install them again.
It is not possible purge it unless someone create manually a fake file /boot/System.map-2.6.22-12-generic, and create manually folder /lib/modules/2.6.22-12-generic.

Aptitude has a big failure, sometimes mark for autoremoval many packages that was installed by other package managers and uninstall without user wants do it.

Revision history for this message
Loye Young (loyeyoung) wrote : Re: [Bug 149836] Re: cannot purge config files for linux-ubuntu-modules-2.6.22-12-generic

On Monday, October 8, 2007 1:48:52 pm EagleScreen wrote:
> One problem is that linux-image-2.6.22-12-generic and
> linux-ubuntu-modules-2.6.22-12-generic packages has been disapeared from
> repositories, and if someone has cleaned package, he cannot install them
> again. It is not possible purge it unless someone create manually a fake
> file /boot/System.map-2.6.22-12-generic, and create manually folder
> /lib/modules/2.6.22-12-generic.
good point and a good work around.

> Aptitude has a big failure, sometimes mark for autoremoval many packages
> that was installed by other package managers
Not exactly. Aptitude doesn't "autoremove" anything. In command-line mode,
aptitude holds the packages, but tells the user about them. In full screen
mode, aptitude marks for removal packages that don't have dependencies set
correctly in the database and presents the list to the user before doing
anything.

The behavior you allude to is not a failure, it's what should happen upon
migration to aptitude and it's yet another reason to use aptitude.

Aptitude keeps kruft out of the installed package list, something apt-get
doesn't do. If the machine always uses aptitude, the issue never arises
because aptitude doesn't allow kruft to accumulate.

If you've used apt-get and/or dpkg extensively, you will inevitably have
accumulated kruft because apt-get doesn't keep track of the installed
packages very well. By default, aptitude dutifully tries to clean up after
her older sister apt-get. So it presents a list of packages that don't have
the proper dependencies specified in the database for possible removal.

It's easy to keep them all, of course. Simply navigate to heading at the top
of the list for removal and hit the plus (+) key.

If you _want_ to keep accumulating kruft and orphaned dependencies in the
manner of apt-get, you simply change the setting in aptitude (either in the
full screen mode menu or in the configuration file) and she will happily do
what you want.

Some folks have suggested keeping apt-get and installing deborphan to fix the
orphaned packages issue. However, that actually swings too far in the other
direction, because deborphan really does autoremove the packages and provides
much less information to the user.

>and uninstall without user wants do it.
Aptitude won't uninstall anything without the user's approval. It presents the
list and allows the user to decide.

Calling aptitude's intelligent dependency handling a "failure" and using that
as a reason to keep apt-get simply perpetuates a bad situation. We would all
be better off by deprecating apt-get as Debian has recommended and using
aptitude consistently from the beginning. Eventually, we will be forced to
anyway because apt-get will eventually be retired upstream.

Again, I refer the reader to Larry Garfield's article and the comments to it,
where this issue is fully discussed.
http://www.garfieldtech.com/blog/your-debian-aptitude

Happy Trails,

Loye Young
Isaac & Young Computer Company
Laredo, Texas
http://www.iycc.biz

Revision history for this message
Loye Young (loyeyoung) wrote :

UPDATE:

It appears that Daniel Burrows (the author of aptitude) has figured out a way to infer the correct dependencies of packages installed with legacy package managers (e.g., apt-get). Consequently, aptitude does not keep a separate database anymore.

The effect of the changes (since v. 4.5.1 released June 15, 2007) is that aptitude does not list for removal packages intentionally installed via apt-get, effectively removing EagleScreen's objection to aptitude.

Loye

Revision history for this message
Matti Lindell (mlind) wrote :

Loye, this but is not about aptitude - there seems to be bug in l-u-m's .postrm. dpkg should be able to remove this package cleanly, or otherwise it's a packaging bug. I appreciate your comments, but those are unrelated to this issue.

Revision history for this message
Loye Young (loyeyoung) wrote :

On Tuesday, October 9, 2007 9:01:28 am mlind wrote:
> Loye, this but is not about aptitude - there seems to be bug in l-u-m's
> .postrm. dpkg should be able to remove this package cleanly, or
> otherwise it's a packaging bug. I appreciate your comments, but those
> are unrelated to this issue.

Point taken.

Revision history for this message
stuart62 (stuartbrant) wrote :
Download full text (4.3 KiB)

I have tried the above and when I do root@yourhost: /~# aptitude install linux-image-2.6.22-12-generic linux-ubuntu-modules-2.6.22-12-generic I get in the list:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initialising package states... Done
Building tag database... Done
Couldn't find any package whose name or description matched "2.6.22-12-generic"
Couldn't find any package whose name or description matched "linux-ubuntu-modules-2.6.22-12-generic"
The following NEW packages will be installed:
  linux-image
The following partially installed packages will be configured:
  acpi-support acpid powermanagement-interface ubuntu-desktop
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/25.4kB of archives. After unpacking 53.2kB will be used.
Writing extended state information... Done
Selecting previously deselected package linux-image.
(Reading database ... 113935 files and directories currently installed.)
Unpacking linux-image (from .../linux-image_2.6.22.14.21_i386.deb) ...
Setting up acpid (1.0.4-5ubuntu8) ...
 * Loading ACPI modules... [ OK ]
 * Starting ACPI services... invoke-rc.d: initscript acpid, action "start" failed.
dpkg: error processing acpid (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of acpi-support:
 acpi-support depends on acpid (>= 1.0.4-1ubuntu4); however:
  Package acpid is not configured yet.
dpkg: error processing acpi-support (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of powermanagement-interface:
 powermanagement-interface depends on acpi-support (>= 0.17); however:
  Package acpi-support is not configured yet.
dpkg: error processing powermanagement-interface (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-desktop:
 ubuntu-desktop depends on acpi-support; however:
  Package acpi-support is not configured yet.
 ubuntu-desktop depends on acpid; however:
  Package acpid is not configured yet.
 ubuntu-desktop depends on powermanagement-interface; however:
  Package powermanagement-interface is not configured yet.
dpkg: error processing ubuntu-desktop (--configure):
 dependency problems - leaving unconfigured
Setting up linux-image (2.6.22.14.21) ...
Errors were encountered while processing:
 acpid
 acpi-support
 powermanagement-interface
 ubuntu-desktop
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up acpid (1.0.4-5ubuntu8) ...
 * Loading ACPI modules... [ OK ]
 * Starting ACPI services... invoke-rc.d: initscript acpid, action "start" failed.
dpkg: error processing acpid (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of ubuntu-desktop:
 ub...

Read more...

Revision history for this message
Joel C. Salomon (jcsalomon) wrote :

Confirmation that EagleScreen's fix worked. In my case I ran:

chesky@maxwell:~$ sudo touch /boot/System.map-2.6.24-4-386 /boot/System.map-2.6.24-4-generic /boot/System.map-2.6.24-4-virtual
chesky@maxwell:~$ sudo mkdir /lib/modules/2.6.24-4-386 /lib/modules/2.6.24-4-generic /lib/modules/2.6.24-4-virtual

and Synaptic removed the packages correctly.

Daniel Hahler (blueyed)
Changed in linux-ubuntu-modules-2.6.22:
status: Confirmed → Triaged
Changed in linux-ubuntu-modules-2.6.24:
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Daniel Hahler (blueyed) wrote :

Proposed fix. This changes debian/control-scripts/postrm:
always exit with error code 0, so that failure of update-initramfs still allows the package to be removed or purged.

Changed in linux-ubuntu-modules-2.6.24:
status: In Progress → Triaged
Revision history for this message
Daniel Holbach (dholbach) wrote :

Kernel Team: could you please take a look at it?

Daniel Hahler (blueyed)
Changed in linux-ubuntu-modules-2.6.24:
milestone: none → ubuntu-8.04
Revision history for this message
Daniel Holbach (dholbach) wrote :

Ben: can you please take a look at it?

Revision history for this message
Steve Langasek (vorlon) wrote :

I'm not sure that the proposed patch is correct. The errors should be ignored during postrm purge, but this change also affects the results if "postrm remove" fails; since the linux-ubuntu-modules postrm will be called with the "remove" argument while linux-image is still present (unless someone has overridden dpkg with --force-depends), any failures in postrm remove are probably an issue that it's better to raise an error on.

I also don't think that update-initramfs needs to be called at all for "purge"; this should all be handled already for "remove".

So here is a counter-suggestion.

Revision history for this message
Daniel Hahler (blueyed) wrote :

Thank you for looking into this, Steve. I agree that your approach is probably better.

However, in this case, linux-restricted-modules.postrm in linux-restricted-modules-2.6.24 should be fixed in the same manner. That's where I've copied my proposed "fix" from.

Revision history for this message
Steve Langasek (vorlon) wrote :

agreed, let's add an lrm task :)

Changed in linux-restricted-modules-2.6.24:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

I'll likely do the next upload of lrm.

Changed in linux-restricted-modules-2.6.24:
assignee: nobody → tjaalton
Revision history for this message
jinko (scarface10x) wrote :

Thanks a lot for help. Now it's all ok.

2008/3/26, Steve Langasek <email address hidden>:
>
> I'm not sure that the proposed patch is correct. The errors should be
> ignored during postrm purge, but this change also affects the results if
> "postrm remove" fails; since the linux-ubuntu-modules postrm will be
> called with the "remove" argument while linux-image is still present
> (unless someone has overridden dpkg with --force-depends), any failures
> in postrm remove are probably an issue that it's better to raise an
> error on.
>
> I also don't think that update-initramfs needs to be called at all for
> "purge"; this should all be handled already for "remove".
>
> So here is a counter-suggestion.
>
> ** Attachment added: "patch to not call update-initramfs on purge"
> http://launchpadlibrarian.net/12906962/lum-purge-not-needed.patch
>
>
> --
> cannot purge config files for linux-ubuntu-modules-2.6.22-12-generic
> https://bugs.launchpad.net/bugs/149836
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Source Package "linux-ubuntu-modules-2.6.22" in Ubuntu: Triaged
> Status in Source Package "linux-ubuntu-modules-2.6.24" in Ubuntu: Triaged
>
> Bug description:
> Hi
>
> I cannot remove this package's config files:
>
> sudo dpkg --purge linux-ubuntu-modules-2.6.22-12-generic
> (Leyendo la base de datos ...
> 105816 ficheros y directorios instalados actualmente.)
> Desinstalando linux-ubuntu-modules-2.6.22-12-generic ...
> Purgando ficheros de configuración de
> linux-ubuntu-modules-2.6.22-12-generic ...
> FATAL: Could not open '/boot/System.map-2.6.22-12-generic': No such file
> or directory
> update-initramfs: Generating /boot/initrd.img-2.6.22-12-generic
> Cannot find /lib/modules/2.6.22-12-generic
> update-initramfs: failed for /boot/initrd.img-2.6.22-12-generic
> dpkg: error al procesar linux-ubuntu-modules-2.6.22-12-generic (--purge):
> el subproceso post-removal script devolvió el código de salida de error
> 1
> Se encontraron errores al procesar:
> linux-ubuntu-modules-2.6.22-12-generic
>
>
> I'm running gutsy x86 up to date with kernel 2.6.22-13
>

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

I can't find update-initramfs from the lrm scripts, so nothing to fix :)

Changed in linux-restricted-modules-2.6.24:
status: Triaged → Invalid
Revision history for this message
Daniel Hahler (blueyed) wrote :

Timo, I was referring to the "exit 0" and I'm not sure if Steve only was referring to errors from update-initramfs.

For reference, linux-restricted-modules.postrm does:
 case "$1" in
   remove|purge)
     depmod -a -q -F /boot/System.map-@@KVERSION@@ @@KVERSION@@
     ;;
 esac

 exit 0

Steve Langasek (vorlon)
Changed in linux-ubuntu-modules-2.6.24:
assignee: nobody → ubuntu-kernel-team
Revision history for this message
Tim Gardner (timg-tpi) wrote :
Changed in linux-ubuntu-modules-2.6.24:
assignee: ubuntu-kernel-team → timg-tpi
status: Triaged → Fix Committed
Revision history for this message
Tim Gardner (timg-tpi) wrote :

I don't think this is worthy of an SRU, but it will get picked up the next Gutsy LUM release.
http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-gutsy-lum.git;a=commit;h=38eb37b4b0954c094efc6e1aa591927aa9c1b2d4

Changed in linux-ubuntu-modules-2.6.22:
assignee: nobody → timg-tpi
milestone: none → gutsy-updates
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux-ubuntu-modules-2.6.24 - 2.6.24-16.21

---------------
linux-ubuntu-modules-2.6.24 (2.6.24-16.21) hardy; urgency=low

  [Stefan Bader]

  * Fix potential lockups in ALSA snd_usb_caiaq

  [Chuck Short]

  * Update iscsitarget drive
    - LP: #208281

  [Tim Gardner]

  * Fix cx88 NULL pointer dereference

  [Steve Langasek]

  * Don't call update-initramfs on postrm purge, this is redundant and can
    cause maintainer script failures if the linux-image package has already
    been removed.
    - LP: #149836

 -- Tim Gardner <email address hidden> Tue, 08 Apr 2008 12:21:01 -0600

Changed in linux-ubuntu-modules-2.6.24:
status: Fix Committed → Fix Released
Revision history for this message
Tim Gardner (timg-tpi) wrote :

2.6.22-16.42

  * cannot purge config files
    - LP: #149836

Changed in linux-ubuntu-modules-2.6.22 (Ubuntu Gutsy):
status: New → Fix Released
Changed in linux-ubuntu-modules-2.6.22 (Ubuntu):
importance: Medium → Undecided
milestone: gutsy-updates → none
status: Fix Committed → Invalid
Changed in linux-ubuntu-modules-2.6.24 (Ubuntu Gutsy):
status: New → Invalid
Changed in linux-ubuntu-modules-2.6.24 (Ubuntu):
assignee: Tim Gardner (timg-tpi) → nobody
milestone: ubuntu-8.04 → none
Changed in linux-ubuntu-modules-2.6.22 (Ubuntu):
assignee: Tim Gardner (timg-tpi) → nobody
Revision history for this message
Sergio Zanchetta (primes2h) wrote :

The 18 month support period for Gutsy Gibbon 7.10 has reached its end of life -
http://www.ubuntu.com/news/ubuntu-7.10-eol . As a result, we are closing the
Gutsy task.

Changed in linux-restricted-modules-2.6.24 (Ubuntu Gutsy):
status: New → Won't Fix
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.