Results 1 to 5 of 5

Thread: linux-image post-removal script subprocess returned error exit status 1

  1. #1
    Join Date
    Feb 2007
    Location
    New Zealand
    Beans
    13
    Distro
    Ubuntu 7.04 Feisty Fawn

    linux-image post-removal script subprocess returned error exit status 1

    Hi All

    I have recently upgraded from 18.04 LTS to 20.04 LTS. During the upgrade, there were errors to do with removing an old kernel.
    If I run Synaptic, and select Broken dependencies, there is one package listed: linux-image-4.15.0-117-generic
    The linux-image is marked for complete removal and cannot be un-marked. If I Apply the changes, then the details windows has the output shown below.

    Although I have used Ubuntu LTS releases for many years, they have always just worked and so I have little experience in fixing issues such as the one I have now.
    In the output below I can see a number of errors, including "/etc/grub.d/25_custom_proxy: 3: /etc/grub.d/bin/grubcfg_proxy: not found" and "installed linux-image-4.15.0-117-generic package post-removal script subprocess returned error exit status 1". I am guessing that we can ignore the "cryptsetup: WARNING: Option 'size' missing in crypttab" error for now.

    Can anyone suggest what I should do next? I have searched the forums for answers but haven't found anything that works. If someone can point me to a relevant thread, I would appreciate that.

    Cheers
    Andrew Mc

    Code:
    (Reading database ... 300694 files and directories currently installed.)
    Removing linux-image-4.15.0-117-generic (4.15.0-117.118) ...
    /etc/kernel/postrm.d/initramfs-tools:
    update-initramfs: Deleting /boot/initrd.img-4.15.0-117-generic
    /etc/kernel/postrm.d/zz-update-grub:
    Sourcing file `/etc/default/grub'
    Sourcing file `/etc/default/grub.d/init-select.cfg'
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-5.4.0-52-generic
    Found initrd image: /boot/initrd.img-5.4.0-52-generic
    Found linux image: /boot/vmlinuz-5.4.0-51-generic
    Found initrd image: /boot/initrd.img-5.4.0-51-generic
    Found linux image: /boot/vmlinuz-5.4.0-48-generic
    Found initrd image: /boot/initrd.img-5.4.0-48-generic
    Found linux image: /boot/vmlinuz-4.15.0-118-generic
    Found initrd image: /boot/initrd.img-4.15.0-118-generic
    /etc/grub.d/25_custom_proxy: 3: /etc/grub.d/bin/grubcfg_proxy: not found
    run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
    dpkg: error processing package linux-image-4.15.0-117-generic (--remove):
     installed linux-image-4.15.0-117-generic package post-removal script subprocess returned error exit status 1
    dpkg: too many errors, stopping
    Errors were encountered while processing:
     linux-image-4.15.0-117-generic
    Processing was halted because there were too many errors.
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    A package failed to install.  Trying to recover:
    Setting up linux-image-5.4.0-52-generic (5.4.0-52.57) ...
    Setting up linux-image-5.4.0-51-generic (5.4.0-51.56) ...
    Processing triggers for linux-image-5.4.0-52-generic (5.4.0-52.57) ...
    /etc/kernel/postinst.d/dkms:
     * dkms: running auto installation service for kernel 5.4.0-52-generic
       ...done.
    /etc/kernel/postinst.d/initramfs-tools:
    update-initramfs: Generating /boot/initrd.img-5.4.0-52-generic
    cryptsetup: WARNING: Option 'size' missing in crypttab for plain dm-crypt 
        mapping cryptswap1. Please read 
        /usr/share/doc/cryptsetup-initramfs/README.initramfs.gz and add the correct 
        'size' option to your crypttab(5).
    cryptsetup: WARNING: Resume target cryptswap1 uses a key file
    /etc/kernel/postinst.d/zz-update-grub:
    Sourcing file `/etc/default/grub'
    Sourcing file `/etc/default/grub.d/init-select.cfg'
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-5.4.0-52-generic
    Found initrd image: /boot/initrd.img-5.4.0-52-generic
    Found linux image: /boot/vmlinuz-5.4.0-51-generic
    Found initrd image: /boot/initrd.img-5.4.0-51-generic
    Found linux image: /boot/vmlinuz-5.4.0-48-generic
    Found initrd image: /boot/initrd.img-5.4.0-48-generic
    Found linux image: /boot/vmlinuz-4.15.0-118-generic
    Found initrd image: /boot/initrd.img-4.15.0-118-generic
    /etc/grub.d/25_custom_proxy: 3: /etc/grub.d/bin/grubcfg_proxy: not found
    tail: write error: Broken pipe
    run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
    dpkg: error processing package linux-image-5.4.0-52-generic (--configure):
     installed linux-image-5.4.0-52-generic package post-installation script subprocess returned error exit status 1
    Processing triggers for linux-image-5.4.0-51-generic (5.4.0-51.56) ...
    /etc/kernel/postinst.d/dkms:
     * dkms: running auto installation service for kernel 5.4.0-51-generic
       ...done.
    /etc/kernel/postinst.d/initramfs-tools:
    update-initramfs: Generating /boot/initrd.img-5.4.0-51-generic
    cryptsetup: WARNING: Option 'size' missing in crypttab for plain dm-crypt 
        mapping cryptswap1. Please read 
        /usr/share/doc/cryptsetup-initramfs/README.initramfs.gz and add the correct 
        'size' option to your crypttab(5).
    cryptsetup: WARNING: Resume target cryptswap1 uses a key file
    /etc/kernel/postinst.d/zz-update-grub:
    Sourcing file `/etc/default/grub'
    Sourcing file `/etc/default/grub.d/init-select.cfg'
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-5.4.0-52-generic
    Found initrd image: /boot/initrd.img-5.4.0-52-generic
    Found linux image: /boot/vmlinuz-5.4.0-51-generic
    Found initrd image: /boot/initrd.img-5.4.0-51-generic
    Found linux image: /boot/vmlinuz-5.4.0-48-generic
    Found initrd image: /boot/initrd.img-5.4.0-48-generic
    Found linux image: /boot/vmlinuz-4.15.0-118-generic
    Found initrd image: /boot/initrd.img-4.15.0-118-generic
    /etc/grub.d/25_custom_proxy: 3: /etc/grub.d/bin/grubcfg_proxy: not found
    tail: write error: Broken pipe
    run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
    dpkg: error processing package linux-image-5.4.0-51-generic (--configure):
     installed linux-image-5.4.0-51-generic package post-installation script subprocess returned error exit status 1
    Errors were encountered while processing:
     linux-image-5.4.0-52-generic
     linux-image-5.4.0-51-generic

  2. #2
    Join Date
    Aug 2011
    Location
    52.5° N 6.4° E
    Beans
    6,824
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: linux-image post-removal script subprocess returned error exit status 1

    The directory /etc/grub.d/ contains files that are automatically executed when grub is updated. It contains a file named /etc/grub.d/25_custom_proxy (which doesn't exist on a stock Ubuntu system), that in turn tries to execute /etc/grub.d/bin/grubcfg_proxy, which doesn't exist.

    Have you done anything to customise grub that may have put that 25_custom_proxy file there? It looks like it was put there by some tool and not properly removed before the upgrade. Can you find out to which package it belongs?
    Code:
    dpkg --search /etc/grub.d/25_custom_proxy
    If it doesn't belong to any package, maybe it helps if you remove execute permission from that file. It's not present on a stock Ubuntu system, so it shouldn't be vital (but might contain stuff specific for your hardware, in particular if you bought your computer with Ubuntu preinstalled).
    Code:
    sudo chmod 644 /etc/grub.d/25_custom_proxy
    # Can be undone with
    sudo chmod 755 /etc/grub.d/25_custom_proxy

  3. #3
    Join Date
    Feb 2007
    Location
    New Zealand
    Beans
    13
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: linux-image post-removal script subprocess returned error exit status 1

    Thank you for the reply which has been very helpful. I have now solved the problem and removed the remainder of the old kernel, linux-image-4.15.0-117-generic.

    Your comment about customising grub made me look at the repositories listed in Synaptic. I see that, in Other Software, there is a disabled repository for grub-customizer. The repository was disabled for a previous upgrade. I had obviously installed grub-customizer in the past, but I cannot recall when or why.

    When I ran the command,
    Code:
    dpkg --search /etc/grub.d/25_custom_proxy
    I did not find anything:
    dpkg-query: no path found matching pattern /etc/grub.d/25_custom_proxy

    Then I removed the execution permission for 25_custom_proxy using your suggested command.
    Code:
    sudo chmod 644 /etc/grub.d/25_custom_proxy
    I then ran
    Code:
    sudo apt autoremove
    which ran without errors!

    I have since successfully added and removed several packages using Synaptic and all is working as it should.
    Thank you very much for your help. It was exactly what I needed.

    Cheers
    Andrew Mc

  4. #4
    Join Date
    Aug 2011
    Location
    52.5° N 6.4° E
    Beans
    6,824
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: linux-image post-removal script subprocess returned error exit status 1

    So grub-customizer wasn't properly removed. That isn't the first time grub-customizer breaks grub.

    If everything works fine, you can completely remove /etc/grub.d/25_custom_proxy:
    Code:
    sudo rm /etc/grub.d/25_custom_proxy
    The command in my previous post only made it non-executable.

  5. #5
    Join Date
    Feb 2007
    Location
    New Zealand
    Beans
    13
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: linux-image post-removal script subprocess returned error exit status 1

    Thanks for the advice. I removed the /etc/grub.d/25_custom_proxy file and all is good.

    Cheers, Andrew Mc

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •