You are not logged in.

#1 2018-05-04 22:51:04

cmcjacob
Banned
Registered: 2018-05-03
Posts: 10

[SOLVED] Database locked, 'ping' messed up & Python libraries

[$ ping google.com
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aio_ping-0.0.0-py3.6.egg/aio_ping/__init__.py", line 587, in ping
    ping.loop.run_until_complete(ping.init(hostname))
  File "/usr/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
    return future.result()
  File "/usr/lib/python3.6/site-packages/aio_ping-0.0.0-py3.6.egg/aio_ping/__init__.py", line 284, in init
    socket.getprotobyname("icmp"))
  File "/usr/lib/python3.6/socket.py", line 144, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
PermissionError: [Errno 1] Operation not permitted

This has been happening since I foolishly ran a ./install.py script as sudo, and I noticed it blindly started overwriting a lot of my python packages, messing with pip installs etc.  I only had 2.7 and 3.6 already installed for configuration of some scripts I frequently use.  My question is, I'm afraid that

suco pacman -Rs python | sudo pacman -Rs python2

will not fully get rid of everything the script did.  Is this just a matter of going to /usr/lib/ and /usr/share/ and deleting all the python* folders, and why has it taken over my ping function?  It shouldn't need admin privelages to run ping should it?

edit: It wont even let me remove these libs:

sudo pacman -Rs python | sudo pacman -Rs python2
[sudo]error: failed to init transaction (unable to lock database)
error: could not lock database: File exists
  if you're sure a package manager is not already
  running, you can remove /var/lib/pacman/db.lck
error: failed to prepare transaction (could not satisfy dependencies)

I've previously only encountered this error when trying to install 2 packages at the same time.  Removing db.lck, although confused why it happened:

[pacman]$ sudo rm db.lck
rm: cannot remove 'db.lck': No such file or directory

Last edited by cmcjacob (2018-05-04 23:14:49)

Offline

#2 2018-05-04 23:01:37

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] Database locked, 'ping' messed up & Python libraries

/usr/bin/ping is supplied by iputils and does not use python and has setcap cap_net_raw+ep
No removing python / python2 will not fix the issue with ping as pacman did not track the changes made by the script you ran as root.
See Pacman#.22Failed_to_commit_transaction_.28conflicting_files.29.22_error which covers what you have done.

Offline

#3 2018-05-04 23:03:16

cmcjacob
Banned
Registered: 2018-05-03
Posts: 10

Re: [SOLVED] Database locked, 'ping' messed up & Python libraries

I understand, but how do i unlock the database? I cant run pacman at all now

rm: cannot remove '/var/lib/pacman/db.lck': No such file or directory

The wiki shows no other steps that can be taken.

Last edited by cmcjacob (2018-05-04 23:07:03)

Offline

#4 2018-05-04 23:06:18

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] Database locked, 'ping' messed up & Python libraries

Two sections below on the same wiki page I directed you to covers the pacman database lock.

Offline

#5 2018-05-04 23:14:09

cmcjacob
Banned
Registered: 2018-05-03
Posts: 10

Re: [SOLVED] Database locked, 'ping' messed up & Python libraries

Rebooting fixed the lock issue and reinstalling iputils fixed my ping errors, thanks!

Last edited by cmcjacob (2018-05-04 23:14:26)

Offline

#6 2018-05-04 23:23:02

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] Database locked, 'ping' messed up & Python libraries

That should leave you with removing all the other untracked files.

Offline

#7 2018-05-06 03:30:20

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] Database locked, 'ping' messed up & Python libraries

Use pacman -Qkk or the more fine-grained "paccheck" command from pacutils, to check all the files on your system and ensure they match what pacman expects to see.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB