Ubuntu Server 15.10 cannot connect to internet and apt-get issue

5,537

If you are using apt-get install update it will try to install the update package, which i don't think is the desired action. Try apt-get update.

Share:
5,537

Related videos on Youtube

Jorge
Author by

Jorge

Updated on September 18, 2022

Comments

  • Jorge
    Jorge over 1 year

    So here is the issue, or one of them I should say. Ever since I installed Ubuntu Server 15.10 I haven't been able to connect to the internet, on that computer alone of course, even if I ping ip's they all give me Host Unreachable except for the computer itself of course. I've done many changes that I thought could help (got them online) but they didn't. Including changes to /etc/network/interfaces and therefore /etc/resolv.conf. Here's what that looks like now. (ip is different, dont know if i should show that to the public)

    /etc/network/interfaces:
    
    auto lo
    iface lo inet loopback
    
    auto enp0s25
    iface enp0s25 inet static
        address 192.168.23.17
        netmask 255.255.255.0
        broadcast 192.168.23.255
        gateway 192.168.23.1
    
        dns-nameserver 192.168.23.17
        dns-search cortex.com
    

    And in /etc/resolv.conf there's only one thing

    nameserver 192.168.23.17
    

    Command ifconfig appears like this:

    enp0s25   Link encap:Ethernet HWaddr 00:1e:c9:70:c7:f5
              inet addr:192.168.23.17 Bcast:192.168.23.255 Mask:255.255.255.0
              inet6 addr:feB0::21e:c9ff:fe70:c7f5/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
              RX packets:2721 errors:0 dropped:1 overruns:0 frame:0
              TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:215574 (215.5 KB) TX bytes:1064 (1.0 KB)
              Interrupt:21 Memory:fe9e0000-fea00000
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1 Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING MTU:65536 Metric:1
              RX packets:29442 errors:0 dropped:0 overruns:0 frame:0
              TX packets:29442 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:2339824 (2.3 MB) TX bytes:2339824 (2.3 MB)
    

    Also, i cant use sudo apt-get for anything, everytime i try it it just doesnt work:

    $ sudo apt-get install update
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Unable to locate package update
    

    Please help me out, im going crazy. If you feel like my problem is missing some info, just request it and ill provide it no problem, but please any insight on this will help. Thank you!!

    PROBLEM update: the issue has been solved, thanks to all the users that helped me solve this :) you helped a future computer scientist lol

    • MariusMatutiae
      MariusMatutiae about 8 years
      Can you ping 8.8.8.8?
    • Hastur
      Hastur about 8 years
      Welcome on SuperUser Jorge, please come back (maybe register yourself) and edit your post with the update. You have answers...and attempt to try. :)
    • Jorge
      Jorge about 8 years
      I did ping 8.8.8.8 before but it gives me Destination Host Unreachable, ive pinged pretty much everything, including gateway
  • Hastur
    Hastur about 8 years
    Good eyes, that command is not what the OP would like to do. I take for a OP typo in the question, but the answer of apt-get states at least one time he wrote :-). It is still possible that he is able to access to the repositories but not to internet eve if less probable...
  • Jorge
    Jorge about 8 years
    Thank you for the quick feedback :) ... ok so, here are all the results, all the pings give me Destination Host Unreachable except 192.168.23.17 which is the computer's ip... why would i need to check repositories? Im kinda new and need a few pointers regarding troubleshooting is quite difficult at this stage XD
  • Jorge
    Jorge about 8 years
    I tried that yes XD dude im going crazy trying to figure this out... soing sudo apt-get update gives me the same result as typing sudo apt-get install update :(
  • Hastur
    Hastur about 8 years
    @jorge: It means your computer is Up :-)... You still are not in need of checking the repositories. Ask to the network administrator confirm about the gw and dns of your subnet (23): they seems to be static. You can read something about it here. Basic questions: is the computer connected? is the cable plugged in both the sides and a good one? is the router turned on? I know silly questions but you have to test those too.
  • Jorge
    Jorge about 8 years
    Im going to answer the questions first. Yes the computer is connected, hardwired not wifi. The cable is in perfect condition, since i can in fact connect other computers to it and it works fine. The router is turned on and works, since i have internet on my laptop etc etc. and as for the network admin, i am the network admin i think lol not sure what you mean by that, its my home server, and yes they are static... wao thank you for that page, very helpful :))))) what does it mean tho, should i edit that so its dhcp? Thanks bud
  • Hastur
    Hastur about 8 years
    Do you have any other computer with the same IP (192.168.23.17) connected? Is 17 in the range of acceptable IP for the router (some routers are set to start from 100)? Which is the IP with which the laptop works when plugged to the same cable? Yes I know a lot of questions instead of only one answer, but this is the error seek procedure :)
  • Jorge
    Jorge about 8 years
    no that ip is unique to that computer in my network. Only two computers connected my laptop through wifi and the computer im having trouble with which is of course the server. And hmmm... im not sure how could i know if my router is set to start from that range? 100 that is
  • Hastur
    Hastur about 8 years
    It depends from the router model; check the manual. If the laptop one is 192.168.23.100 (confirm it) try to change your fixed Ip in 101 before and after in something higher. When you connect to administrate the router in the options is usually possible to see the range of allowable IPs...
  • Jorge
    Jorge about 8 years
    the ip for the laptop is 192.168.56.1
  • Hastur
    Hastur about 8 years
    so try to change all the 192.168.23.xxx in 192.168.56.xxx in the server.
  • Jorge
    Jorge about 8 years
    to change it, i would only have to edit /etc/network/interfaces correct? someone told me to try and change resolvconf directly and something related to NetworkManager, but it didnt work at all... so im just making sure im following your steps correctly
  • Hastur
    Hastur about 8 years
    Find the manual of your router. Read it and check how it is set. Which are (if there are) ranges of allowed IP, check on the allowed NETMASK. Usually you can access to the administration panel with a computer wired connected only (security) and the admin password. Please update your question with the IP of your laptop when wired and when wireless connected. It can help. And with DNS and Gw of laptop in both cases. Confirm that laptop is connecting in DHCP. If so in order to test the Linux hardware you can even configure the server with DHCP.
  • Jorge
    Jorge about 8 years
    ok so the range is from 2 to 100. the ip of my laptop stays the same. and no is not using dhcp... keep requests coming im happy to provide them :)
  • Hastur
    Hastur about 8 years
    If your laptop IP is 192.168.56.1 it means is on the subnet 192.168.56.xxx Your server is configured for a different subnet 192.168.23.xxx. It should be that. Please update your question with all the values (ip,gw,dns) of the working connected laptop. The way to edit the network setting vary from system to system. After you modified the files you need to restart the networking service. (e.g. sudo service networking restart). If you have some GUI (graphical program) that helps you, you will go more easy.
  • Jorge
    Jorge about 8 years
    one of the reasons im trying to connect so desperately is so i can install a GUI lol believe me, unless i can do that from a cd, but thats irrelevant at the moment. i will do what you suggested give me a few minutes to edit and get back to you
  • Alex
    Alex about 8 years
    Have you tried change the subnet as Hastur suggested? It's enough to change it in /etc/network/interfaces and then don't forget to service networking restart
  • Jorge
    Jorge about 8 years
    let me mention, im currently running tests on it, trying to gather info for you guys and trying to understand, anyway, the internet cable is orange, maybe it has nothing to do with this, the light is orange and it flashes yellow to the side a little
  • Jorge
    Jorge about 8 years
    also i noticed that with most people is eth0 and i have enp0s25, why is that? maybe the problem lays with the config and installation of the server? idk
  • Jorge
    Jorge about 8 years
    How can i reward you for assisting me, is it even possible? i just solved the problem thanks to you guys
  • Jorge
    Jorge about 8 years
    Hey thanks, the issue has been solved, and it wasnt the hardware it was just a configuration error, it was solved by editing /etc/network/interfaces and changing the ip, and dhcp. I was finally able to connect to the internet and install a GUI... Thank you
  • Hastur
    Hastur about 8 years
    Simple upvote all the answers you find useful and upvote and choose one as the solution.
  • Mokubai
    Mokubai about 8 years
    Comments are not for extended discussion; this conversation has been moved to chat.