3

I was trying to install re2c but terminal replies the following:

sudo apt-get install re2c
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  re2c
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 202 kB of archives.
After this operation, 385 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  re2c
Install these packages without verification? [y/N] y
Err http://mirrordirector.raspbian.org/raspbian/ jessie/main re2c armhf 0.13.5-1
  Cannot initiate the connection to mirrordirector.raspbian.org:80 (2001:41c9:1:3ce::11). - connect (101: Network is unreachable) [IP: 2001:41c9:1:3ce::11 80]
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/r/re2c/re2c_0.13.5-1_armhf.deb  Cannot initiate the connection to mirrordirector.raspbian.org:80 (2001:41c9:1:3ce::11). - connect (101: Network is unreachable) [IP: 2001:41c9:1:3ce::11 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Note: I have an internet connection and the browser is working easily. The only problem is with apt-get.

How can I resolve this?

3
  • 2
    This may be a temporary situtation. I am also assuming that you have run apt-get update or with --fix-missing as mentoned in the error message. Commented Feb 1, 2016 at 7:29
  • @SteveRobillard, he probably did, re2c_0.13.5-1_armhf.deb is the actual version at the time of writing. Commented Oct 5, 2016 at 16:06
  • Any time I have seen this I just try again later.
    – SDsolar
    Commented Jun 2, 2017 at 17:44

5 Answers 5

4

If this isn't a transitory problem with the server in question, you may be in a situation where IPv6 isn't being routed for you. In that case, you could force IPv4 routing per ethanol100's instructions in this forum post: https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=125231

sudo apt-get update -o Acquire::ForceIPv4=true

If that works, you can make it permanent by adding this as /etc/apt/apt.conf.d/99force-ipv4:

Acquire::ForceIPv4 "true";
2

Sometimes (but not rarely), raspbian.org goes out of service. If you really can't wait, I suggest replacing it or adding another mirror.

You can completely replace your /etc/apt/sources.list file with the one below. I think the file is self-explanatory.

Make sure to run apt-get update after you update the source list.

# THIS IS THE DEFAULT ENTRY.
# To replace this, comment it out (add a # at the beginning). 
# Make sure to enable at least one other entry from the list below if you 
# decide to disable this one.
# Its okay to enable more than one mirror.
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi

# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

# MIRRORS BELOW.
# Uncomment a line (remove the #) to use it as a mirror.
# Take note I am using Raspbian Jessie. Change yours accordingly.
# -PANDALION98

#EUROPE
#deb http://mirror.ox.ac.uk/sites/archive.raspbian.org/archive/raspbian jessie main contrib non-free rpi
#deb http://raspbian.insideelectronics.co.uk/raspbian/ jessie main contrib non-free rpi
#deb http://raspbian.lag.re/raspbian jessie main contrib non-free rpi

#NORTH AMERICA
#deb http://mirror.nexcess.net/raspbian/raspbian/ jessie main contrib non-free rpi
#deb http://mirror.glennmcgurrin.com/raspbian/ jessie main contrib non-free rpi

#SOUTH AMERICA
#deb http://raspbian.ufms.br/raspbian/ jessie main contrib non-free rpi
#deb http://raspbian.c3sl.ufpr.br/raspbian/ jessie main contrib non-free rpi

#ASIA
#deb http://mirror.devunt.kr/raspbian/raspbian/ jessie main contrib non-free rpi
#deb http://mirror.rise.ph/raspbian/raspbian/ jessie main contrib non-free rpi
1

It's possible that it's trying to get to an out of date mirror?

Sudo apt-get update
Sudo apt-get upgrade

Then try again?

1
  • 1
    re2c_0.13.5-1_armhf.deb is the newest version of the package at the moment. Also, apt-get upgrade will certainly not help here and might do something the OP doesn't want. Commented Oct 5, 2016 at 16:09
0

It may be that the pi is not connected to the internet. To confirm internet connectivity, do the following (from a command prompt):

ping google.com

The response should look something like the following if you have internet connectivity:

PING google.com (74.125.24.139) 56(84) bytes of data.
64 bytes from de (74.125.24.139): icmp_seq=1 ttl=50 time=23.9 ms
64 bytes from de (74.125.24.139): icmp_seq=2 ttl=50 time=17.1 ms

If you get no response from the ping, then you need to check your pi internet connection. You could start here: https://learn.adafruit.com/downloads/pdf/adafruits-raspberry-pi-lesson-3-network-setup.pdf

1
  • The OP is using IPv6 (so he won't see the same thing as you), and he also says his browser is working fine. Commented Oct 5, 2016 at 16:04
0

This is usually caused when raspbian.org is down.

Please use one of the alternate Raspbian Respository Mirrors that is close to you from here: http://www.raspbian.org/RaspbianMirrors. Check the Issues column to avoid using the mirror that has known issues.

Edit /etc/apt/sources.list file with elevated permissions. Example:

sudo vim /etc/apt/sources.list

Comment out original server URL and add new line with the mirror URL as follows (just an example):

# deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
deb http://mirror.aarnet.edu.au/pub/raspbian/raspbian/ buster main contrib non-free rpi

Save file.

Now run the following commands:

sudo apt update -y
sudo apt --fix-missing upgrade -y

Now try installing what you were trying to install.

sudo apt install re2c

Hope it works for you. It did for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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