Linux Lite Forums

Software - Support => Other => Topic started by: m654321 on October 21, 2016, 06:46:37 AM

Title: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: m654321 on October 21, 2016, 06:46:37 AM
Synaptic Package Manager wouldn't open fully in LL3.0 today, but came up with message to run this command: sudo dpkg --configure -a.
I assume this happened because a process was abruptly terminated in a previous session, before it had reached completion.
I got the following output when I ran the command mentioned, but it seems to hang indefinitely (more than an hour) on the last line of code... 
Code: [Select]
mike@mike-G750JS:~$ sudo dpkg --configure -a
[sudo] password for mike:
Setting up linux-image-4.4.0-42-generic (4.4.0-42.62) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.4.0-42-generic
vmlinuz(/boot/vmlinuz-4.4.0-42-generic
) points to /boot/vmlinuz-4.4.0-42-generic
 (/boot/vmlinuz-4.4.0-42-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.4.0-42-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-42-generic /boot/vmlinuz-4.4.0-42-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-42-generic /boot/vmlinuz-4.4.0-42-generic
                                       
As always, any help is much appreciated.

Mike
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: Jocklad on October 21, 2016, 06:53:34 AM
Had same problem this morning.

Had to use sudo dpkg --configure -aa

Found it in one of Goldfingers threads.....worked fine.

Jocklad

OOps my mistake it is sudo dpkg --configure -a  :-[ :-[
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: torreydale on October 21, 2016, 08:39:25 AM
m654321,

I've researched this some, and others online actually provided more information to be able to nail down the problem.  But a common denominator seems to be some things that Lite Tweaks may be able to help.  Open Lite Tweaks, and run the Safe option Autoremove Packages, but also use the Kernel Removal option to remove old kernels.  Run "sudo update-grub", and then try the "sudo dpkg --configure -a" command again.  Post your output afterwards.
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: m654321 on October 21, 2016, 09:07:34 AM
Had same problem this morning.
Had to use sudo dpkg --configure -aa
Found it in one of Goldfingers threads.....worked fine.
Jocklad
OOps my mistake it is sudo dpkg --configure -a  :-[ :-[
But that's the point I was making in my post: I used "sudo dpkg --configure -a" & it didn't work ...
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: m654321 on October 21, 2016, 09:14:52 AM
m654321,

I've researched this some, and others online actually provided more information to be able to nail down the problem.  But a common denominator seems to be some things that Lite Tweaks may be able to help.  Open Lite Tweaks, and run the Safe option Autoremove Packages, but also use the Kernel Removal option to remove old kernels.  Run "sudo update-grub", and then try the "sudo dpkg --configure -a" command again.  Post your output afterwards.
I did what you suggested, ticking on the kernels listed but cleaning failed
Mike
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: torreydale on October 21, 2016, 09:26:46 AM
Quote
I did what you suggested, ticking on the kernels listed but cleaning failed
Mike

Then follow the procedure seen here:  http://kevinjmorse.ca/articles/gzip-stdout-no-space-left-device-when-doing-apt-get-f-install
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: Jocklad on October 21, 2016, 10:10:45 AM
Had same problem this morning.
Had to use sudo dpkg --configure -aa
Found it in one of Goldfingers threads.....worked fine.
Jocklad
OOps my mistake it is sudo dpkg --configure -a  :-[ :-[
But that's the point I was making in my post: I used "sudo dpkg --configure -a" & it didn't work ...
It did work for me but I did do a system cleanup before trying it.

Hopefully Torreydales link will fix you up.
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: m654321 on October 24, 2016, 04:51:06 AM
Quote
I did what you suggested, ticking on the kernels listed but cleaning failed
Mike

Then follow the procedure seen here:  http://kevinjmorse.ca/articles/gzip-stdout-no-space-left-device-when-doing-apt-get-f-install (http://kevinjmorse.ca/articles/gzip-stdout-no-space-left-device-when-doing-apt-get-f-install)
Hi torreydale,

Thanks for your efforts to help.  I used the link you gave me to get rid of the unwanted kernels that seem to be lying around, though it didn't work - details on that in a minute.

In the terminal, uname -a revealed that I have kernel version 4.4.0-38-generic installed.  Lite Tweaks reveals I have 4.4.0-22-generic and 4.4.0-42-generic are lying around inside the system: the former was from the time of LL3.0 installation, and I think the latter appears to be the most recent one I was trying to update to, but it appears that this didn't complete and probable gave rise to the request from Terminal to run sudo dpkg --configure -a

I ran the command in the link you gave me (to remove one of the kernels) - unsuccessful - this was the output:
Code: [Select]
mike@mike-G750JS:~$ sudo dpkg --remove linux-image-extra-4.4.0-42-generic
[sudo] password for mike:
dpkg: dependency problems prevent removal of linux-image-extra-4.4.0-42-generic:
 linux-image-generic depends on linux-image-extra-4.4.0-42-generic; however:
  Package linux-image-extra-4.4.0-42-generic is to be removed.

dpkg: error processing package linux-image-extra-4.4.0-42-generic (--remove):
 dependency problems - not removing
Errors were encountered while processing:
 linux-image-extra-4.4.0-42-generic
mike@mike-G750JS:~$

I'd be grateful if anyone could help me with this ...

Cheers
Mike
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: torreydale on October 24, 2016, 06:38:34 AM
Open a terminal and try this first:
Code: [Select]
sudo apt-get install linux-genericReboot.


If that doesn't help, open a terminal and do the following:
Code: [Select]
sudo apt-get install linux-headers-linuxlite-4.4.0 linux-image-linuxlite-4.4.0 -yReboot while holding the keft Shift key.  When the GRUB menu appears, use the advanced option to select the new kernel.   When you get to your desktop, you can use Lite Tweaks to remove any residual kernels.
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: m654321 on October 24, 2016, 12:35:24 PM
Open a terminal and try this first:
Code: [Select]
sudo apt-get install linux-genericReboot.

If that doesn't help, open a terminal and do the following:
Code: [Select]
sudo apt-get install linux-headers-linuxlite-4.4.0 linux-image-linuxlite-4.4.0 -yReboot while holding the keft Shift key.  When the GRUB menu appears, use the advanced option to select the new kernel.   When you get to your desktop, you can use Lite Tweaks to remove any residual kernels.
Thanks, but it didn't work - just stuck in an eternal  "sudo dpkg --configure -a loop", i.e:

Terminal output from 1st option you suggested...
Code: [Select]
mike@mike-G750JS:~$ sudo apt-get install linux-generic
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
mike@mike-G750JS:~$

Terminal output from the 2nd option you suggested...
Code: [Select]
mike@mike-G750JS:~$ sudo apt-get install linux-headers-linuxlite-4.4.0 linux-image-linuxlite-4.4.0 -y
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
mike@mike-G750JS:~$

Thanks for trying torreydale - anyone else got any ideas?  I'm getting close to the end of my tether with this one... >:(


Mike


Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: Jerry on October 24, 2016, 12:47:12 PM
What does : sudo apt-get install -f produce?

Sent from my Nexus 6 using Tapatalk

Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: m654321 on October 25, 2016, 03:17:56 PM
What does : sudo apt-get install -f produce?
Sent from my Nexus 6 using Tapatalk
Still stuck...
Code: [Select]
mike@mike-G750JS:~$ sudo apt-get install -f
[sudo] password for mike:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
mike@mike-G750JS:~$
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: torreydale on October 25, 2016, 03:40:19 PM
If you have a Systemback restore point, use it.  Otherwise reinstall the operating system.
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: firenice03 on October 25, 2016, 07:21:39 PM
Might be worth a final try... Open Synaptic and click reload; once completed close then try in a terminal the
Code: [Select]
sudo dpkg --configure -aSounds like a package didn't completely install???

OR might be worth to look at
https://ubuntuforums.org/showthread.php?t=843690

If not then maybe as torreydale suggests.. (Systemback backups are life savers lol)
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: Jerry on October 26, 2016, 05:08:28 AM
Try:

Code: [Select]
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get update

then:

Code: [Select]
sudo dpkg --remove --force-remove-reinstreq 4.4.0-42-generic
Code: [Select]
sudo apt-get dist-upgrade
Reboot.

If any of the above commands don't complete, continue to the next command regardless.
Title: 'sudo dpkg --configure -a' not unblocking synaptic, install updates & lite tweak
Post by: m654321 on October 29, 2016, 12:31:53 AM
Try:

Code: [Select]
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get update

then:

Code: [Select]
sudo dpkg --remove --force-remove-reinstreq 4.4.0-42-generic
Code: [Select]
sudo apt-get dist-upgrade
Reboot.

If any of the above commands don't complete, continue to the next command regardless.
Many thanks Jerry, and many thanks for your message re. Teamviewer but unfortunately I missed this as was away from PC.

I tried what you suggested above to the letter, but it failed, as the previous advice given by firenice, torreydale & jocklad. So rather than waste any more time on this I merely reinstalled LL3.0, using the existing '/home' partition as part of the refreshed setup - only took me an hour max - quicker than trying to find any other solution. Problem sorted. I think the problem may have originally arisen from me forgetting to use 'sudo update-grub' following a kernel update - maybe this explains why I had two older unused kernels still around within the system - just guessing here.

Worth noting (new observation for me), that though '/home' did preserve the browser bookmarks for firefox, slimjet & qupzilla browsers, I did need to reinstall the software that didn't come preinstalled with the fresh install of LL3.0, e.g. slimjet, qupzilla, clementine & others. Also the configuration files in '/home' did not appear to preserve the symlinks between the OS-drive and the data-storage-drive on my PC (setup1 in sig) - the symlinks for the folders Documents, Downloads, etc were shown as 'whited-out' folders with 'double arrows'. I deleted these in '/home' and simply reinstalled them - didn't take long.

Many thanks Jerry & all the team for your continued support & the great job you do generally.
Much appreciated

Regards
Mike
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: m654321 on November 30, 2016, 08:25:45 AM
It's happened again!!! All the advice above in this thread didn't work as before.
It seems to be a weakness of LL on setup(1) in sig, though I'm now just running LL3.2 as a single OS on its own.
Locked out of synaptic, light tweaks (kernel removal & autoremove) & install updates... >:(

Ran sudo dpkg --configure -a, and this is what I got as before (except the kernel involved is a later version than before):
Code: [Select]
mike@mike-G750JS:~$ sudo dpkg --configure -a
[sudo] password for mike:
Setting up linux-headers-4.4.0-51-generic (4.4.0-51.72) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic

Stuck on the last line - how long should I wait if it's going to do anything at all? How patient should I be?!

When I try to open Synaptic I get this error message as before & can't go further with this notification appearing:
Code: [Select]
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
E: _cache->open() failed, please report.

I run sudo dpkg --configure -a numerous times, but to no avail, as before

uname -a gives the following:
Code: [Select]
mike@mike-G750JS:~$ uname -a
Linux mike-G750JS 4.4.0-47-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

...so I tried to use Lite Tweaks/Kernel Removal, to removal kernel 4.4.0-51 which is listed there but I get this message when I attempt a clean:
Code: [Select]
Kernel Cleaner has failed
I'm wasting a lot of time on this - I'd be really grateful if anyone could help, even if we have to go down the 'Teamviewer' route though that will take a bit of organisation given time zones & people's busy lives. I'm pretty much at my wits end with this problem as it's wasting so much time which I haven't got. I 'solved' the problem the first time by doing a clean-install of LL but I can't keep doing this...

The cause of the problem was likely to be my fault - I may have inadvertently interrupted 'Install Updates' (which in turn interrupted the kernel update) when I turned off my PC.  I think there needs to be some visible sign that updates are being installed rather than it disappearing off screen into the background only reappearing with a notification when it's completed...

Sorry to be a pain again, with this.
Mike
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: firenice03 on November 30, 2016, 09:11:05 AM
I can maybe give a couple ideas to try in the meanwhile... ??  ??? ???

Rebooting and choosing LL Advanced options should give the option to choose which kernel to boot with; perhaps a previous would be listed then allowing you to remove the latest...

Or if you have a systemback back up revert to the most recent prior to the cancelled update...

Hope you get it straightened out..
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: trinidad on November 30, 2016, 09:50:32 AM
My guess is your old home partition is preserving kernel info for kernels that do not actually exist. Update grub will just keep adding them in. You'll need to use root to fix this which is risky, so this could be bad advice. Open a terminal and type sudo passwd root. Enter a new nix password twice and exit the terminal. Logout and reboot. Select other from lightdm login and type root, and enter the root password you set up. You will boot into root. You'll get an ioctl error which you can just ignore, x out the message, and root will load the xfce desktop. Clean out the kernel info from home there. To get rid of the root login afterwards open a terminal and type sudo passwd -dl root. Warning -- could be ugly. Don't go this route if you're not sure of what you're doing.

TC
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: m654321 on November 30, 2016, 11:30:45 AM
My guess is your old home partition is preserving kernel info for kernels that do not actually exist. Update grub will just keep adding them in. You'll need to use root to fix this which is risky, so this could be bad advice. Open a terminal and type sudo passwd root. Enter a new nix password twice and exit the terminal. Logout and reboot. Select other from lightdm login and type root, and enter the root password you set up. You will boot into root. You'll get an ioctl error which you can just ignore, x out the message, and root will load the xfce desktop. Clean out the kernel info from home there. To get rid of the root login afterwards open a terminal and type sudo passwd -dl root. Warning -- could be ugly. Don't go this route if you're not sure of what you're doing.

TC

Thanks TC & firnice03 for the advice.

Time's a bit short, so I went for the 'easier option' to reinstall LL3.2 (though not a total clean-install like last time) rather than faff around any more 'in the dark' doing things that might not work or just get me in piled-high-and-deep! With this reinstall, I preserved the '/home' instead of overwriting it as I wanted to keep as many of my settings as possible & not have to reinstall these.  And it's worked: thankfully the configuration files in '/home' didn't carry over the 'mess' into the new installation !  I just had to revisit "Install Updates", "Lite Software" & one or two things from "Synaptic".  I did have to reset my symlinks, though that only took around 5-10 minutes.  I had to reinstall Virtualbox, though all my VMs were automatically reloaded and links preserved to my DATA partition.

Thanks guys for your continued interest & offers of help - much appreciated

Mike

PS. @firenice03: I'd already tried advanced options but "the computer said no"  - it just got stuck at the kernel I selected
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: m654321 on December 09, 2016, 07:18:39 AM
It's happened again - seems to be a recurrent problem!!! 

Should I return to Windows OS as my main operating system?  Despite some of its  shortcomings, I have to say I never seemed to have any difficulties with Windows XP, 7 or 8.1 - it just worked, provided it was set up securely which I was always careful to do.  I know Windows OS has privacy/security issues but, to circumvent that, I have always kept my financial stuff on a pendrive rather than on an HDD and always view it offline. Windows OS attractiveness is its ease of operation & maintenance (e.g. I can install an Epson scanner in a straightforward fashion) for folk like me who are not computer specialists.  You need very little computing knowledge beyond the basics of how a computer works (if that) to run Windows OS - that's not the case with Linux.  Though LL is a superb operating system, and I always recommend it as the no.1 OS for anyone, beginners or expert, a lot of time and effort is still needed when things go wrong, even slightly wrong, especially if, like me, you feel you're not a Linux expert...

Returning to Windows is not an option I want to entertain as I've invested a lot of time in Linux generally (since April 2014), including donating to LL's very worthy cause. I've always said that LL has a great development team and folk are really helpful or certainly try to do their very best for everyone, but sometimes when I have difficulties to resolve (e.g the present one, installing an Epson Scanner, etc) they seem to take forever to fix, or no-one in the forum is quite sure how to fix it, which I think demonstrates the vastness & complexity of Linux generally, and particularly to eternal Linux newbies such as myself. Though I have bought books on Linux (I thoroughly recommend 'Ubuntu Linux Toolbox' by Christopher Negus, the most useful reference book I've seen) and have learnt a huge amount from this forum, I don't think I'll ever master Linux fully as it seems so vast...

Well, that's enough of me having a rant...  how do I fix this sudo dpkg --configure -a issue which has reared its ugly head again? 
I didn't try your idea TC in #18 - it sounded too speculative and by your own admission pretty risky... 

My apologies if I'm sounding a bit downbeat today...

Regards
Mike
Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: firenice03 on December 09, 2016, 09:01:24 AM
Perhaps the reoccurring problem has another underlying issues??
Have you created any systemback ups?
If so revert back...
If not, get in the habit :) I will try a minimum for monthly or every other... If I'm "trying" to fix, set up a new I will make a backup prior to entering the 1st line of code then once again after whatever is running. I'm not a Linux guru by no means but a good back will fix any mistake.

For the reoccurring problem... When does it seem to appear? It appears during updates, but is this the 1st update since the last reinstall? Or what system changes since the last successful update? Maybe an underlying hardware problem, which maybe the case if its the same 1 system out of 4.. Possibly in the way 3.x is designed as compared to the 2.x series.?.?.

I have gotten the same message once before (don't recall which series) but running the command resolved it - I know it was due to cancelling/stopping updates midstream - try to avoid this, until you have the "completed" window.

Has it "broke" when attempting the kernel update? Similar to the 1st post?
May help to post the following:
Output where the error lies:
Output of
Code: [Select]
uname -a
Keep your head up  ;)

Title: Re: sudo dpkg --configure -a not resolving blocking of synaptic & updating
Post by: m654321 on December 13, 2016, 12:18:21 PM
Many thanks firenice03 - just to acknowledge your reply - am busy with work at the moment but will post again here later when less busy...

Cheers
Mike