Skip to main content

Ubuntu dpkg lock error

Error on ubuntu:
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

Solution:
You have two errors here. 

1. You are missing a GPG key
2. The dpkg lock file is locked.

You should fix (2) before you fix (1).

2. Open a terminal and type

lsof – List Of Open Files


Code:
sudo lsof /var/lib/dpkg/lock

You can then either close that program, restart your PC or send a -TERM to the program with the lock by using kill and the pid.


Code:
sudo kill <pid>

After killing the process the dpkg needs to be configured else it will throw this error:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 

Code:
sudo dpkg --configure -a


1. Only if required:
After that you need to import the key.

EDIT: Added command.

Code:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2EBC26B60C5A2783
then type

Code:
sudo apt-get update

Source:
https://ubuntuforums.org/showthread.php?t=1858466

Comments

Popular posts from this blog

How to calculate the battery standby time according to the load?

Things we should know:   P = V . I                     (ie. power in watts = volts x amps) Every battery has a amps/hr (Ah) rating which signifies for how many hours it can deliver that much amount of current? for eg. 2000mAh battery can deliver 2000mili Amps per hour  Eg.1 Inverter battery standby calculation 1.Calculating the total battery capacity in Watts/hr:  if our inverter battery has a rating of 150Ah and voltage 12V thus it can deliver 150Amps per hour. thus power delivered per hour will be 1800Watts/hr  (1800 = 12 x 150) .............................(  P = V . I  ) 2.battery threshold level : (actual battery capacity) now before proceeding take into consideration that the battery wont be fully discharged due to the internal protection circuit in the inverter so we have to first take 85% of our total battery ca...

AC mains current and transformer current

These are two separate issues: 1) How much current the transformer can supply? 2) How much current can your mains AC supply deliver? The answer to (2) is easy. Go to your fuse box and look at the rating on the fuse or circuit breaker. If the rating is 40A, then the maximum power delivered before blowing the fuse is 220V x 40A = 8800W. Generally it is between (20A-50A) and the answer to (1) is, The maximum current delivered by the transformer will depend on the size and construction of the transformer: 1. As an example, let us say the transformer steps down from 220VAC to 20VAC.     This is approximately 10:1 reduction. 2. Then if the transformer is rated at 1A on...

The secret about RELAYS

Q.how long would a 9v battery last with a 5v relay and  what value of resistor i would need to get 5v from a 9v  battery? Ans. Relay coils have a specified coil resistance. That coil resistance determines how much current flows through  the relay coil when a voltage is placed on it.  Although relays are specified by voltages, they're actually  current activated devices . A "5V" relay may  have coil resistances of 50 to several hundred ohms,  depending on the size and physical design. For Eg: the NEC EA2 relay series has a 5V relay with a 178 ohm coil. What that tells you is that it takes 5v/178 =28.1ma to run that coil. The EA2 will operate (pull in) at voltages of 80% of nominal, or 4V: that means it will operate on 4v/178 = 22.5ma. How that relates to the question is this: - If you hook a 9V battery directly to a 5V EA2 (...