hushki
Posts: 5
Joined: Mon Aug 17, 2015 12:48 pm
Location: Cardiff, UK

Unable to apt-get

Mon Aug 17, 2015 1:19 pm

I have got a Raspberry Pi 2 Model B and a Raspberry Pi 1 Model B. So I plugged a fresh SD card into the Pi 2 model B with Raspbian. It brings me to raspi-config where I extended, overclocked and finish. After this I proceeded to setting up a static IP so I can connect via ssh from my desktop PC.

Code: Select all

sudo nano /etc/network/interfaces

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.11
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

sudo reboot
Afterwards I'm able to connect via ssh without problem. The issue I'm getting is running "sudo apt-get update". Basically It will NOT connect at all. Just stuck at 0% and nothing more.
I google'd around and found information about dns-nameservers therefore I proceeded to updating the interfaces by adding

Code: Select all

dns-nameservers 192.168.0.1 8.8.8.8 8.8.4.4
but I'm still having issues, I do not understand what is going on.
Screenshots:
Image
Eventually (about 2-3minutes) this will lead to a connection timed out.
Some more information:
The sd card is 32gb.
There is a light at the ethernet port.
I did edit the sources.list since the original did not work but I did not remove the original source.
I'm unable to ping 8.8.8.8 OR google.com
There is no issue when pinging my gateway (192.168.0.1)
I've tested the cable on a different computer and it works perfectly.
Funny thing is that I'm able to put the same sd card into my Raspberry Pi 1 Model B with the same ethenet cable and it will be able to sudo apt-get update without a problem
UNAME -a

Code: Select all

Linux raspberrypi 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l GNU/Linux
IFCONFIG:

Code: Select all

eth0      Link encap:Ethernet  HWaddr 
          inet addr:192.168.0.11  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2891 errors:0 dropped:1 overruns:0 frame:0
          TX packets:1095 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:159627 (155.8 KiB)  TX bytes:205886 (201.0 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

IP ADDR:

Code: Select all

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.11/24 brd 192.168.0.255 scope global eth0
       valid_lft forever preferred_lft forever

I apologize that this is a long post but I've already spent hours trying to get this issue solved by browsing the internet for information.
Please help if possible,
Thank you

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Unable to apt-get

Mon Aug 17, 2015 1:32 pm

Yesterday mirror director.Raspbian.org was as dead as a dodo due to a hardware failure. It may have failed again.

Try
sudo apt-get update
again, if it fails again give it a few hours, then try again.

I'm assuming your RPi is able to access other internet resources.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

hushki
Posts: 5
Joined: Mon Aug 17, 2015 12:48 pm
Location: Cardiff, UK

Re: Unable to apt-get

Mon Aug 17, 2015 1:37 pm

Thanks for the reply DougieLawson.
I do not think the pi is able to connect to other resources since I'm not able to ping anything apart from local ip addresses. The ethernet cable is plugged in and is working.

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Unable to apt-get

Mon Aug 17, 2015 1:44 pm

Check your routing is set correctly (your interfaces file looks to be ok).

Code: Select all

pi@raspi3 ~ $ ip route
default via 192.168.1.1 dev eth0 
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.28 

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: Unable to apt-get

Mon Aug 17, 2015 1:46 pm

hushki wrote: 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether brd ff:ff:ff:ff:ff:ff
inet 192.168.0.11/24 brd 192.168.0.255 scope global eth0
valid_lft forever preferred_lft forever
i not understand networks, but mine looks different, here i see a ethernet MAC
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether b8:27:eb:6e:15:fc brd ff:ff:ff:ff:ff:ff
inet 192.168.1.102/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
does that mean anything?

hushki
Posts: 5
Joined: Mon Aug 17, 2015 12:48 pm
Location: Cardiff, UK

Re: Unable to apt-get

Mon Aug 17, 2015 1:55 pm

rpdom wrote:Check your routing is set correctly (your interfaces file looks to be ok).

Code: Select all

pi@raspi3 ~ $ ip route
default via 192.168.1.1 dev eth0 
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.28 
This is my route

Code: Select all

pi@raspberrypi ~ $ ip route
default via 192.168.0.1 dev eth0
default via 192.168.0.1 dev eth0  metric 202
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.11  metric 202
KLL wrote:
hushki wrote: 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether brd ff:ff:ff:ff:ff:ff
inet 192.168.0.11/24 brd 192.168.0.255 scope global eth0
valid_lft forever preferred_lft forever
i not understand networks, but mine looks different, here i see a ethernet MAC
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether b8:27:eb:6e:15:fc brd ff:ff:ff:ff:ff:ff
inet 192.168.1.102/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
does that mean anything?
There was a mac address in there. It was just removed when I copy and pasted it.

plugwash
Forum Moderator
Forum Moderator
Posts: 3630
Joined: Wed Dec 28, 2011 11:45 pm

Re: Unable to apt-get

Mon Aug 17, 2015 2:02 pm

Is your desktop running windows or linux?

if the former what is the output of "ipconfig /all" on your desktop ?
if the latter what is the output of "route -n" on your desktop?

hushki
Posts: 5
Joined: Mon Aug 17, 2015 12:48 pm
Location: Cardiff, UK

Re: Unable to apt-get

Mon Aug 17, 2015 2:11 pm

plugwash wrote:Is your desktop running windows or linux?

if the former what is the output of "ipconfig /all" on your desktop ?
if the latter what is the output of "route -n" on your desktop?
My desktop is windows and I'm using putty.

Code: Select all

ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : DESKTOP-09JF5SR
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Ethernet:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Realtek PCIe GBE Family Controller
   Physical Address. . . . . . . . . : 40-16-7E-2A-46-BE
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Wireless LAN adapter Local Area Connection* 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual Adapter
   Physical Address. . . . . . . . . : 00-E0-4C-81-BD-90
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Ethernet adapter Ethernet 2:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : VirtualBox Host-Only Ethernet Adapter
   Physical Address. . . . . . . . . : 0A-00-27-00-00-00
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::11f0:46c3:bd01:1064%7(Preferred)
   Autoconfiguration IPv4 Address. . : 169.254.16.100(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . :
   DHCPv6 IAID . . . . . . . . . . . : 185204775
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1D-4A-90-EF-40-16-7E-2A-46-BE
   DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                       fec0:0:0:ffff::2%1
                                       fec0:0:0:ffff::3%1
   NetBIOS over Tcpip. . . . . . . . : Enabled

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Realtek RTL8192EU Wireless LAN 802.11n USB 2.0 Network Adapter
   Physical Address. . . . . . . . . : 00-E0-4C-81-BD-90
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::b16b:143b:7db7:5607%10(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.0.12(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : 17 August 2015 12:11:11
   Lease Expires . . . . . . . . . . : 18 August 2015 12:11:14
   Default Gateway . . . . . . . . . : 192.168.0.1
   DHCP Server . . . . . . . . . . . : 192.168.0.1
   DHCPv6 IAID . . . . . . . . . . . : 167829580
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1D-4A-90-EF-40-16-7E-2A-46-BE
   DNS Servers . . . . . . . . . . . : 192.168.0.1
   NetBIOS over Tcpip. . . . . . . . : Enabled
I tried route -n but there was nothing. Instead here is route print

Code: Select all

C:\Windows\system32>route print
===========================================================================
Interface List
  9...40 16 7e 2a 46 be ......Realtek PCIe GBE Family Controller
  6...00 e0 4c 81 bd 90 ......Microsoft Wi-Fi Direct Virtual Adapter
  7...0a 00 27 00 00 00 ......VirtualBox Host-Only Ethernet Adapter
 10...00 e0 4c 81 bd 90 ......Realtek RTL8192EU Wireless LAN 802.11n USB 2.0 Network Adapter
  1...........................Software Loopback Interface 1
  5...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
  4...00 00 00 00 00 00 00 e0 Microsoft Teredo Tunneling Adapter
  8...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.0.1     192.168.0.12     25
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
      169.254.0.0      255.255.0.0         On-link    169.254.16.100    266
   169.254.16.100  255.255.255.255         On-link    169.254.16.100    266
  169.254.255.255  255.255.255.255         On-link    169.254.16.100    266
      192.168.0.0    255.255.255.0         On-link      192.168.0.12    281
     192.168.0.12  255.255.255.255         On-link      192.168.0.12    281
    192.168.0.255  255.255.255.255         On-link      192.168.0.12    281
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link      192.168.0.12    281
        224.0.0.0        240.0.0.0         On-link    169.254.16.100    266
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link      192.168.0.12    281
  255.255.255.255  255.255.255.255         On-link    169.254.16.100    266
===========================================================================
Persistent Routes:
  None

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
  4    306 ::/0                     On-link
  1    306 ::1/128                  On-link
  4    306 2001::/32                On-link
  4    306 2001:0:5ef5:79fb:30e8:39e0:adf5:70a5/128
                                    On-link
 10    281 fe80::/64                On-link
  4    306 fe80::/64                On-link
  7    266 fe80::/64                On-link
  7    266 fe80::11f0:46c3:bd01:1064/128
                                    On-link
  4    306 fe80::30e8:39e0:adf5:70a5/128
                                    On-link
 10    281 fe80::b16b:143b:7db7:5607/128
                                    On-link
  1    306 ff00::/8                 On-link
 10    281 ff00::/8                 On-link
  4    306 ff00::/8                 On-link
  7    266 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None
Also here is the route -n from the pi

Code: Select all


pi@raspberrypi ~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
0.0.0.0         192.168.0.1     0.0.0.0         UG    202    0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     202    0        0 eth0
I'd also like to thank those who are helping me

hushki
Posts: 5
Joined: Mon Aug 17, 2015 12:48 pm
Location: Cardiff, UK

Re: Unable to apt-get

Tue Aug 18, 2015 6:42 pm

So it turns out the the pi was faulty. I replaced it and now there are no more problems.

Return to “Troubleshooting”