dnf:(某些东西)应该安装,但没有安装!

dnf:(某些东西)应该安装,但没有安装!

我发现某些软件包到处都发生了错误,但我没有找到任何适合我的解决方案。

dnf install python2-qtconsole python2-jupyter-core当我发现 python2-urllib3 尝试安装时出现错误时,尝试安装Jupyter 时一切都崩溃了。现在每当我这样做: 时dnf install python2-urllib3,我都会得到:

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

我尝试了所有这些

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

...而且我很快就失去了想法...

答案1

问题似乎是:

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

在我用于测试的 Fedora VM 中,此路径:

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

实际上是一个目录并且安装成功了。所以我的猜测是你正在从那个镜像中拉出一个损坏的包,我的印象是 Fedora 对下载包进行了校验和,我真的不知道,如果他们这样做了那就不太可能了。您可以通过以下方式检查包裹:

rpm --verify $package_name

一些想法:更改您的镜像/etc/yum.repos.d/fedora-updates.repo部分[updates] 注释metalink,并提供一个baseurl您选择的镜像,我建议您复制该baseurl行,然后取消注释,以便稍后可以将存储库文件恢复到其原始状态。

之后,再次运行dnf clean all,,dnf check-updatednf reinstall ...一旦你确定你有一个有效的包,如果 dnf 没有完成这项工作,请尝试一些额外的选项rpm --install,例如--force.我还注意到您的rpm --erased问题是 python3 版本而不是 python2 版本,但这可能是您在发布问题时犯下的拼写错误,请检查您的$ history.这就是我能看到的一切,无需更多日志。

相关内容