Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: A simple way to connect to Ethernet from the command line?

  1. #1
    Join Date
    Jan 2011
    Beans
    30

    A simple way to connect to Ethernet from the command line?

    Hi everyone. I’ve dug myself into a bit of a hole and I’d really appreciate some help. I’m running Ubuntu with KDE, 64 bit and would describe myself as beginner-intermediate. Here’s what happened:

    For no reason at all a load of applications uninstalled themselves. After some research I found out I needed to install a specific component of the ‘Policykit’ package (which as it turns out, I probably already had). Installing this then created a situation where I had to choose which user (my own name duplicated twice) must give permissions to update etc. This was a small problem that I could have lived with but I stupidly tried to fix it by uninstalling Policykit. Little did I know that this would make my OS unbootable.

    So now when I boot I get a message saying I can’t log in (sorry I don’t know the exact message as I’m away from the computer right now). But the long and the short of it is that I need to repair from BASH and here’s where I’m having problems.

    When I try to ‘apt-get install update’ or ‘install policykit’ from the command line it ‘fails’ to retrieve the package. I’m fairly sure this is because I’m not connected to the Internet – would this be right?

    So…

    Can someone talk me through connecting to my Ethernet from the command line? I’m hoping I don’t need to create/edit config files because this will take me to the limits of my understanding. But I can do that if need be. I basically just need a temporary fix in order to briefly connect to the Internet, install policykit and be able to boot into my nice comfortable KDE environment so that I can do everything with GUIs rather than commands.

    Thanks in advance.

  2. #2
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: A simple way to connect to Ethernet from the command line?

    hi
    as i understand - you have a terminal to type in commands - wright ?
    if that's true try on the command line the command: ifconfig
    did this command shows you a line like:
    inet Adresse:192.168.2.xxx Bcast:192.168.2.255 Maske:255.255.255.0
    if you see this line - you are conected to the internet.
    if not try: ifdow and then ifup
    try: ifconfig again. whats the result now.
    if you got an IP then you can use: sudo apt-get what_you_need
    much luck
    ciao
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

  3. #3
    Join Date
    Jan 2011
    Beans
    30

    Re: A simple way to connect to Ethernet from the command line?

    Thanks rnerwein - I think that's going to help and I'll try it out this evening when I'm home from work.

    Like your signature by the way!

  4. #4
    Join Date
    Jan 2011
    Beans
    30

    Re: A simple way to connect to Ethernet from the command line?

    Quote Originally Posted by rnerwein View Post
    hi
    as i understand - you have a terminal to type in commands - wright ?
    if that's true try on the command line the command: ifconfig
    did this command shows you a line like:
    inet Adresse:192.168.2.xxx Bcast:192.168.2.255 Maske:255.255.255.0
    if you see this line - you are conected to the internet.
    if not try: ifdow and then ifup
    try: ifconfig again. whats the result now.
    if you got an IP then you can use: sudo apt-get what_you_need
    much luck
    ciao
    Hey, I tried this with no luck. ifconfig shows this:

    Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    (... a load of other info - should I post it all?)

    There is no 'Bcast' address and still no connection. When I type ifdown -a and ifup -a I get no feedback at all, Any ideas?

  5. #5
    Join Date
    Jan 2011
    Beans
    30

    Re: A simple way to connect to Ethernet from the command line?

    I've now got the 'Bcast' IP address yet when I ping google it says 'unknown host'. Do I need to set up a route host and all that stuff?

  6. #6
    Join Date
    May 2010
    Location
    Tewkesbury uk
    Beans
    7,617
    Distro
    Ubuntu Development Release

    Re: A simple way to connect to Ethernet from the command line?

    Hi

    Packages don't generally uninstall themselves unless there are dependency issues. That will need some investigation.

    Have you looked at reinstalling policy kit from the pool in a Ubuntu CD/USB ?

    Can someone talk me through connecting to my Ethernet from the command line?
    Let's get some information first about the state of your system, post the output of these commands in their entirety.

    From the terminal: Take and upload photos if you find that easier.

    Code:
    cat /sys/class/net/eth0/carrier
    ifconfig
    service network-manager status
    route
    and then

    Code:
    dpkg -l | grep policykit
    dpkg -l | grep polkit
    With this information, we should be able to see where you are. We will not be working blind.

    Kind regards
    Join us on irc at #ubuntuforums. For web chat see here

    If you believe everything you read, you better not read. ~ Japanese Proverb

    Do not read newspapers on an empty stomach ~ Russian Proverb ~ BrunoLotse

  7. #7
    Join Date
    Jan 2011
    Beans
    30

    Re: A simple way to connect to Ethernet from the command line?

    Quote Originally Posted by matt_symes View Post
    Code:
    cat /sys/class/net/eth0/carrier
    ifconfig
    service network-manager status
    route
    Code:
    dpkg -l | grep policykit
    dpkg -l | grep polkit
    Many thanks Matt. As follows:

    cat /sys/class/net/eth0/carrier
    1
    ifconfig
    eth0 Link encap:Ethernet HWaddr 00:24:8c:91:0c:0e
    inet addr:127.0.0.0 Bcast:127.255.255.255 Mask: 255.0.0.0
    inet6 addr: fe80::224:8cff:fe91:c0e/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX Packets:9 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:756 (756.0 B) TX bytes:4300 (4.3 KB)
    Interrupt:43 Base address:0xa000

    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:16436 Metric:1
    RX Packets:28 errors:0 dropped:0 overruns:0 frame:0
    TX Packets:28 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:2184 (2.1 KB) TX bytes:2184 (2.1 KB)

    service network-manager status
    network-manager start/running

    route
    Kernel IP routing table
    Destination....... Gateway....... Genmask .....Flags...... Metric...... Ref..... Use........ Iface
    default.............. 127.0.0.0 ......0.0.0.0 .........UG .........0 .............0......... 0............ eth0

  8. #8
    Join Date
    May 2010
    Location
    Tewkesbury uk
    Beans
    7,617
    Distro
    Ubuntu Development Release

    Re: A simple way to connect to Ethernet from the command line?

    Hi

    You have an Ethernet connection to the router so that is good.

    Let's try to get you an IP address.

    At the terminal type

    Code:
    sudo dhclient eth0
    Post back on the output and the results of (after the command above)
    Code:
    ifconfig
    ping -c 2 8.8.8.8
    nslookup www.bbc.co.uk
    If that does not work then type

    Code:
    sudo service network-manager stop
    and repeat the above commands.

    EDIT: Also post the output of

    Code:
    ls /usr/share/polkit-1/actions/org.freedesktop.NetworkManager.policy
    EDIT 2:

    You forgot to post the output of these two commands

    Code:
    dpkg -l | grep policykit
    dpkg -l | grep polkit
    EDIT 3:

    Can you also post the output of

    Code:
    grep ".*[0-9] remove" /var/log/dpkg.log
    Kind regards
    Last edited by matt_symes; April 10th, 2013 at 11:22 PM.
    Join us on irc at #ubuntuforums. For web chat see here

    If you believe everything you read, you better not read. ~ Japanese Proverb

    Do not read newspapers on an empty stomach ~ Russian Proverb ~ BrunoLotse

  9. #9
    Join Date
    Jan 2011
    Beans
    30

    Re: A simple way to connect to Ethernet from the command line?

    Thanks again Matt. Yes I realised this morning I forgot to post the output of:

    dpkg -l | grep policykit
    dpkg -l | grep polkit


    Unfortunately I'm at work away from my Ubuntu system so I'll get back to you this evening with the output.

  10. #10
    Join Date
    Jan 2011
    Beans
    30

    Re: A simple way to connect to Ethernet from the command line?

    Hi Matt. After doing the 'dhclient eth0' thing...

    ifconfig
    eth0 Link encap:Ethernet HWaddr 00:24:8c:91:0c:0e
    inet addr:127.0.0.0 Bcast:127.255.255.255 Mask: 255.0.0.0
    inet6 addr: fe80::224:8cff:fe91:c0e/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX Packets:24 errors:0 dropped:0 overruns:0 frame:0
    TX Packets:40 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:2858 (2,8 KB) TX bytes:8718 (8.7 KB)
    Interrupt:43 Base address:0xc000

    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:16436 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 B) TX bytes:0 (0 KB)
    ping 2 8.8.8.8
    PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
    64 bytes from 8.8.8.8: icmp_req=1 ttl=44 time=41.4 ms
    64 bytes from 8.8.8.8: icmp_req=2 ttl=44 time=36.3 ms

    --- 8.8.8.8 ping statistics ---
    2 packets transmitted, 2 received, 0% packet loss, time 1001ms
    rtt min/avg/max/mdev = 36.366/38.899/41.432/2.533 ms


    nslookup www.bbc.co.uk
    Server: 192.168.1.254
    Address: 192.168.1.254#53

    Non-authoritative answer:
    www.bbc.co.uk canonical name = www.bbc.net.uk
    Name: www.bbc.net.uk
    Address: 212.58.244.70


    ls /usr/share/polkit-1/actions/org.freedesktop.NetworkManager.policy
    ls: cannot access /usr/share/polkit-1/actions/org.freedesktop.NetworkManager.policy: No such file or directory


    dpkg -l | grep policykit
    rc policykit-1...........................................0.104-1ubuntu+fixed1..................(I assume you don't need the description)
    rc policykit-1-gnome................................0.105-1ubuntu3.1................
    ii policykit-1-desktop-privileges.................0.10..................

    dpkg -l | grep polkit
    rc lib32polkit................................0.96-0~ppa1................
    rc lib32polkit-qt................................0.95.1-0~ppa2................
    rc libpolkit-agent-1-0................................0.104-1ubuntu1+fixed1................
    rc libpolkit-backend-1-0................................0.104-1ubuntu1+fixed1................
    rc libpolkit-gobject-1-0................................0.104-1ubuntu1+fixed1................
    rc libpolkit-qt-1-0................................0.95.1-1fakesync1...............
    rc libpolkit-qt-1-1................................0.103.0-1...............
    rc libpolkit-kde-1................................0.99.0-3ubuntu5................

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •