I but reinstalled Kali Linux inwards my PC together with later on my offset logon, I tried to run apt-get update together with had E: Could non larn lock /var/lib/dpkg/lock - opened upward (11: Resource temporarily unavailable) mistake coming up. Interesting, because I am the alone user (I but installed the system) together with there’s no other procedure using dpkg. This was pretty annoying equally it stops yous from installing updates or novel softwares. Here’s a run downwards of the issues:
“E: Could non larn lock /var/lib/dpkg/lock” error
This happens when I tried to purpose apt-get update
root@kali: # apt-get update
Hit http://http.kali.org sana InRelease
Hit http://security.kali.org sana/updates InRelease
.
.
Hit http://security.kali.org sana/updates/non-free amd64 Packages
Fetched 9,334 kB inwards 2min 18s (67.5 kB/s)
E: Could non larn lock /var/lib/dpkg/lock - opened upward (11: Resource temporarily unavailable)
E: Unable to lock the direction directory (/var/lib/dpkg/), is roughly other procedure using it?
Trying to railroad train the error
Tried multiple steps
Try 1 – Rebooting:
At this dot I tried restart together with run across if that makes whatever differences. It didn’t.
Try 2: – endeavor amongst sudo
I tried using sudo to run across if this was related amongst this other mistake dpkg: warning: ‘ldconfig’ non institute inwards PATH or non executable.
root@kali: # sudo apt-get update
Hit http://http.kali.org sana InRelease
.
.
E: Could non larn lock /var/lib/dpkg/lock - opened upward (11: Resource temporarily unavailable)
E: Unable to lock the direction directory (/var/lib/dpkg/), is roughly other procedure using it?
sudo didn’t railroad train it.
Try three – Try Googling
Like roughly search results returned, I tried to delete lock file
root@kali: # rm /var/cache/apt/archives/lock
Then update
root@kali: # apt-get update
.
.
E: Could non larn lock /var/lib/dpkg/lock - opened upward (11: Resource temporarily unavailable)
E: Unable to lock the direction directory (/var/lib/dpkg/), is roughly other procedure using it?
Nope withal no luck.
Try four – Actually read the error!
Then I genuinely read the freaking mistake which I didn’t exercise till now. Duh, the mistake is:
E: Could non larn lock /var/lib/dpkg/lock - opened upward (11: Resource temporarily unavailable)
E: Unable to lock the direction directory (/var/lib/dpkg/), is roughly other procedure using it?
Which indicates that the lock file is inwards /var/lib/dpkg/lock folder. Silly me! So let’s accept a await into /var/lib/dpkg/ folder to confirm is in that place is genuinely a lock file inwards there?
root@kali: # rm /var/lib/dpkg/
alternatives/ diversions-old parts/ status-old
available info/ statoverride triggers/
diversions lock condition updates/
There is a lock file. So let’s delete that.
root@kali: # rm /var/lib/dpkg/lock
and together with therefore endeavor to update again
root@kali: # apt-get update
Hit http://security.kali.org sana/updates InRelease
.
.
Reading bundle lists... Done
root@kali: #
Booyaa. Worked but fine. Well, ofc it does, when yous tin write together with read properly!!!!
Now but to locomote on prophylactic side, let’s exercise an apt-get upgrade
root@kali: # apt-get upgrade
Reading bundle lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The next packages volition locomote upgraded:
armitage gr-osmosdr iceweasel lav john-data libgnuradio-osmosdr0.1.3
libgnutls-deb0-28 libgnutls-openssl27 libsnmp-base libsnmp-perl libsnmp30
openvas python-hpack python-impacket python-pyperclip snmp snmpd
17 upgraded, 0 newly installed, 0 to take away together with 0 non upgraded.
Need to larn 0 B/70.6 MB of archives.
After this operation, 12.8 MB of additional disk infinite volition locomote used.
Do yous desire to continue? [Y/n] Y
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 323261 files together with directories currently installed.).
.
.
root@kali: #
Yeah .. working well. together with in conclusion complete it amongst installing gimp.
root@kali: # apt-get install gimp
Reading bundle lists... Done
Building dependency tree
Reading state information... Done
The next extra packages volition locomote installed:
gimp-data libamd2.3.1 libbabl-0.1-0 libcamd2.3.1 libccolamd2.8.0
libcholmod2.1.2 libcolamd2.8.0 libgegl-0.2-0 libgimp2.0 libopenraw1
libumfpack5.6.2
Suggested packages:
gimp-help-en gimp-help gimp-data-extras
The next NEW packages volition locomote installed:
gimp gimp-data libamd2.3.1 libbabl-0.1-0 libcamd2.3.1 libccolamd2.8.0
libcholmod2.1.2 libcolamd2.8.0 libgegl-0.2-0 libgimp2.0 libopenraw1
libumfpack5.6.2
0 upgraded, 12 newly installed, 0 to take away together with 0 non upgraded.
Need to larn 15.7 MB of archives.
After this operation, 70.9 MB of additional disk infinite volition locomote used.
Do yous desire to continue? [Y/n] Y
Get:1 http://http.kali.org/kali/ sana/main libamd2.3.1 amd64 1:4.2.1-3 [26.3 kB]
.
.
Fetched 15.7 MB inwards 2min 37s (99.8 kB/s)
Selecting previously unselected bundle libamd2.3.1:amd64.
(Reading database ... 323276 files together with directories currently installed.)
.
.
Processing triggers for libc-bin (2.19-18) ...
Processing triggers for bill of fare (2.1.47) ...
root@kali: #
Perfect.
Moral of this post
Sometimes it genuinely helps when yous genuinely read the mistake together with non but follow Google search results blindly. Same applies to my posts, purpose your judgment, nine out of 10, you’re in all likelihood strike on the money.

