Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a new VM in GCE in zone asia-northeast1-a. I need to install a g++ compiler.

When I run apt-get I get the following error message:

$ sudo apt-get install g++ 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  binutils cpp cpp-6 g++-6 gcc gcc-6 libasan3 libatomic1 libc-dev-bin libc6-dev libcc1-0 libcilkrts5 libgcc-6-dev
  libgomp1 libisl15 libitm1 liblsan0 libmpc3 libmpx2 libquadmath0 libstdc++-6-dev libtsan0 libubsan0
  linux-libc-dev manpages-dev
Suggested packages:
  binutils-doc cpp-doc gcc-6-locales g++-multilib g++-6-multilib gcc-6-doc libstdc++6-6-dbg gcc-multilib make
  autoconf automake libtool flex bison gdb gcc-doc gcc-6-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg
  libatomic1-dbg libasan3-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx2-dbg
  libquadmath0-dbg glibc-doc libstdc++-6-doc
The following NEW packages will be installed:
  binutils cpp cpp-6 g++ g++-6 gcc gcc-6 libasan3 libatomic1 libc-dev-bin libc6-dev libcc1-0 libcilkrts5
  libgcc-6-dev libgomp1 libisl15 libitm1 liblsan0 libmpc3 libmpx2 libquadmath0 libstdc++-6-dev libtsan0 libubsan0
  linux-libc-dev manpages-dev
0 upgraded, 26 newly installed, 0 to remove and 0 not upgraded.
Need to get 876 kB/34.3 MB of archives.
After this operation, 147 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Err:1 http://asia-northeast1-a.gce.clouds.archive.ubuntu.com/ubuntu yakkety-updates/main amd64 linux-libc-dev amd64
 4.8.0-32.34
  404  Not Found [IP: 91.189.88.152 80]
Err:1 http://security.ubuntu.com/ubuntu yakkety-security/main amd64 linux-libc-dev amd64 4.8.0-32.34
  404  Not Found [IP: 91.189.88.152 80]
Unable to correct missing packages.
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_4.8.0-32.34_amd64.deb  404  N
ot Found [IP: 91.189.88.152 80]
E: Aborting install.

Even with the --fix-missing flag I get the same error message.

How can I resolve this?

share|improve this question
up vote 5 down vote accepted

Your apt database on the machine is out-of-date, and does not reflect the current state of the apt repo it's pointing at. You need to run apt-get update before installing the package.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.