Recovering from dpkg crash

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I had a bad crash (power outage while running apt upgrade) that left my system (a VirtualBox VM running Linux Mint.19, actually; host is an up-to-date Debian Sid, if it matters) in a very strange state:



System is apparently working properly (beside the apt/dpkg suite)



I had to reset apt:



mcon@mint:~$ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-headers-generic (= 4.15.0.39.41); however:
Version of linux-headers-generic on system is 4.15.0.38.40.

dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-generic
mcon@mint:~$


After this I tried to restart apt:



mcon@mint:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
linux-generic : Depends: linux-headers-generic (= 4.15.0.39.41) but 4.15.0.38.40 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
mcon@mint:~$


This is expected, but the command (actually sudo apt install --fix-broken, the command as printed is invalid) enters an infinite loop and blocks forever (with constant disk activity!):



mcon@mint:~$ sudo apt install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
linux-headers-4.15.0-39 linux-headers-4.15.0-39-generic
linux-headers-generic
The following NEW packages will be installed:
linux-headers-4.15.0-39-generic
The following packages will be upgraded:
linux-headers-4.15.0-39 linux-headers-generic
2 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
Need to get 0 B/12,1 MB of archives.
After this operation, 89,9 MB of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 283441 files and directories currently installed.)
Preparing to unpack .../linux-headers-4.15.0-39_4.15.0-39.42_all.deb ...
Unpacking linux-headers-4.15.0-39 (4.15.0-39.42) over (4.15.0-39.42) ...

Progress: [ 5%] [###.......................................................]


... forcing me to kill the process and restart from beginning.



I tried forcing package removal with sudo dpkg --remove --force-remove-reinstreq linux-headers-4.15.0-39, but that didn't change anything.



One thing that might be relevant: starting sudo aptitude I get an infinite loop of the following error message:



E: Can't find a source to download version '4.15.0-39.42' of 'linux-headers-4.15.0-39:amd64'


I did not find "strange" errors in the relevant logs.



What can I do to recover dpkg from the present (very confused) state?



Update:
I'm currently trying to (force) uninstall "culprit" package (linux-headers-generic) in order to reinstall it later.










share|improve this question



















  • 1




    Sid, with linux-headers-4.15.0-39-generic? That’s a Ubuntu package... And your prompt suggests it’s really Linux Mint.
    – Stephen Kitt
    yesterday











  • @StephenKitt: Sorry. My bad. Host is Debian Sid, guest is Linux Mint.19. I will update the question.
    – ZioByte
    yesterday














up vote
0
down vote

favorite












I had a bad crash (power outage while running apt upgrade) that left my system (a VirtualBox VM running Linux Mint.19, actually; host is an up-to-date Debian Sid, if it matters) in a very strange state:



System is apparently working properly (beside the apt/dpkg suite)



I had to reset apt:



mcon@mint:~$ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-headers-generic (= 4.15.0.39.41); however:
Version of linux-headers-generic on system is 4.15.0.38.40.

dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-generic
mcon@mint:~$


After this I tried to restart apt:



mcon@mint:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
linux-generic : Depends: linux-headers-generic (= 4.15.0.39.41) but 4.15.0.38.40 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
mcon@mint:~$


This is expected, but the command (actually sudo apt install --fix-broken, the command as printed is invalid) enters an infinite loop and blocks forever (with constant disk activity!):



mcon@mint:~$ sudo apt install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
linux-headers-4.15.0-39 linux-headers-4.15.0-39-generic
linux-headers-generic
The following NEW packages will be installed:
linux-headers-4.15.0-39-generic
The following packages will be upgraded:
linux-headers-4.15.0-39 linux-headers-generic
2 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
Need to get 0 B/12,1 MB of archives.
After this operation, 89,9 MB of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 283441 files and directories currently installed.)
Preparing to unpack .../linux-headers-4.15.0-39_4.15.0-39.42_all.deb ...
Unpacking linux-headers-4.15.0-39 (4.15.0-39.42) over (4.15.0-39.42) ...

Progress: [ 5%] [###.......................................................]


... forcing me to kill the process and restart from beginning.



I tried forcing package removal with sudo dpkg --remove --force-remove-reinstreq linux-headers-4.15.0-39, but that didn't change anything.



One thing that might be relevant: starting sudo aptitude I get an infinite loop of the following error message:



E: Can't find a source to download version '4.15.0-39.42' of 'linux-headers-4.15.0-39:amd64'


I did not find "strange" errors in the relevant logs.



What can I do to recover dpkg from the present (very confused) state?



Update:
I'm currently trying to (force) uninstall "culprit" package (linux-headers-generic) in order to reinstall it later.










share|improve this question



















  • 1




    Sid, with linux-headers-4.15.0-39-generic? That’s a Ubuntu package... And your prompt suggests it’s really Linux Mint.
    – Stephen Kitt
    yesterday











  • @StephenKitt: Sorry. My bad. Host is Debian Sid, guest is Linux Mint.19. I will update the question.
    – ZioByte
    yesterday












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I had a bad crash (power outage while running apt upgrade) that left my system (a VirtualBox VM running Linux Mint.19, actually; host is an up-to-date Debian Sid, if it matters) in a very strange state:



System is apparently working properly (beside the apt/dpkg suite)



I had to reset apt:



mcon@mint:~$ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-headers-generic (= 4.15.0.39.41); however:
Version of linux-headers-generic on system is 4.15.0.38.40.

dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-generic
mcon@mint:~$


After this I tried to restart apt:



mcon@mint:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
linux-generic : Depends: linux-headers-generic (= 4.15.0.39.41) but 4.15.0.38.40 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
mcon@mint:~$


This is expected, but the command (actually sudo apt install --fix-broken, the command as printed is invalid) enters an infinite loop and blocks forever (with constant disk activity!):



mcon@mint:~$ sudo apt install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
linux-headers-4.15.0-39 linux-headers-4.15.0-39-generic
linux-headers-generic
The following NEW packages will be installed:
linux-headers-4.15.0-39-generic
The following packages will be upgraded:
linux-headers-4.15.0-39 linux-headers-generic
2 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
Need to get 0 B/12,1 MB of archives.
After this operation, 89,9 MB of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 283441 files and directories currently installed.)
Preparing to unpack .../linux-headers-4.15.0-39_4.15.0-39.42_all.deb ...
Unpacking linux-headers-4.15.0-39 (4.15.0-39.42) over (4.15.0-39.42) ...

Progress: [ 5%] [###.......................................................]


... forcing me to kill the process and restart from beginning.



I tried forcing package removal with sudo dpkg --remove --force-remove-reinstreq linux-headers-4.15.0-39, but that didn't change anything.



One thing that might be relevant: starting sudo aptitude I get an infinite loop of the following error message:



E: Can't find a source to download version '4.15.0-39.42' of 'linux-headers-4.15.0-39:amd64'


I did not find "strange" errors in the relevant logs.



What can I do to recover dpkg from the present (very confused) state?



Update:
I'm currently trying to (force) uninstall "culprit" package (linux-headers-generic) in order to reinstall it later.










share|improve this question















I had a bad crash (power outage while running apt upgrade) that left my system (a VirtualBox VM running Linux Mint.19, actually; host is an up-to-date Debian Sid, if it matters) in a very strange state:



System is apparently working properly (beside the apt/dpkg suite)



I had to reset apt:



mcon@mint:~$ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-headers-generic (= 4.15.0.39.41); however:
Version of linux-headers-generic on system is 4.15.0.38.40.

dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-generic
mcon@mint:~$


After this I tried to restart apt:



mcon@mint:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
linux-generic : Depends: linux-headers-generic (= 4.15.0.39.41) but 4.15.0.38.40 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
mcon@mint:~$


This is expected, but the command (actually sudo apt install --fix-broken, the command as printed is invalid) enters an infinite loop and blocks forever (with constant disk activity!):



mcon@mint:~$ sudo apt install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
linux-headers-4.15.0-39 linux-headers-4.15.0-39-generic
linux-headers-generic
The following NEW packages will be installed:
linux-headers-4.15.0-39-generic
The following packages will be upgraded:
linux-headers-4.15.0-39 linux-headers-generic
2 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
Need to get 0 B/12,1 MB of archives.
After this operation, 89,9 MB of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 283441 files and directories currently installed.)
Preparing to unpack .../linux-headers-4.15.0-39_4.15.0-39.42_all.deb ...
Unpacking linux-headers-4.15.0-39 (4.15.0-39.42) over (4.15.0-39.42) ...

Progress: [ 5%] [###.......................................................]


... forcing me to kill the process and restart from beginning.



I tried forcing package removal with sudo dpkg --remove --force-remove-reinstreq linux-headers-4.15.0-39, but that didn't change anything.



One thing that might be relevant: starting sudo aptitude I get an infinite loop of the following error message:



E: Can't find a source to download version '4.15.0-39.42' of 'linux-headers-4.15.0-39:amd64'


I did not find "strange" errors in the relevant logs.



What can I do to recover dpkg from the present (very confused) state?



Update:
I'm currently trying to (force) uninstall "culprit" package (linux-headers-generic) in order to reinstall it later.







debian apt dpkg






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday

























asked yesterday









ZioByte

193110




193110







  • 1




    Sid, with linux-headers-4.15.0-39-generic? That’s a Ubuntu package... And your prompt suggests it’s really Linux Mint.
    – Stephen Kitt
    yesterday











  • @StephenKitt: Sorry. My bad. Host is Debian Sid, guest is Linux Mint.19. I will update the question.
    – ZioByte
    yesterday












  • 1




    Sid, with linux-headers-4.15.0-39-generic? That’s a Ubuntu package... And your prompt suggests it’s really Linux Mint.
    – Stephen Kitt
    yesterday











  • @StephenKitt: Sorry. My bad. Host is Debian Sid, guest is Linux Mint.19. I will update the question.
    – ZioByte
    yesterday







1




1




Sid, with linux-headers-4.15.0-39-generic? That’s a Ubuntu package... And your prompt suggests it’s really Linux Mint.
– Stephen Kitt
yesterday





Sid, with linux-headers-4.15.0-39-generic? That’s a Ubuntu package... And your prompt suggests it’s really Linux Mint.
– Stephen Kitt
yesterday













@StephenKitt: Sorry. My bad. Host is Debian Sid, guest is Linux Mint.19. I will update the question.
– ZioByte
yesterday




@StephenKitt: Sorry. My bad. Host is Debian Sid, guest is Linux Mint.19. I will update the question.
– ZioByte
yesterday















active

oldest

votes











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481747%2frecovering-from-dpkg-crash%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481747%2frecovering-from-dpkg-crash%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay