E: O pacote 'apache2' não tem candidato de instalação no Ubuntu 17.10

2

Obteve o erro E: Package 'apache2' has no installation candidate ao instalar o apache2 com sudo apt-get install apache2 no Ubuntu 17.10. Aqui está a mensagem exibida no terminal.

sudo apt-get install apache2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package apache2 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 'apache2' has no installation candidate

Mensagem após o comando apt-cache policy apache2 .

apache2:
  Installed: (none)
  Candidate: (none)
  Version table:

Mensagem após o comando egrep -v '^#|^ *$' /etc/apt/sources.list /etc/apt/sources.list.d/*.list

/etc/apt/sources.list.d/linuxgndu-ubuntu-sqlitebrowser-artful.list:deb http://ppa.launchpad.net/linuxgndu/sqlitebrowser/ubuntu artful main
/etc/apt/sources.list.d/mongodb-org-3.6.list:deb [arch=amd64,arm64] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse
/etc/apt/sources.list.d/slack.list:deb https://packagecloud.io/slacktechnologies/slack/debian/ jessie main
/etc/apt/sources.list.d/sublime-text.list:deb https://download.sublimetext.com/ apt/stable/
/etc/apt/sources.list.d/vscode.list:deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main
/etc/apt/sources.list.d/webupd8team-ubuntu-java-artful.list:deb http://ppa.launchpad.net/webupd8team/java/ubuntu artful main

Como posso resolver este problema?

    
por Kiran Shahi 23.03.2018 / 16:43

2 respostas

4

O problema principal é perdido /etc/apt/sources.list . Você pode recriá-lo com:

cat <<EOF | sudo tee /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu artful main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu artful-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu artful-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu artful-backports main universe restricted multiverse
EOF

Em seguida, execute

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install apache2
    
por N0rbert 23.03.2018 / 17:57
2

Teste sudo apt-get update e, em seguida, sudo apt-get install apache2 . Eu recomendo instalar o LAMP Stack completo usando tasksel

sudo apt-get install tasksel

sudo tasksel para iniciá-lo Selecione o servidor LAMP e instale-o. Espero que ajude.

    
por Pranal Narayan 23.03.2018 / 17:28