Tuesday, June 18, 2013

apt-get install gives 403 Forbidden on Ubuntu 12.04 LTS EC2 Instance

I was unable to use apt-get install to install nginx on a fresh Ubuntu 12.04 LTS EC2 instance. Apt-get was returning 403 Forbidden for the ec2 ubuntu connections.

The error looked like:

 Reading package lists... Done  
 Building dependency tree  
 Reading state information... Done  
 The following extra packages will be installed:  
  libgd2-noxpm libjpeg-turbo8 libjpeg8 libxslt1.1 nginx-common nginx-full  
 Suggested packages:  
  libgd-tools  
 The following NEW packages will be installed:  
  libgd2-noxpm libjpeg-turbo8 libjpeg8 libxslt1.1 nginx nginx-common nginx-full  
 0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.  
 Need to get 403 kB/882 kB of archives.  
 After this operation, 2,691 kB of additional disk space will be used.  
 Do you want to continue [Y/n]? y  
 Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/universe nginx-common all 1.1.19-1ubuntu0.1  
  403 Forbidden  
 Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/universe nginx-full amd64 1.1.19-1ubuntu0.1  
  403 Forbidden  
 Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/universe nginx all 1.1.19-1ubuntu0.1  
  403 Forbidden  
 Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/universe/n/nginx/nginx-common_1.1.19-1ubuntu0.1_all.deb 403 Forbidden  
 Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/universe/n/nginx/nginx-full_1.1.19-1ubuntu0.1_amd64.deb 403 Forbidden  
 Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/universe/n/nginx/nginx_1.1.19-1ubuntu0.1_all.deb 403 Forbidden  
 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?  

The solution was to run update on apt-get

 sudo apt-get update  

For more details, see: https://bugs.launchpad.net/ubuntu/+bug/987182

No comments:

Post a Comment