尝试安装 apache,但显示“包 apache2 不可用”

De *_*end 2 apache2 software-installation php7

sudo apt 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
Run Code Online (Sandbox Code Playgroud)

pa4*_*080 5

大多数安装手册都推荐了在安装新软件包之前更新存储库和升级现有软件包的良好做法。所以尝试:

sudo apt update && sudo apt upgrade 
sudo apt install apache2
Run Code Online (Sandbox Code Playgroud)