Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Software] unable to upgrade to Debian 12 - apthook returned error (127)

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
gluhend
Posts: 3
Joined: 2024-04-19 02:51

[Software] unable to upgrade to Debian 12 - apthook returned error (127)

#1 Post by gluhend »

I was following this guide to upgrade from Debian 11 to Debian 12
https://linuxiac.com/how-to-upgrade-to- ... debian-11/

When I get to the line "sudo apt upgrade --without-new-pkgs" it fails with the following error

Code: Select all

339 upgraded, 0 newly installed, 0 to remove and 652 not upgraded.
Need to get 0 B/139 MB of archives.
After this operation, 24.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Extracting templates from packages: 100%
Preconfiguring packages ...
/bin/sh: 1: /usr/bin/notifiarr: not found
E: Sub-process /usr/bin/notifiarr --apthook returned an error code (127)
E: Failure running script /usr/bin/notifiarr --apthook
It seems to be notifiarr is not properly removed, but it will not let me install it, and it will not let me uninstall it

Code: Select all

$ sudo apt install -f notifiarr
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  notifiarr
0 upgraded, 1 newly installed, 0 to remove and 991 not upgraded.
Need to get 0 B/12.7 MB of archives.
After this operation, 26.3 MB of additional disk space will be used.
/bin/sh: 1: /usr/bin/notifiarr: not found
E: Sub-process /usr/bin/notifiarr --apthook returned an error code (127)
E: Failure running script /usr/bin/notifiarr --apthook
$ sudo apt remove notifiarr
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'notifiarr' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 991 not upgraded.
how can i remove this so that I can upgrade? thanks

edit: I deleted /etc/apt/apt.conf.d/999notifiarr.conf and everything works now

User avatar
mrnordio2
Posts: 27
Joined: 2023-03-29 14:53
Has thanked: 1 time
Been thanked: 6 times

Re: [Software] unable to upgrade to Debian 12 - apthook returned error (127)

#2 Post by mrnordio2 »

Hello gluhend,

It looks like you managed to resolve the issue yourself by removing the 999notifiarr.conf file from /etc/apt/apt.conf.d/, which is great!

For future reference, if you encounter similar issues where a script is causing problems during the package management process, removing the specific configuration files related to that script, as you did, is a good solution. This is because these configuration files can sometimes contain hooks that are called during package operations, and if the associated binaries are missing or corrupted, it can prevent apt from functioning correctly.

If someone else experiences this issue and finds that deleting the configuration file doesn't solve the problem, another approach would be to manually edit the package status file to remove references to the troublesome package. This can be done with caution:

Back up the current status file:

Code: Select all

sudo cp /var/lib/dpkg/status /var/lib/dpkg/status.backup
Edit the status file:

Code: Select all

sudo nano /var/lib/dpkg/status
Search for the block of text related to the problematic package (notifiarr in this case) and carefully delete that entire block.

Save the file and exit the editor, then try running:

Code: Select all

sudo apt-get update

Code: Select all

sudo apt-get install -f
If the package system was deeply affected, you might consider using:

Code: Select all

sudo dpkg --configure -a
It’s always a good practice to make sure all your configurations and scripts are up-to-date and relevant to the installed versions of your software to avoid these kinds of issues.

I'm glad to hear you figured it out, and if you have any more questions or need further assistance, feel free to ask. Happy computing with Debian 12!

Best regards.
In a world of 1s and 0s, I am the exceptional exception. Linux isn't just my platform; it's my playground.

Post Reply