所以我似乎搞乱了我的系统。我最后的办法是重新安装 Ubuntu,但我希望能得到一些关于如何避免这种情况的建议。
我无法通过 apt 安装应用程序,升级失败,并且我尝试的所有步骤都引发了其他问题。
因此,当我尝试运行 sudo apt-get upgrade 时,我得到了这个
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
libc6-dbg : Depends: libc6 (= 2.23-0ubuntu11) but 2.23-0ubuntu10 is installed
libc6-dev : Depends: libc6 (= 2.23-0ubuntu11) but 2.23-0ubuntu10 is installed
libc6-i386 : Depends: libc6 (= 2.23-0ubuntu11) but 2.23-0ubuntu10 is installed
libc6-x32 : Depends: libc6 (= 2.23-0ubuntu11) but 2.23-0ubuntu10 is installed
E: Unmet dependencies. Try using -f.
因此,我使用建议接下来尝试 apt-get -f install 并得到此结果
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
libc6 libc6:i386
Suggested packages:
glibc-doc glibc-doc:i386 locales:i386
The following packages will be upgraded:
libc6 libc6:i386
2 upgraded, 0 newly installed, 0 to remove and 425 not upgraded.
9 not fully installed or removed.
Need to get 0 B/4,838 kB of archives.
After this operation, 0 B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 499265 files and directories currently installed.)
Preparing to unpack .../libc6_2.23-0ubuntu11_amd64.deb ...
De-configuring libc6:i386 (2.23-0ubuntu10) ...
LD_LIBRARY_PATH contains the traditional /lib directory,
but not the multiarch directory /lib/x86_64-linux-gnu.
It is not safe to upgrade the C library in this situation;
please remove the /lib/directory from LD_LIBRARY_PATH and
try again.
dpkg: error processing archive /var/cache/apt/archives/libc6_2.23-0ubuntu11_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Preparing to unpack .../libc6_2.23-0ubuntu11_i386.deb ...
De-configuring libc6:amd64 (2.23-0ubuntu10) ...
LD_LIBRARY_PATH contains the traditional /lib directory,
but not the multiarch directory /lib/i386-linux-gnu.
It is not safe to upgrade the C library in this situation;
please remove the /lib/directory from LD_LIBRARY_PATH and
try again.
dpkg: error processing archive /var/cache/apt/archives/libc6_2.23-0ubuntu11_i386.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Errors were encountered while processing:
/var/cache/apt/archives/libc6_2.23-0ubuntu11_amd64.deb
/var/cache/apt/archives/libc6_2.23-0ubuntu11_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我找到了关于取消设置 LD_LIBRARY_PATH 的建议。我根据其他链接的建议重写了 LD_LIBRARY_PATH。我删除了 libc6* 并尝试重新安装,但似乎没有任何效果。
~$ echo $LD_LIBRARY_PATH
/lib:/usr/lib:/usr/local/lib
~$ sudo apt-get check
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
libc6-dbg : Depends: libc6 (= 2.23-0ubuntu11) but 2.23-0ubuntu10 is installed
libc6-dev : Depends: libc6 (= 2.23-0ubuntu11) but 2.23-0ubuntu10 is installed
libc6-i386 : Depends: libc6 (= 2.23-0ubuntu11) but 2.23-0ubuntu10 is installed
libc6-x32 : Depends: libc6 (= 2.23-0ubuntu11) but 2.23-0ubuntu10 is installed
E: Unmet dependencies. Try using -f.
有人有什么建议吗?或者我应该重新安装 Ubuntu?
答案1
您是否尝试过使用它,apt-get update
如果它不起作用,然后尝试apt-get check
看看您的依赖项是否没有受到损害