Update failed

I've just tried an update but I'm getting an error and the web pages appear to have failed. This is the error message displayed at the end of the update process.


E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Unable to complete update, please contact Pi-hole Support

Any ideas how I can fix this?

Did you try running apt --fix-broken install as the output suggested?

Indeed I did. It gave the error:

E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

So I tried

sudo apt --fix-broken install

and got this error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libevent-2.0-5 libfam0 libfreetype6-dev libpng-dev libpng-tools
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  bsdextrautils
The following NEW packages will be installed:
  bsdextrautils
0 upgraded, 1 newly installed, 0 to remove and 1012 not upgraded.
3 not fully installed or removed.
Need to get 0 B/138 kB of archives.
After this operation, 315 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up libstdc++6:armhf (10.2.1-6+rpi1) ...
(Reading database ... 115093 files and directories currently installed.)
Preparing to unpack .../bsdextrautils_2.36.1-8+deb11u1_armhf.deb ...
Unpacking bsdextrautils (2.36.1-8+deb11u1) ...
dpkg: error processing archive /var/cache/apt/archives/bsdextrautils_2.36.1-8+deb11u1_armhf.deb (--unpack):
 trying to overwrite '/usr/share/bash-completion/completions/hexdump', which is also in package bash-completion 1:2.1-4.3
Errors were encountered while processing:
 /var/cache/apt/archives/bsdextrautils_2.36.1-8+deb11u1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Could you try:

sudo dpkg --configure -a
sudo apt-get -f install

I'm getting the following error

pi@raspberrypi:~ $ sudo apt-get -f install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
apt-transport-https libevent-2.0-5 libfam0 libfreetype6-dev libpng-dev libpng-tools
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
bsdextrautils
The following NEW packages will be installed:
bsdextrautils
0 upgraded, 1 newly installed, 0 to remove and 1001 not upgraded.
1 not fully installed or removed.
Need to get 0 B/138 kB of archives.
After this operation, 315 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 115252 files and directories currently installed.)
Preparing to unpack .../bsdextrautils_2.36.1-8+deb11u1_armhf.deb ...
Unpacking bsdextrautils (2.36.1-8+deb11u1) ...
dpkg: error processing archive /var/cache/apt/archives/bsdextrautils_2.36.1-8+deb11u1_armhf.deb (--unpack):
trying to overwrite '/usr/share/bash-completion/completions/hexdump', which is also in package bash-completion 1:2.1-4.3
Errors were encountered while processing:
/var/cache/apt/archives/bsdextrautils_2.36.1-8+deb11u1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I think I would clear the apt cache sudo apt-get clean then try the commands that I gave above again.

I'm getting the following

pi@raspberrypi:~ $ sudo apt-get clean
pi@raspberrypi:~ $ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of bsdmainutils:
bsdmainutils depends on bsdextrautils (>= 2.35.2-7); however:
Package bsdextrautils is not installed.

dpkg: error processing package bsdmainutils (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent processing triggers for man-db:
man-db depends on bsdmainutils; however:
Package bsdmainutils is not configured yet.

dpkg: error processing package man-db (--configure):
dependency problems - leaving triggers unprocessed
Errors were encountered while processing:
bsdmainutils
man-db

Now run the final command sudo apt-get -f install, hopefully that will sort the dependency issue out.

Still the error with bsdextrautils

pi@raspberrypi:~ $ sudo apt-get -f install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
apt-transport-https libevent-2.0-5 libfam0 libfreetype6-dev libpng-dev libpng-tools
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
bsdextrautils
The following NEW packages will be installed:
bsdextrautils
0 upgraded, 1 newly installed, 0 to remove and 1001 not upgraded.
1 not fully installed or removed.
Need to get 0 B/138 kB of archives.
After this operation, 315 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 115252 files and directories currently installed.)
Preparing to unpack .../bsdextrautils_2.36.1-8+deb11u1_armhf.deb ...
Unpacking bsdextrautils (2.36.1-8+deb11u1) ...
dpkg: error processing archive /var/cache/apt/archives/bsdextrautils_2.36.1-8+deb11u1_armhf.deb (--unpack):
trying to overwrite '/usr/share/bash-completion/completions/hexdump', which is also in package bash-completion 1:2.1-4.3
Errors were encountered while processing:
/var/cache/apt/archives/bsdextrautils_2.36.1-8+deb11u1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm thinking of setting up everything from scratch on a new installation. Unfortunately the upgrade has broken the teleport option so I can't export my settings. Is there any way I can manually copy the configuration files?

It looks like there is a conflict between bsdextrautils and bash-completion, you could try removing bash-completion and run the update again.

I managed to fix it using :

sudo dpkg -i --force-overwrite /var/cache/apt/archives/bsdextrautils_2.36.1-8+deb11u1_armhf.deb

which then allowed the pihole -up to work!

THANKS for your help!

No problem. I didn't suggest --force-overwrite as an option as it can cause problems and didn't want to be responsible for trashing your install. Hopefully, you won't have any further issues.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.