0

I was trying to upgrade Debian 10/KDE to Debian 11 bullseye stable via sudo apt upgrade --without-new-pkgs

The output was:

Preparing to unpack .../dh-autoreconf_20_all.deb ...
Unpacking dh-autoreconf (20) over (19) ...
Setting up aide-common (0.17.3-4) ...
Replacing config file /etc/cron.daily/aide with new version
cp: cannot remove '/etc/cron.daily/aide': Operation not permitted
dpkg: error processing package aide-common (--configure):
 installed aide-common package post-installation script subprocess returned error exit status 1
Setting up dh-autoreconf (20) ...
Processing triggers for man-db (2.8.5-2) ...
Errors were encountered while processing:
 aide-common
Invalid SCRIPTWHITELIST configuration option: Non-existent pathname: /bin/which
E: Sub-process /usr/bin/dpkg returned an error code (1)
E: Problem executing scripts DPkg::Post-Invoke 'if [ -x /usr/bin/rkhunter ] && grep -qiE '^APT_AUTOGEN=.?(true|yes)' /etc/default/rkhunter; then /usr/share/rkhunter/scripts/rkhupd.sh; fi'
E: Sub-process returned an error code

I then removed aide (sudo apt-get remove aide) and tried again, after installing it says this:

Invalid SCRIPTWHITELIST configuration option: Non-existent pathname: /bin/which
E: Problem executing scripts DPkg::Post-Invoke 'if [ -x /usr/bin/rkhunter ] && grep -qiE '^APT_AUTOGEN=.?(true|yes)' /etc/default/rkhunter; then /usr/share/rkhunter/scripts/rkhupd.sh; fi'
E: Sub-process returned an error code

I then tried again but now unattended-upgr is running and it doesn't quit after waiting for a while, after running "End Process" in the process manager or sending a KILL signal to it (even though now it's only one instead of two unattended-upgr processes).

It seems to have mostly run through as lsb_release -a returns Release: 11.

Are these errors problematic or should I simply restart for it to be solved? And if so, shouldn't there be some message that a restart is needed (or a better error message)?

mYnDstrEAm
  • 4,275
  • 14
  • 57
  • 118

3 Answers3

2

You’re running into a problem with rkhunter, tracked as Debian bug #932594.

In short, rkhunter.conf’s paths don’t match your system’s. You’ll need to edit it to fix the path to which:

sed -i s,SCRIPTWHITELIST=/bin/which,SCRIPTWHITELIST=/usr/bin/which, /etc/rkhunter.conf

To stop unattended-upgrade, kill it with

killall -9 unattended-upgrade

then look for any stray apt- or dpkg-related processes, and kill them too if they don’t exit in a reasonable amount of time.

Stephen Kitt
  • 434,908
  • To put simply the solution is to edit /etc/rkhunter.conf and change SCRIPTWHITELIST=/bin/which to SCRIPTWHITELIST=/usr/bin/which (the path displayed when running which which), save the file and rerun the command. However, if that's correct that's not solving the problem of unattended-upgr blocking the upgrade. – mYnDstrEAm Aug 26 '21 at 12:43
0

You have rkhunter installed and configured to run every time you do operations with apt. Edit the rkhunter.conf and see if SCRIPTWHITELIST is set to /bin/which. There would be multiple entries there. Change it to the right path for which. Or you can remove rkhunter from running every time you execute apt.

Alex
  • 1,958
0

The location of egrep and fgrep seems to have moved from /usr/bin to /bin. The easiest thing to do get things going for you is just symlink to the old location

sudo ln -s /bin/egrep /usr/bin/egrep
sudo ln -s /bin/fgrep /usr/bin/fgrep

And then it was able to get passt the SCRIPTWHITELIST issue.

Adam A.
  • 101