gentoo zlib 已删除 = portage 已损坏

gentoo zlib 已删除 = portage 已损坏

你好,我使用 gentoo 的时间不长,犯了这样的错误:我从系统中删除了 zlib 包。现在我的 portage 系统已损坏:

# emerge --sync
Traceback (most recent call last):
  File "/usr/bin/emerge", line 36, in <module>
    from _emerge.main import emerge_main
  File "/usr/lib64/portage/pym/_emerge/main.py", line 41, in <module>
    from _emerge.actions import action_config, action_sync, action_metadata, \
  File "/usr/lib64/portage/pym/_emerge/actions.py", line 44, in <module>
    from _emerge.depgraph import backtrack_depgraph, depgraph, resume_depgraph
  File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 40, in <module>
    from _emerge.FakeVartree import FakeVartree
  File "/usr/lib64/portage/pym/_emerge/FakeVartree.py", line 11, in <module>
    from portage.dbapi.vartree import vartree
  File "/usr/lib64/portage/pym/portage/dbapi/vartree.py", line 56, in <module>
    import re, shutil, stat, errno, copy, subprocess
  File "/usr/lib64/python2.6/subprocess.py", line 430, in <module>
    import pickle
  File "/usr/lib64/python2.6/pickle.py", line 1258, in <module>
    import binascii as _binascii
ImportError: libz.so.1: cannot open shared object file: No such file or directory

如何重新安装 zlib 包并修复系统?

更新

问题解决了。我已经/lib/libz.so.1从其他机器复制了目标文件,然后就可以正常运行emerge和安装程序包了。zlib

谢谢PowerSp00n

答案1

理论上,您可以下载安装时使用的 stage3 文件并恢复丢失的文件。当emerge再次运行时,zlib使用重新安装emerge -av1 zlib

答案2

预构建的二进制包可在http://tinderbox.dev.gentoo.org/— 下次遇到类似问题时请检查一下。

答案3

另外,当您删除软件包时,我建议使用,emerge -pv --depclean pkgname因为如果有东西依赖于它,它将不会让您取消合并该软件包。

相关内容