DPKG is not working

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
DonW4
Level 1
Level 1
Posts: 2
Joined: Tue Jun 28, 2022 6:28 am

DPKG is not working

Post by DonW4 »

Hi, during a recent update the computer was accidentally turned off. Since then i have been getting an error about having to reconfigure DPKG. Instead I used Timeshift to go back before this error occurred and unfortunately have just made things worse. The following is a print of the error message I now get and an extract from the system info printout for my computer. How do I fix this??

Code: Select all

E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 1928 (apt-get)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
E: _cache->open() failed, please report.

Code: Select all

System:    Kernel: 5.4.0-117-generic x86_64 bits: 64 compiler: gcc v: 9.4.0 
           Desktop: Cinnamon 5.2.7 wm: muffin dm: LightDM Distro: Linux Mint 20.3 Una 
           base: Ubuntu 20.04 focal 
Machine:   Type: Laptop System: LENOVO product: 81MT v: Lenovo V145-15AST serial: <filter> 
           Chassis: type: 10 v: Lenovo V145-15AST serial: <filter> 
           Mobo: LENOVO model: LNVNB161216 v: No DPK serial: <filter> UEFI [Legacy]: LENOVO 
           v: 8ZCN23WW(V2.02) date: 05/09/2019 
Battery:   ID-1: BAT1 charge: 19.5 Wh condition: 24.8/30.0 Wh (83%) volts: 8.4/7.5 
           model: LENOVO PABAS0241231 serial: <filter> status: Charging 
CPU:       Topology: Dual Core model: AMD A6-9225 RADEON R4 5 COMPUTE CORES 2C+3G bits: 64 
           type: MCP arch: Excavator L2 cache: 1024 KiB
Last edited by LockBot on Sun Jan 01, 2023 11:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: DPKG is not working

Post by Cosmo. »

You have possibly damaged your file system. Try this (not sure, if this helps): Enter in a terminal

Code: Select all

sudo touch /forcefsck
and reboot. Be prepared, that the system will need more time than usual for booting.
User avatar
MiZoG
Level 8
Level 8
Posts: 2381
Joined: Fri Jan 26, 2018 8:30 pm
Location: Athens, Greece

Re: DPKG is not working

Post by MiZoG »

Try in terminal

Code: Select all

sudo kill 1928
followed by

Code: Select all

sudo dpkg --configure -a
and finally

Code: Select all

sudo apt update && sudo apt upgrade
If problem persists, come back with yr error messages
DonW4
Level 1
Level 1
Posts: 2
Joined: Tue Jun 28, 2022 6:28 am

Re: DPKG is not working

Post by DonW4 »

Thanks for both advices, much appreciated and I can see good value in your replies however the problem seems to have resolved itself. When I booted the computer later in the day the update manager advised me that there was a new version so I tried this update and it installed. After that everything just started working again.
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: DPKG is not working

Post by pbear »

FWIW, it was shutdown which released the lock, the purpose of which is to prevent two package management apps from trying to change the same file. Shutdown doesn't always work, though, in which event the lock file has to be deleted manually.
Locked

Return to “Software & Applications”