0

I would like to install the following libraries:

  • python-sip
  • pyton-psutil

However, I got the following errors:

nakrule@mordor ~ % pacman -S python-psutil 
[sudo] password for nakrule: 
Sorry, try again.
[sudo] password for nakrule: 
resolving dependencies...
looking for conflicting packages...

Packages (1) python-psutil-5.4.7-1

Total Installed Size:  1.95 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                                [----------------------------------] 100%
(1/1) checking package integrity                              [----------------------------------] 100%
(1/1) loading package files                                   [----------------------------------] 100%
(1/1) checking for file conflicts                             [----------------------------------] 100%
error: failed to commit transaction (conflicting files)
python-psutil: /usr/lib/python3.7/site-packages/psutil-5.4.7-py3.7.egg-info/PKG-INFO exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil-5.4.7-py3.7.egg-info/SOURCES.txt exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil-5.4.7-py3.7.egg-info/dependency_links.txt exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil-5.4.7-py3.7.egg-info/not-zip-safe exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil-5.4.7-py3.7.egg-info/top_level.txt exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/__init__.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/__pycache__/__init__.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/__pycache__/_common.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/__pycache__/_compat.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/__pycache__/_exceptions.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/__pycache__/_psaix.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/__pycache__/_psbsd.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/__pycache__/_pslinux.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/__pycache__/_psosx.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/__pycache__/_psposix.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/__pycache__/_pssunos.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/__pycache__/_pswindows.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/_common.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/_compat.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/_exceptions.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/_psaix.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/_psbsd.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/_pslinux.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/_psosx.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/_psposix.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/_pssunos.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/_psutil_linux.cpython-37m-x86_64-linux-gnu.so exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/_psutil_posix.cpython-37m-x86_64-linux-gnu.so exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/_pswindows.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__init__.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__main__.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/__init__.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/__main__.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/test_aix.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/test_bsd.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/test_connections.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/test_contracts.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/test_linux.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/test_memory_leaks.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/test_misc.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/test_osx.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/test_posix.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/test_process.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/test_sunos.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/test_system.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/test_unicode.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/__pycache__/test_windows.cpython-37.pyc exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/test_aix.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/test_bsd.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/test_connections.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/test_contracts.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/test_linux.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/test_memory_leaks.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/test_misc.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/test_osx.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/test_posix.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/test_process.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/test_sunos.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/test_system.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/test_unicode.py exists in filesystem
python-psutil: /usr/lib/python3.7/site-packages/psutil/tests/test_windows.py exists in filesystem
Errors occurred, no packages were upgraded.
1 nakrule@mordor ~ % pacman -S python-sip                                                           :(
resolving dependencies...
looking for conflicting packages...

Packages (1) python-sip-4.19.13-1

Total Installed Size:  0.24 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                                [----------------------------------] 100%
(1/1) checking package integrity                              [----------------------------------] 100%
(1/1) loading package files                                   [----------------------------------] 100%
(1/1) checking for file conflicts                             [----------------------------------] 100%
error: failed to commit transaction (conflicting files)
python-sip: /usr/lib/python3.7/site-packages/sip.so exists in filesystem
Errors occurred, no packages were upgraded.

How is it possible that theses files already exist, and what can I do to resolve this problem ?

Thank you in advance.

  • You have used pip to install system-wide: don't do that, use a virtualenv. – jasonwryan Oct 26 '18 at 7:37
  • I have used pip to install what ? I never tried to install theses libraries with pip or I don't understand your statement. – Nakrule Oct 26 '18 at 7:59
  • 2
    The package manager refuses to overwrite files it's not tracking. You put those files there, or a program did it for you, or... It's hard to tell without knowing the story of your system. You can know if those files are owned by some package by running pacman -Qo /path/to/file. If the files are not owned by any package you can probably install the new packages by using the --overwrite option. But of course it might not be a good idea to overwrite files without knowing why they are there. – fra-san Oct 26 '18 at 8:37
  • Thank you @fra-san, your solution worked. I don't where theses files came from as pacman was not tracking them. – Nakrule Oct 26 '18 at 9:43
  • @fra-san You may want to add that as an answer. – RalfFriedl Nov 3 '18 at 7:20
2

pacman will refuse to overwrite files that it is not tracking, i.e. not listed in its local database.
Such files have been probably installed without using pacman, either manually by you or by some program on your behalf.

In short, if those files are not owned by any package - and you know you are not breaking anything - you can probably install the new packages by using the --overwrite option, which lets pacman bypass file conflict checks and overwrite conflicting files (refer to man pacman for an extended explanation):

# pacman -S --overwrite <glob> package_name

Note, though, that the ArchWiki warns against using --overwrite (since it takes an argument containing a glob). Refer to the Troubleshooting section of the relevant page, which currently covers your case.

You can know which package does own a file (if any) by querying pacman's database:

$ pacman -Qo /path/to/file

A method for identifying all files not owned by any package is illustrated in this page of the ArchWiki.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.