无法在 Ubuntu 16.04 上安装任何软件包

无法在 Ubuntu 16.04 上安装任何软件包

我刚刚购买了一个新的 digital ocean Ubuntu droplet 并将其配置为 Apache 服务器,但当我安装 phpmyadmin 包时,我的 ssh 会话突然关闭,因此下载和安装被中断。从那时起,每当我尝试使用 apt 下载任何东西时,我都会收到此错误

The following packages have unmet dependencies:
 sendmail : Depends: sendmail-base but it is not going to be installed
            Depends: sendmail-bin but it is not going to be installed
            Depends: sendmail-cf but it is not going to be installed
            Depends: sensible-mda but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我尝试安装 aptitude 来修复这个问题,但随后我收到了这个错误

Package aptitude is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'aptitude' has no installation candidate

我尝试了 apt-get update 、 apt-get upgrade 的所有命令

我很高兴知道如何解决这个问题,因为我确实需要安装发送邮件

我的问题与其他问题不同,因为它询问的是 Ubuntu 16.04 版本,我尝试了所有可能的答案

答案1

只需完全删除损坏的 apache2 并重新安装即可。

sudo apt-get purge apach2* && sudo apt-get update && sudo apt-get install apache2

相关内容