1

Actually if we suspend any application installing in middle or suspending updates then automatically while resuming we will get some problems like

E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/cache/apt/archives/

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?

I know how to solve these things by removing lock . but i want to know why there is going to be a lock while performing updates/installation .

1 Answer 1

3

Quite simply, locks are used for their original intention: To keep other processes from mucking around with installations. Imagine the following scenario:

  1. Process1 is started to install basex, which depends on default-jre

  2. Process2 begins to remove default-jre. basex is already in progress so it cannot be informed of this removal.

  3. Process2 finishes.

  4. Process1 finishes. A nonworking system exists. This is worse if the same package is installed, then removed simultaneously.

While this may be resolved by holding a per-package lock held for the package and any packages that must exist(Dependencies), I don't know why this is not done.

A similar issue can occur if there are packages that conflict. For example, one package might be installed, and another conflicting one could be installed simultaneously(as a dependency or otherwise).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .