从 13 升级到 14 后无法执行 su 或 sudo

从 13 升级到 14 后无法执行 su 或 sudo

我从 13 升级到了 14,升级过程中出现了很多错误。现在我无法访问 root(通过 su 命令)或执行类似 的操作sudo apt-get install something

笔记:这不是重复的使用 su 或 sudo 时出现分段错误 。我尝试了那里发布的答案,但没有用。请参阅编辑1以下。

如果我尝试:

    sudo apt-get install XXX

我收到此错误:

    Errore di segmentazione (core dump creato)
    Segmentation fault (core dump created)

我该如何解决这个问题?

编辑1:

我刚刚尝试aptdcon --fix-install在这里发布答案:使用 su 或 sudo 时出现分段错误,并返回以下结果:

ERROR: Operazione di pacchetto non riuscita
Installazione o la rimozione di un pacchetto software non riuscita.

dpkg: dependency problems prevent configuration of libpam-winbind:amd64:
 libpam-winbind:amd64 depends on samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3); however:
  Package samba-libs is not installed.

dpkg: error processing package libpam-winbind:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of samba:
 samba depends on samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3); however:
  Package samba-libs is not installed.

dpkg: error processing package samba (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of system-config-samba:
 system-config-samba depends on samba; however:
  Package samba is not configured yet.

dpkg: error processing package system-config-samba (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of winbind:
 winbind depends on samba (= 2:4.1.6+dfsg-1ubuntu2.14.04.3); however:
  Package samba is not configured yet.
 winbind depends on samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3); however:
  Package samba-libs is not installed.

dpkg: error processing package winbind (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of samba-dsdb-modules:
 samba-dsdb-modules depends on samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3); however:
  Package samba-libs is not installed.

dpkg: error processing package samba-dsdb-modules (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libsmbclient:amd64:
 libsmbclient:amd64 depends on samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3); however:
  Package samba-libs is not installed.

dpkg: error processing package libsmbclient:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-samba:
 python-samba depends on samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3); however:
  Package samba-libs is not installed.

dpkg: error processing package python-samba (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of samba-vfs-modules:
 samba-vfs-modules depends on samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3); however:
  Package samba-libs is not installed.

dpkg: error processing package samba-vfs-modules (--configure):
 dependency problems - leaving unconfigured

之后我尝试运行:

echo \"$(dpkg --get-selections | grep install | cut -f 1)\"

aptdcon --reinstall "package1 package2 package3..."

使用生成的列表,返回以下结果:

ERROR: org.debian.apt.TransactionFailed - error-cache-broken:  I seguenti pacchetti presentano dipendenze non soddisfatte:                     

libnss-winbind: Depends: samba-common (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma 2:4.1.6+dfsg-1ubuntu2.14.04.3 è installato
                Depends: winbind (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma 2:4.1.6+dfsg-1ubuntu2.14.04.3 è installato
                Depends: libwbclient0 (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma 2:4.1.6+dfsg-1ubuntu2.14.04.3 è installato
                Depends: samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma non è installato
libpam-smbpass: Depends: samba-common (= 2:3.6.18-1ubuntu3.3) ma 2:4.1.6+dfsg-1ubuntu2.14.04.3 è installato
libpam-winbind: Depends: samba-common (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma 2:4.1.6+dfsg-1ubuntu2.14.04.3 è installato
                Depends: winbind (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma 2:4.1.6+dfsg-1ubuntu2.14.04.3 è installato
                Depends: samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma non è installato
libsmbclient: Depends: samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma non è installato
python-samba: Depends: python (< 2.8) ma 2.7.5-5ubuntu3 è installato
              Depends: python:any (>= 2.7.1-0ubuntu2) ma è un pacchetto virtuale
              Depends: samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma non è installato
samba: Depends: heimdal-hdb-api-8 ma è un pacchetto virtuale
       Depends: samba-common (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma 2:4.1.6+dfsg-1ubuntu2.14.04.3 è installato
       Depends: samba-common-bin (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma 2:4.1.6+dfsg-1ubuntu2.14.04.3 è installato
       Depends: python (< 2.8) ma 2.7.5-5ubuntu3 è installato
       Depends: python2.7:any ma è un pacchetto virtuale
       Depends: samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma non è installato
samba-common-bin: Depends: samba-common (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma 2:4.1.6+dfsg-1ubuntu2.14.04.3 è installato
                  Depends: python2.7:any ma è un pacchetto virtuale
                  Depends: samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma non è installato
samba-dsdb-modules: Depends: samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma non è installato
samba-vfs-modules: Depends: samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma non è installato
smbclient: Depends: samba-common (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma 2:4.1.6+dfsg-1ubuntu2.14.04.3 è installato
           Depends: samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma non è installato
winbind: Depends: samba (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma 2:4.1.6+dfsg-1ubuntu2.14.04.3 è installato
         Depends: libwbclient0 (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma 2:4.1.6+dfsg-1ubuntu2.14.04.3 è installato
         Depends: samba-libs (= 2:4.1.6+dfsg-1ubuntu2.14.04.3) ma non è installato

答案1

可能是您损坏了系统上的文件。也许在升级过程中出现了问题,或者升级在完成之前就停止了(可能是由于断电或磁盘空间不足?)

段错误是一种严重的错误,在正常情况下不应该发生。

其他答案建议使用:

aptdcon --fix-install

这可能会导致您必须重新安装一些其他软件包 - 请参阅其他答案以获取更多详细信息。


看到你更新的信息后,看起来这就是提到的 samba 问题这里这里升级/重新安装 samba 可能会中断登录(包括 sudo)。

它描述了错误报告

因此,您可以尝试清除所有与 Samba 相关的软件包,然后重新安装 Samba(如果需要,或者直接将其完全删除)。具体来说,您需要清除libpam-smbpass

因为您不能使用 sudo,所以您需要通过单用户模式执行此操作,Ubuntu 在启动屏幕上通过“恢复模式”提供该模式。

引用该错误报告:

- Reboot and choose the "recovery mode" from the boot selection menu
- Choose "drop into root shell" from the recovery menu
- Execute the command: dpkg --purge libpam-smbpass

相关内容