I verified this fix in my personal EC2 account using the 64-bit instances in eu-west-1, us-east-1, and us-west-1.
# For each of these three groups, run the remainder of the commands
region=eu-west-1 amiid=ami-4fcfe43b type=m1.large
region=us-west-1 amiid=ami-c12c7d84 type=m1.large
region=us-east-1 amiid=ami-bb12ffd2 type=m1.large
# Add an ssh keypair for the region
ec2-add-keypair \ --region $region \ ec2-$region \ > ~/.ssh/ec2-$region.pem
# Run an instance and connect to it
instanceid=$(ec2-run-instances \ --region $region \ --instance-type $type \ --key ec2-$region \ $amiid | egrep ^INSTANCE | cut -f2) echo "instanceid=$instanceid"
while host=$(ec2-describe-instances --region $region "$instanceid" | egrep ^INSTANCE | cut -f4) && test -z $host; do echo -n .; sleep 1; done echo host=$host
ssh \ -i ~/.ssh/ec2-$region.pem \ ubuntu@$host
# Enable proposed and get fixed ec2-init
printf "%s %s %s %s\n" \ deb http://archive.ubuntu.com/ubuntu/ karmic-proposed main | sudo tee -a /etc/apt/sources.list
sudo apt-get update && sudo apt-get install ec2-init
# Let defaults be run on next reboot and reboot
sudo rm -f /var/lib/ec2/ec2-defaults.ever
sudo reboot
# Connect to the instance again
# Verify archive host matches $region and test accessibility
cat /etc/apt/sources.list
sudo apt-get update && sudo apt-get upgrade -y
exit
# Kill the instance
ec2-terminate-instances --region $region $instanceid
Here is a sample /etc/apt/sources.list from the instance in us-west-1 (which had the original problem):
deb http://eu-west-1.ec2.archive.ubuntu.com/ubuntu/ karmic main universe deb-src http://eu-west-1.ec2.archive.ubuntu.com/ubuntu/ karmic main universe deb http://eu-west-1.ec2.archive.ubuntu.com/ubuntu/ karmic-updates main universe deb-src http://eu-west-1.ec2.archive.ubuntu.com/ubuntu/ karmic-updates main universe deb http://security.ubuntu.com/ubuntu karmic-security main universe deb-src http://security.ubuntu.com/ubuntu karmic-security main universe
I verified this fix in my personal EC2 account using the 64-bit instances in eu-west-1, us-east-1, and us-west-1.
# For each of these three groups, run the remainder of the commands
region=eu-west-1 ami-4fcfe43b
amiid=
type=m1.large
region=us-west-1 ami-c12c7d84
amiid=
type=m1.large
region=us-east-1 ami-bb12ffd2
amiid=
type=m1.large
# Add an ssh keypair for the region
ec2-add-keypair \ ec2-$region. pem
--region $region \
ec2-$region \
> ~/.ssh/
# Run an instance and connect to it
instanceid= $(ec2-run- instances \ $instanceid"
--region $region \
--instance-type $type \
--key ec2-$region \
$amiid |
egrep ^INSTANCE | cut -f2)
echo "instanceid=
while host=$( ec2-describe- instances --region $region "$instanceid" |
egrep ^INSTANCE | cut -f4) && test -z $host; do echo -n .; sleep 1; done
echo host=$host
ssh \ ec2-$region. pem \
-i ~/.ssh/
ubuntu@$host
# Enable proposed and get fixed ec2-init
printf "%s %s %s %s\n" \ archive. ubuntu. com/ubuntu/ karmic-proposed main | sources. list
deb http://
sudo tee -a /etc/apt/
sudo apt-get update && sudo apt-get install ec2-init
# Let defaults be run on next reboot and reboot
sudo rm -f /var/lib/ ec2/ec2- defaults. ever
sudo reboot
# Connect to the instance again
ssh \ ec2-$region. pem \
-i ~/.ssh/
ubuntu@$host
# Verify archive host matches $region and test accessibility
cat /etc/apt/ sources. list
sudo apt-get update && sudo apt-get upgrade -y
exit
# Kill the instance
ec2-terminate -instances --region $region $instanceid
Here is a sample /etc/apt/ sources. list from the instance in us-west-1 (which had the original problem):
deb http:// eu-west- 1.ec2.archive. ubuntu. com/ubuntu/ karmic main universe eu-west- 1.ec2.archive. ubuntu. com/ubuntu/ karmic main universe eu-west- 1.ec2.archive. ubuntu. com/ubuntu/ karmic-updates main universe eu-west- 1.ec2.archive. ubuntu. com/ubuntu/ karmic-updates main universe security. ubuntu. com/ubuntu karmic-security main universe security. ubuntu. com/ubuntu karmic-security main universe
deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://