dpkg: error processing package linux-image

TrogloDeb

New Member
Joined
Dec 8, 2023
Messages
7
Reaction score
2
Credits
89
HELP, PLEASE. After upgrade from 11 to Deb 12 Bookworm, all packages are up to date using sudo apt update - BUT - "sudo apt upgrade" causes the following:

sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up linux-image-6.1.0-13-amd64 (6.1.55-1) ...
/etc/kernel/postinst.d/dkms:
dkms: running auto installation service for kernel 6.1.0-13-amd64.
Sign command: /usr/lib/linux-kbuild-6.1/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The /var/lib/dkms/wireguard/1.0.20210219/6.1.0-13-amd64/x86_64/dkms.conf for module wireguard includes a BUILD_EXCLUSIV
E directive which does not match this kernel/arch/config.
This indicates that it should not be built.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
dkms: autoinstall for kernel: 6.1.0-13-amd64 failed!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
dpkg: error processing package linux-image-6.1.0-13-amd64 (--configure):
installed linux-image-6.1.0-13-amd64 package post-installation script subprocess returned error exit status 1
Setting up linux-headers-6.1.0-13-amd64 (6.1.55-1) ...
/etc/kernel/header_postinst.d/dkms:
dkms: running auto installation service for kernel 6.1.0-13-amd64.
Sign command: /usr/lib/linux-kbuild-6.1/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The /var/lib/dkms/wireguard/1.0.20210219/6.1.0-13-amd64/x86_64/dkms.conf for module wireguard includes a BUILD_EXCLUSIV
E directive which does not match this kernel/arch/config.
This indicates that it should not be built.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
dkms: autoinstall for kernel: 6.1.0-13-amd64 failed!
run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 11
Failed to process /etc/kernel/header_postinst.d at /var/lib/dpkg/info/linux-headers-6.1.0-13-amd64.postinst line 11.
dpkg: error processing package linux-headers-6.1.0-13-amd64 (--configure):
installed linux-headers-6.1.0-13-amd64 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-headers-amd64:
linux-headers-amd64 depends on linux-headers-6.1.0-13-amd64 (= 6.1.55-1); however:
Package linux-headers-6.1.0-13-amd64 is not configured yet.

dpkg: error processing package linux-headers-amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-amd64:
linux-image-amd64 depends on linux-image-6.1.0-13-amd64 (= 6.1.55-1); however:
Package linux-image-6.1.0-13-amd64 is not configured yet.

dpkg: error processing package linux-image-amd64 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-image-6.1.0-13-amd64
linux-headers-6.1.0-13-amd64
linux-headers-amd64
linux-image-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
-----------------------------------------------------------------------
This is also causing other errors while attempting to install or update a package.
It's far more than just the Wireguard thing too as I've already located how to install it into Bookworm.
I've been using Debian for many years but I simply cannot figure this one out.
Any & all help is greatly appreciated.
 


osprey

Well-Known Member
Joined
Apr 15, 2022
Messages
1,381
Reaction score
1,396
Credits
13,314
The issue appears to be with dkms having trouble building the modules because of a mismatch of the versions of the kernel and build tools that are needed.

The building scripts and tools appear to be here: /usr/lib/linux-kbuild-6.1/, but the kernel that dkms probably needs to build them against are the tools associated with: linux-image-6.1.0-13-amd64, not linux-image-6.1.

That mismatch appears to be what the following output is referring to: "E directive which does not match this kernel/arch/config"

I guess if there were no modules for dkms to build when upgrading debian, then the issue may not arise. As a workaround, I guess that it may be possible to upgrade, if such modules were left out during the upgrade and then rebuilt when the system had been successfully set and made consistent again. I've never had quite this issue, so can't say more than guess.
 

Condobloke

Well-Known Member
Joined
Apr 30, 2017
Messages
7,728
Reaction score
6,378
Credits
51,231
G'day TrogloDeb, Welcome to Linux.org

All a bit of a guess at this point. With a little luck this will help narrow it down a touch

Read the whole article, then work your way through the steps. It will do no harm

The step of interest may be fsck....a little way down the page....but, read all of it.

 

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
3,588
Reaction score
1,909
Credits
21,178
This is one of the reason's why I don't perform upgrades.

Performing fresh installations, I've found over the years has resulted in installations that run well.

KGIII's article is a good reference.
 
OP
T

TrogloDeb

New Member
Joined
Dec 8, 2023
Messages
7
Reaction score
2
Credits
89
Osprey & Condobloke, Thanks for the straight-away serious replys. Alexzee, I'm sorry you felt compelled to sheer of another piece of any hope I may have left. But, I will also read your article.
I've always upgraded to the latest OS ver. after waiting several months for the bugs to get worked out. I've also always had some issue or another after doing so. However, with the assist of the kind people in the community, I've also always corrected them & had a wonderful, stable OS for years afterward.
It appears to be the minor cost of using one of the best Linux distros available.
I'll work on all three suggestions, with all due thanks, and get back to you. TBC...
 

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
9,770
Reaction score
8,632
Credits
43,749
@TrogloDeb (I love that), do you speak Swedish?

G'day and welcome to linux.org, from DownUnder :)

I'm only half kidding about the Swedish.

I found this at https://www.sweclockers.com/forum/t...pkg-dependency-problems-prevent-configuration

It's from November, and once I translated it using Google Translate, it is almost identical to your issue.

They did not appear to solve it there, but this is what I would do.

First I would ask

1. Do you have Timeshift installed on the Debian 11? If so, you could just rollback your system. If not, it is something you want to learn about before upgrading in-house, saves a lot of grief afterwards. I can help you there.

2. If your system is actually functioning, albeit not upgraded properly, I would uninstall Wireguard and try again. You can always reinstall it once you have a functioning system.

Cheers

Chris Turner
wizardfromoz

User of Timeshift for over nine (9) years.
 
OP
T

TrogloDeb

New Member
Joined
Dec 8, 2023
Messages
7
Reaction score
2
Credits
89
wizardfromoz, Thanks so much for the effort & assist. It's super early (or late) here in middle America & I've been up for two days. The grey matter is kaput!
I'll look more into it & do some further translation of the surrounding chatter later. As you likely know, it usually takes some time to resolve uncommon issues like this one. Good morning @ 0248hrs here. Hopefully we can chat soon with some successful follow-up. Regards, TrogloDeb
 

Oldhabbits

Active Member
Joined
May 24, 2021
Messages
121
Reaction score
83
Credits
830
Wireguard functionality is included in the kernel since version 5.x, so there is no need anymore to install it as a separate package. Simply uninstall the extra Wireguard package and upgrade again to the latest kernel…
Code:
sudo apt autoremove --purge wireguard
sudo apt full-upgrade
cheers,
Eddy
 
OP
T

TrogloDeb

New Member
Joined
Dec 8, 2023
Messages
7
Reaction score
2
Credits
89
Oldhabits, You are the bomb. The simplest of things almost always seem to be the best.
This did it! I now have a perfectly functioning & fully upgraded Debian 12 system. But, the ONLY thing different was: ALL I had to do was run the 1st command & it took care of ALL of it. There was nothing further that came from running the 2nd command as it was completed/encompassed within the 1st.
Thank you soooooooooooooooooooooooooooooo much for this assist!!!
Everyone - have a Happy Holiday Season & a Very Merry Christmas.
To ALL of you who took time out of your lives to help me, Thanks a bunch & God Bless. :)
 
OP
T

TrogloDeb

New Member
Joined
Dec 8, 2023
Messages
7
Reaction score
2
Credits
89
Now, wizardfromoz, I'm already looking it up. So, on to that Timeshift issue...
 

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
9,770
Reaction score
8,632
Credits
43,749
@Oldhabbits - nice one Eddy ;)

@TrogloDeb - if you are happy that Bookworm is working OK, you can mark this thread as solved, thus, from your first post.

nYSKHvh.png


If you have textual output from the Terminal that you want to share with us (such as in #1), you can put it in Code Tags as follows

dHWsUJl.png



Moving on,
So, on to that Timeshift issue...

Before you install it or use it, you can always ask me about the best configuration for your circumstances at

https://www.linux.org/threads/timeshift-similar-solutions-safeguard-recover-your-linux.15241/page-18

If you do, you can plug in any external drives you may have and give us the output of

Code:
inxi -Fxz

in code tags.

Cheers and

Avagudweegend

Wizard
 
OP
T

TrogloDeb

New Member
Joined
Dec 8, 2023
Messages
7
Reaction score
2
Credits
89
I will post textual output & close the thread tomorrow or Sunday.
Thanks again to everyone for all the help!
 

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
9,770
Reaction score
8,632
Credits
43,749
Just missed you.

Just to be clear - if you post the inxi output, post it at my Timeshift thread, not here.

Glad you got it sorted

Cheers

Wizard
 


Latest posts

Top