Score:0

Ubuntu VM python2 pathlib intstall error

in flag

so I'm trying some python 2 scripts in my Ubuntu VM. I installed python 2. One of the scripts need the module pathlib. Tried to install it but got a error message:

~/Desktop$ sudo apt-get install -y python-pathlib
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 8632 (unattended-upgr)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

I like to know that means and of course I like to know why this happened. I'm grateful for any help!

Cheers!

Score:1
mw flag

You see this error because some other program is trying to update Ubuntu. When a command or application is updating the system or installing a new software, it locks the dpkg file (Debian package manager).

This locking is done so that two processes don’t change the content at the same time as it may lead to unwarranted situation and a possible broken system.

Read more here about this error and how to resolve it.

simonericmoon avatar
in flag
Thanks but after all methods tried out I still get the following error, which prevents me from installing pathlib: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package python-pathlib
blnks avatar
mw flag
What is the output of `apt-cache search python-pathlib` ?
simonericmoon avatar
in flag
python-pathlib2 - Backport of the "pathlib" stdlib module (Python 2)
blnks avatar
mw flag
So try `sudo apt install python-pathlib2`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.