Locked out of updates, dpkg

Questions about software.
User avatar
SilverBear
Posts: 21
Joined: 18 Jul 2018 03:35
Location: Allegheny National Forest, Pennsylvania, USA

Locked out of updates, dpkg

Postby SilverBear » 20 Feb 2020 18:40

I'm running stable SolydK 10.
Updates a few days ago left my system in an unusual state. I can't install any more updates through the update manager, and my efforts to track down the problem are failing.
Trying apt-get upgrade results in an error message:

Code: Select all

silverbear@masai7:~$ sudo apt-get upgrade
[sudo] password for silverbear: 
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
Trying to get into Synaptic gets an error message suggesting using dpkg to fix. But:

Code: Select all

silverbear@masai7:~$ sudo dpkg --configure -a
[sudo] password for silverbear: 
Setting up linux-image-4.19.0-8-amd64 (4.19.98-1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.19.0-8-amd64
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries 
    nor crypto modules. If that's on purpose, you may want to uninstall the 
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs 
    integration and avoid this warning.
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found theme: /boot/grub/themes/solydk/theme.txt
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.19.0-8-amd64
Found initrd image: /boot/initrd.img-4.19.0-8-amd64
Found linux image: /boot/vmlinuz-4.19.0-6-amd64
Found initrd image: /boot/initrd.img-4.19.0-6-amd64
^Cdpkg: error processing package linux-image-4.19.0-8-amd64 (--configure):
 installed linux-image-4.19.0-8-amd64 package post-installation script subprocess was interrupted
dpkg: dependency problems prevent configuration of linux-image-amd64:
 linux-image-amd64 depends on linux-image-4.19.0-8-amd64; however:
  Package linux-image-4.19.0-8-amd64 is not configured yet.

dpkg: error processing package linux-image-amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-4.19.0-8-amd64
 linux-image-amd64
Even though I've been using Linux for 15 years, I'm pretty ignorant when it comes to messing with the kernel. I've always just used the stock kernel of whatever distro I'm running. But I took a shot that I might fix a dependency problem with apt-get:

Code: Select all

silverbear@masai7:~$ sudo apt-get install -f
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
I judged that before I destroy everything by messing with the kernel, I'd better just ask for help.

Oh, one other weird effect: I can't shut down via KDE's GUI -- that just ends the desktop session and puts me back at the greeting/gui login. I have to switch to the command line and run telinit 0 to shut down.
"masai7" : Intel i7 3770k; 16GB RAM; GeForce GTX-750 - SolydK 10

User avatar
Arjen Balfoort
Site Admin
Posts: 9418
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Locked out of updates, dpkg

Postby Arjen Balfoort » 20 Feb 2020 21:36

Please, try the following:

Code: Select all

sudo killall apt apt-get
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock*
sudo dpkg --configure -a
sudo apt update
Source: https://askubuntu.com/questions/1109982 ... -temporari


SolydXK needs you!
Development | Testing | Translations

User avatar
SilverBear
Posts: 21
Joined: 18 Jul 2018 03:35
Location: Allegheny National Forest, Pennsylvania, USA

Re: Locked out of updates, dpkg

Postby SilverBear » 20 Feb 2020 22:26

Thanks, Arjen.
Here is a record of the command output:

Code: Select all

silverbear@masai7:~$ sudo killall apt apt-get
[sudo] password for silverbear: 
apt: no process found
silverbear@masai7:~$ sudo rm /var/lib/apt/lists/lock
silverbear@masai7:~$ sudo rm /var/cache/apt/archives/lock
silverbear@masai7:~$ sudo rm /var/lib/dpkg/lock*
silverbear@masai7:~$ sudo dpkg --configure -a
Setting up linux-image-4.19.0-8-amd64 (4.19.98-1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.19.0-8-amd64
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries 
    nor crypto modules. If that's on purpose, you may want to uninstall the 
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs 
    integration and avoid this warning.
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found theme: /boot/grub/themes/solydk/theme.txt
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.19.0-8-amd64
Found initrd image: /boot/initrd.img-4.19.0-8-amd64
Found linux image: /boot/vmlinuz-4.19.0-6-amd64
Found initrd image: /boot/initrd.img-4.19.0-6-amd64

I'm running these in the Konsole terminal emulator. It's just been hanging after that last line of output for 30 minutes.
I assumed a terminal emulator would be OK. Or should I get out of the X-server session to take KDE out of the equation and run those commands again ?
"masai7" : Intel i7 3770k; 16GB RAM; GeForce GTX-750 - SolydK 10

User avatar
Arjen Balfoort
Site Admin
Posts: 9418
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Locked out of updates, dpkg

Postby Arjen Balfoort » 21 Feb 2020 13:11

I see you have two kernels installed.

Do you boot from the newest kernel?
Check with:

Code: Select all

uname -r
If it shows "4.19.0-8-amd64" you could remove the old one (where the process hangs):

Code: Select all

apt purge linux-image-4.19.0-6-amd64
If you succeed, run this again:

Code: Select all

sudo dpkg --configure -a


SolydXK needs you!
Development | Testing | Translations

User avatar
SilverBear
Posts: 21
Joined: 18 Jul 2018 03:35
Location: Allegheny National Forest, Pennsylvania, USA

Re: Locked out of updates, dpkg

Postby SilverBear » 21 Feb 2020 18:10

Yes, I'm running the latest kernel.
apt purge just generates the error message again:

Code: Select all

silverbear@masai7:~$ uname -r
4.19.0-8-amd64
silverbear@masai7:~$ sudo apt purge linux-image-4.19.0-6-amd64
[sudo] password for silverbear: 
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 
silverbear@masai7:~$ sudo dpkg --configure -a
Setting up linux-image-4.19.0-8-amd64 (4.19.98-1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.19.0-8-amd64
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries 
    nor crypto modules. If that's on purpose, you may want to uninstall the 
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs 
    integration and avoid this warning.
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found theme: /boot/grub/themes/solydk/theme.txt
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.19.0-8-amd64
Found initrd image: /boot/initrd.img-4.19.0-8-amd64
Found linux image: /boot/vmlinuz-4.19.0-6-amd64
Found initrd image: /boot/initrd.img-4.19.0-6-amd64
. . . and the command hangs until I ctl-Z it.

I ran the commands you suggested yesterday again after this, but the same result. Apt won't run, and dpkg --configure -a won't complete execution.

I know that the output seems to indicate that it hangs when it :

Code: Select all

Found initrd image: /boot/initrd.img-4.19.0-6-amd64
But that kernel didn't cause any trouble. When I ctl-c the hanging dpkg process [instead of ending it with ctl-z], I get this:

Code: Select all

silverbear@masai7:~$ sudo killall apt apt-get
[sudo] password for silverbear: 
apt: no process found
apt-get: no process found
silverbear@masai7:~$ sudo rm /var/lib/apt/lists/lock
silverbear@masai7:~$ sudo rm /var/cache/apt/archives/lock
rm: cannot remove '/var/cache/apt/archives/lock': No such file or directory
silverbear@masai7:~$ sudo rm /var/lib/dpkg/lock*
silverbear@masai7:~$ sudo dpkg --configure -a
Setting up linux-image-4.19.0-8-amd64 (4.19.98-1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.19.0-8-amd64
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries 
    nor crypto modules. If that's on purpose, you may want to uninstall the 
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs 
    integration and avoid this warning.
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found theme: /boot/grub/themes/solydk/theme.txt
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.19.0-8-amd64
Found initrd image: /boot/initrd.img-4.19.0-8-amd64
Found linux image: /boot/vmlinuz-4.19.0-6-amd64
Found initrd image: /boot/initrd.img-4.19.0-6-amd64
^Cdpkg: error processing package linux-image-4.19.0-8-amd64 (--configure):
 installed linux-image-4.19.0-8-amd64 package post-installation script subprocess was interrupted
dpkg: dependency problems prevent configuration of linux-image-amd64:
 linux-image-amd64 depends on linux-image-4.19.0-8-amd64; however:
  Package linux-image-4.19.0-8-amd64 is not configured yet.

dpkg: error processing package linux-image-amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-4.19.0-8-amd64
 linux-image-amd64
The question is: How do I remove the current .0-8 kernel [ which is apparently configured wrong] without being able to run apt?
"masai7" : Intel i7 3770k; 16GB RAM; GeForce GTX-750 - SolydK 10

User avatar
Arjen Balfoort
Site Admin
Posts: 9418
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Locked out of updates, dpkg

Postby Arjen Balfoort » 21 Feb 2020 18:36

I would boot the old kernel and try to reinstall (or purge and install) those two packages.


SolydXK needs you!
Development | Testing | Translations

User avatar
SilverBear
Posts: 21
Joined: 18 Jul 2018 03:35
Location: Allegheny National Forest, Pennsylvania, USA

Re: Locked out of updates, dpkg

Postby SilverBear » 21 Feb 2020 21:56

Arjen Balfoort wrote:
21 Feb 2020 18:36
I would boot the old kernel and try to reinstall (or purge and install) those two packages.
Sounds logical. Booting the 4.19.0-6 kernel and running the prelim commands, I can get apt to work, but we still hang :

Code: Select all

silverbear@masai7:~$ sudo killall apt apt-get
[sudo] password for silverbear: 
apt: no process found
apt-get: no process found
silverbear@masai7:~$ sudo rm /var/lib/apt/lists/lock
silverbear@masai7:~$ sudo rm /var/cache/apt/archives/lock
rm: cannot remove '/var/cache/apt/archives/lock': No such file or directory
silverbear@masai7:~$ sudo rm /var/lib/dpkg/lock*
silverbear@masai7:~$ sudo apt purge linux-image-4.19.0-8-amd64 linux-image-amd64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-image-4.19.0-8-amd64* linux-image-amd64*
0 upgraded, 0 newly installed, 2 to remove and 13 not upgraded.
2 not fully installed or removed.
After this operation, 269 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 281893 files and directories currently installed.)
Removing linux-image-amd64 (4.19+105+deb10u3) ...
Removing linux-image-4.19.0-8-amd64 (4.19.98-1) ...
/etc/kernel/prerm.d/dkms:
dkms: removing: nvidia-current 418.74 (4.19.0-8-amd64) (x86_64)

-------- Uninstall Beginning --------
Module:  nvidia-current
Version: 418.74
Kernel:  4.19.0-8-amd64 (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

nvidia-current.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.19.0-8-amd64/updates/dkms/
rmdir: failed to remove 'updates/dkms': Directory not empty
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


nvidia-current-modeset.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.19.0-8-amd64/updates/dkms/
rmdir: failed to remove 'updates/dkms': Directory not empty
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


nvidia-current-drm.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.19.0-8-amd64/updates/dkms/
rmdir: failed to remove 'updates/dkms': Directory not empty
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


nvidia-current-uvm.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.19.0-8-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod...

DKMS: uninstall completed.
I: /vmlinuz is now a symlink to boot/vmlinuz-4.19.0-6-amd64
I: /initrd.img is now a symlink to boot/initrd.img-4.19.0-6-amd64
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.19.0-8-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found theme: /boot/grub/themes/solydk/theme.txt
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.19.0-6-amd64
Found initrd image: /boot/initrd.img-4.19.0-6-amd64
One would assume that 40 minutes later it should have finished, but it is still sitting in Konsole as shown above. :facepalm:
"masai7" : Intel i7 3770k; 16GB RAM; GeForce GTX-750 - SolydK 10

User avatar
Arjen Balfoort
Site Admin
Posts: 9418
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Locked out of updates, dpkg

Postby Arjen Balfoort » 22 Feb 2020 10:16

I am afraid I am almost out of ideas.

Can you reinstall linux-image-4.19.0-8-amd64 and linux-image-amd64?

Also, check if there are any clues in /var/log/dpkg.log


SolydXK needs you!
Development | Testing | Translations

User avatar
SilverBear
Posts: 21
Joined: 18 Jul 2018 03:35
Location: Allegheny National Forest, Pennsylvania, USA

Re: Locked out of updates, dpkg

Postby SilverBear » 22 Feb 2020 20:51

Thanks again, Arjen.
I may not have time to play with it today, but Ill try in the evening or tomorrow morning.
"masai7" : Intel i7 3770k; 16GB RAM; GeForce GTX-750 - SolydK 10

User avatar
SilverBear
Posts: 21
Joined: 18 Jul 2018 03:35
Location: Allegheny National Forest, Pennsylvania, USA

Re: Locked out of updates, dpkg

Postby SilverBear » 23 Feb 2020 06:13

Tried reinstalling the 4.19.0-8 kernel without success.

Code: Select all

silverbear@masai7:~$ sudo killall apt apt-get
[sudo] password for silverbear: 
apt: no process found
apt-get: no process found
silverbear@masai7:~$ sudo rm /var/lib/apt/lists/lock
silverbear@masai7:~$ sudo rm /var/cache/apt/archives/lock
silverbear@masai7:~$ sudo rm /var/lib/dpkg/lock*
silverbear@masai7:~$ sudo dpkg --configure -a
silverbear@masai7:~$ sudo apt install linux-image-4.19.0-8-amd64 linux-image-amd64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-image-4.19.0-8-amd64 is already the newest version (4.19.98-1).
The following NEW packages will be installed:
  linux-image-amd64
0 upgraded, 1 newly installed, 0 to remove and 15 not upgraded.
1 not fully installed or removed.
Need to get 0 B/48.1 MB of archives.
After this operation, 17.4 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Selecting previously unselected package linux-image-amd64.
(Reading database ... 277486 files and directories currently installed.)
Preparing to unpack .../linux-image-amd64_4.19+105+deb10u3_amd64.deb ...
Unpacking linux-image-amd64 (4.19+105+deb10u3) ...
dpkg: dependency problems prevent configuration of linux-image-amd64:
 linux-image-amd64 depends on linux-image-4.19.0-8-amd64; however:
  Package linux-image-4.19.0-8-amd64 is not installed.

dpkg: error processing package linux-image-amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
Thinking that I might be given filenames for the "dependency problems" if I tried Synaptic, I tried installing/reinstalling the two packages in question. It failed, with the following error message:

Code: Select all

E: Internal Error, No file name for linux-image-amd64:amd64
Maybe I'm getting senile faster than I thought, but that simply doesn't make any rational sense to me. How can it tell me that there is no file name for [filename]? It's like someone saying, "Hey, John Boice, what is your first and last names?" [trivia: "Boice" is an Americanized version of the originally Dutch name "Buis." But the family has been over here since the 1600's, so I have no idea what part of Nederland we were originally living.]

I tried refreshing the package lists, in case they were faulty on my system. I think I'm going to have to admit defeat on this one. :oops:
Thank you for trying to help me figure it out!
"masai7" : Intel i7 3770k; 16GB RAM; GeForce GTX-750 - SolydK 10

User avatar
Arjen Balfoort
Site Admin
Posts: 9418
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Locked out of updates, dpkg

Postby Arjen Balfoort » 23 Feb 2020 10:10

If you are up for a little experiment:

Code: Select all

apt-get download linux-image-4.19.0-8-amd64
sudo dpkg -i --force-overwrite linux-image-4.19.0-8-amd64*.deb
if force-overwrite does not work, try:

Code: Select all

sudo dpkg -i --force-all linux-image-4.19.0-8-amd64*.deb
Fun trivia! Also, John would be Jan here. So, your name is: Jan Buis.


SolydXK needs you!
Development | Testing | Translations


Return to “Software”

Who is online

Users browsing this forum: No registered users and 1 guest