0

I see that it is an error that happend here and there for some packages, but I didnt find any solution working for me.

Everything broke down trying to install Jupyter by dnf install python2-qtconsole python2-jupyter-core, when I found that python2-urllib3 was giving an error trying to install. Now whenever I do: dnf install python2-urllib3, I get:

Dependencies resolved.
========================================================================================================================================
 Package                              Arch                        Version                            Repository                    Size
========================================================================================================================================
Installing:
 python2-urllib3                      noarch                      1.22-3.fc27                        updates                      178 k

Transaction Summary
========================================================================================================================================
Install  1 Package

Total download size: 178 k
Installed size: 678 k
Is this ok [y/N]: y
Downloading Packages:
python2-urllib3-1.22-3.fc27.noarch.rpm                                                                   78 kB/s | 178 kB     00:02    
----------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                    53 kB/s | 178 kB     00:03     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                1/1 
  Installing       : python2-urllib3-1.22-3.fc27.noarch                                                                             1/1 
Error unpacking rpm package python2-urllib3-1.22-3.fc27.noarch
Error unpacking rpm package python2-urllib3-1.22-3.fc27.noarch
error: unpacking of archive failed on file /usr/lib/python2.7/site-packages/urllib3/packages/ssl_match_hostname: cpio: File from package already exists as a directory in system
python2-urllib3-1.22-3.fc27.noarch was supposed to be installed but is not!
  Verifying        : python2-urllib3-1.22-3.fc27.noarch                                                                             1/1 

Failed:
  python2-urllib3.noarch 1.22-3.fc27                                                                                                    

Error: Transaction failed

I tried all these

dnf clean all
yum clean all && rpm --rebuilddb
package-cleanup --problems
rpm -e python3-urllib3-1.22-3.fc27.noarch --nodeps
rpm -i python2-urllib3-1.22-3.fc27.noarch.rpm

... and I'm losing ideas fast ...

  • 1
    The question you link to deals with the problem arising from the attempt to create an RPM package and local install it - different, in fact it suggests to remove a symlink while I dont have any symlinks in my problem dir. From what I saw googling, I didnt find anywhere a general solution for a problem that should be dealt with by a dnf clean all or rebuilddb – alessandro Mar 28 '18 at 14:05
0

The issue seems to be:

 cpio: File from package already exists as a directory in system

In a fedora VM I have for testing, this path:

/usr/lib/python2.7/site-packages/urllib3/packages/ssl_match_hostname

Is actually a directory and installation was successful. So my guess is that you are pulling a corrupted package from that mirror, I was under the impression that fedora did checksums for download packages, I don't really know, if they do then it would be improbable. You can check the package with:

rpm --verify $package_name

Some ideas: Change your mirror in /etc/yum.repos.d/fedora-updates.repo for the section [updates] comment the metalink, and provide a baseurl with a mirror of your choice, I suggest you to copy the baseurl line and then un-comment it so you can restore the repo file to its original state later.

After that, run again dnf clean all, dnf check-update, dnf reinstall ... . Once you are sure you have a valid package, if dnf is not doing the job, try some extra options for rpm --install, like --force. I also noticed you rpm --erased the python3 version and not the python2 version which is the issue, but that may be a typo you made when posting the question, check your $ history . That's all I can see without more logs.

  • I'm trying but I'm not sure: after commenting the metalink line I tried to find a mirror list - found one at admin.fedoraproject.org/mirrormanager/mirrors/Fedora/27 and set a line metalink=http://fedora.aau.at/linux but it isnt working – alessandro Mar 28 '18 at 10:18
  • I did not suggest you to change the metalink variable, but to change and uncomment the baseurl variable, please read the answer carefully. baseurl=http://fedora.aau.at/linux/updates/$releasever/$basearch Is working fine. – J. García Mar 28 '18 at 11:07
  • I edited the last follow-up, I was not done writing when I posted it, read it now. – J. García Mar 28 '18 at 11:11
  • sorry, now I see. I did as suggested and dnf still fails, the same for rpm --force ...; suggestion: what about deleting /usr/lib/python2.7/site-packages/urllib3/ ? Since it explicitely complains about a directory already present, I guess it's that one – alessandro Mar 28 '18 at 11:19
  • Was the package downloaded again_? – J. García Mar 28 '18 at 11:21

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.