returns E:Not locked before setting up the installed package

Asked by Galileo Sartor

I'm working on ubuntu-make (https://github.com/ubuntu/ubuntu-make).
On cosmic the apt tests fail, returning the following error.
It's not present in older releases, and it's not tied to anny recent changes in the program.

E:Not locked
Subprocess output: Selecting previously unselected package testpackage.
(Reading database ...
(Reading database ... 100%
(Reading database ... 0 files and directories currently installed.)
Preparing to unpack ..././testpackage_0.0.1_all.deb ...
Unpacking testpackage (0.0.1) ...
Setting up testpackage (0.0.1) ...

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu python-apt Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

I suggest you report a bug. Cosmic is not ready and not stable.

If you want an OS that works then I suggest you wipe the install off and do a clean install of Bionic. Bionic is LTS and supported until April 2023.

If you want to report bugs and happy to stomach bugs and feature holes until (and even a little after) release then use Cosmic but don't expect a smooth ride. It's not for casual users (yet)

Revision history for this message
Galileo Sartor (lyzardking) said :
#2

I'm not using cosmic.
I'm one of the ubuntu-make maintainers.
What I'm trying to do is fix any bugs with cosmic before it's released.

On Fri, 21 Sep 2018, 10:44 actionparsnip, <
<email address hidden>> wrote:

> Your question #674251 on python-apt in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/python-apt/+question/674251
>
> Status: Open => Answered
>
> actionparsnip proposed the following answer:
> I suggest you report a bug. Cosmic is not ready and not stable.
>
> If you want an OS that works then I suggest you wipe the install off and
> do a clean install of Bionic. Bionic is LTS and supported until April
> 2023.
>
> If you want to report bugs and happy to stomach bugs and feature holes
> until (and even a little after) release then use Cosmic but don't expect
> a smooth ride. It's not for casual users (yet)
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/python-apt/+question/674251/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/python-apt/+question/674251
>
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

For me it looks as if the message "E:Not locked" is not part of the apt output (because that follows the text "Subprocess output:"), but of one of the commands before.

Do you have any chance to identify which script and which command could be responsible for that output?

Revision history for this message
Galileo Sartor (lyzardking) said :
#4

It's the error reported by the python futures thread with the apt commit.
Also, to get this message on cosmic I had to install apt-utils.
In the launchpad build the error was different:

2018-09-19 18:31:09,072 [umake.network.requirements_handler] ERROR: E:Not locked
Subprocess output: debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Permission denied
debconf: delaying package configuration, since apt-utils is not installed
dpkg: warning: files list file for package 'testpackage' missing; assuming package has no files currently installed
(Reading database ... 0 files and directories currently installed.)
Preparing to unpack ..././testpackage_0.0.1_all.deb ...
Unpacking testpackage (0.0.1) over (0.0.0) ...
Setting up testpackage (0.0.1) ...

The code in question is:
https://github.com/ubuntu/ubuntu-make/blob/master/umake/network/requirements_handler.py#L207

On 21/09/2018 14:12, Manfred Hampl wrote:
> Your question #674251 on python-apt in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/python-apt/+question/674251
>
> Status: Open => Needs information
>
> Manfred Hampl requested more information:
> For me it looks as if the message "E:Not locked" is not part of the apt
> output (because that follows the text "Subprocess output:"), but of one
> of the commands before.
>
> Do you have any chance to identify which script and which command could
> be responsible for that output?
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

Sorry, but I cannot help further. This goes beyond by knowledge of apt (and python).

The only remark I can do: The python-apt change log shows:

python-apt (1.7.0~alpha2ubuntu3) cosmic; urgency=medium
...
  * Introduce frontend locking
  * Convert apt.Cache.commit and apt_pkg.DepCache.commit to FE lock

So apparently there was a change in lock handling. Maybe the emergence of the "E:Not Locked" message is related to that.

Revision history for this message
Galileo Sartor (lyzardking) said :
#6

What is a frontend lock exactly?
Am I supposed to lock/unlock the cache if I use python-apt?

Revision history for this message
Manfred Hampl (m-hampl) said :
#7

Maybe you should try contacting someone of the APT Development Team https://launchpad.net/~deity

Can you help with this problem?

Provide an answer of your own, or ask Galileo Sartor for more information if necessary.

To post a message you must log in.