I have just bought a new digital ocean Ubuntu droplet and configured it as an Apache server but when I was installing phpmyadmin package my ssh session suddenly shut down and so the download and install was interrupted. Since then whenever I try to download anything using apt i get this error

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.

I tried to install aptitude to fix this problem but then i received this error

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

I tried all the commands of apt-get update , apt-get upgrade

I would be glad to know how to solve this as I really need to install send mail

My question isn't like the others as it is asking about the version 16.04 of Ubuntu and i tried all the possible answers

  • This certainly sounds strange. Can you copy and paste the commands you've been typing to try to solve the problem, including the apt-gets? May 31 '17 at 15:53
  • apt-get update and apt-get upgrade and apt-get -f install and sudo apt-get update --fix-missing and dpkg --get-selections | grep hold which gave no output and May 31 '17 at 15:57
  • it is added in the title as 16.04 May 31 '17 at 15:59
  • I tried all the answers in the link supplied and they all failed to solve the problem May 31 '17 at 16:00
  • Are you able to rebuild the server? It's a little bit of an evolution of 'try switching it off and on again' but if there's nothing critical on there, this might be your quickest and most lasting fix option. Also, have you tried rebooting the server? May 31 '17 at 17:25

Just completely remove the the broken apache2 and reinstall.

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

  • well actually i tried this and it broke my server as the problem isn't with Apache it got removed but when trying to install it back he says it has no installation candidate May 31 '17 at 15:59
  • If its apache you want to install, have you tried wget the dpkg from apache download and installing via dpkg?
    – saviour123
    May 31 '17 at 16:02
  • Apache is not the target but after this answer i had to delete Apache and cant reinstall it May 31 '17 at 16:04
  • i tried using dpkg but it also fails May 31 '17 at 16:04
  • And the final one before i delete my answer. Have you restarted your server? have you tried installing some other package and it works?
    – saviour123
    May 31 '17 at 16:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.