Monday, March 3, 2014

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

For some of the package installation using apt-get i am getting 403 Forbidden error.

root@ip-172-32-14-23:~# apt-get install php5-gd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  fontconfig-config libfontconfig1 libgd2-xpm libt1-5 libxpm4 ttf-dejavu-core
Suggested packages:
  libgd-tools
The following packages will be REMOVED:
  libgd2-noxpm
The following NEW packages will be installed:
  fontconfig-config libfontconfig1 libgd2-xpm libt1-5 libxpm4 php5-gd ttf-dejavu-core
0 upgraded, 7 newly installed, 1 to remove and 7 not upgraded.
Need to get 169 kB/2,157 kB of archives.
After this operation, 4,277 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/main fontconfig-config all 2.8.0-3ubuntu9.1
  403  Forbidden
Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/main libfontconfig1 amd64 2.8.0-3ubuntu9.1
  403  Forbidden
Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/main/f/fontconfig/fontconfig-config_2.8.0-3ubuntu9.1_all.deb  403  Forbidden
Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/main/f/fontconfig/libfontconfig1_2.8.0-3ubuntu9.1_amd64.deb  403  Forbidden
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

FIX :
sudo vi /etc/apt/sources.list
Remove the entries us-west-1.ec2 as prefix:
Add the following in the file

deb http://us.archive.ubuntu.com/ubuntu lucid main multiverse universe
deb http://us.archive.ubuntu.com/ubuntu lucid-security main multiverse universe
deb http://us.archive.ubuntu.com/ubuntu lucid-updates main multiverse universe

sudo apt-get upgrade
Then i done my package installation with out any error
sudo apt-get install php5-gd

No comments:

Post a Comment