sudo apt-get install apache2 on ec2 instace type: ami-e0efab



我创建了一个 ec2 实例 debian-wheezy-amd64-hvm-2015-01-28-ebs (ami-e0efab88)

aws ec2 run-instances --image-id myimage --security-group-ids mysecuritygroup --count 1 --instance-type t2.micro --key-name mykey --query 'Instances[0].InstanceId'

然后连接到它并尝试在其上安装 Apache2

sudo apt-get install apache2

得到以下

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package apache2

注意:创建 GCE 实例debian-7-wheezy-v20131014并运行相同的命令可以完美运行

我错过了什么?

注释中所述,规则始终是运行

sudo apt-get update

在使用 apt-get 软件包安装任何软件之前

最新更新