[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Connect to eth0 or wlan0 (NetworkManager from the command line?) - Wheezy

Kieran Smyth wrote:
> I'm using Debian Testing (Wheezy) on my netbook, & accidentally uninstalled
> gnome-panel, gnome-session, GDM3, & something else i can't quite remember
> right now. I thought it would be an easy fix using aptitude


> but i have no network connections anymore, & can't get into my
> Desktop Environment (well, i can... but it's a cursor & a blank
> screen).

Drat! :-)

> Now, without a GUI... i'm useless (and i hate that!).

In the beginning was the command line...

> If anyone could help me get connected using the wlan0 or eth0 interfaces i
> would really appreciate it. If this could be done using the command line,
> that would be ideal as i would love to know how it's done. I actually like
> it when things break as it helps me get to know the system i am using
> better.

Here is one recipe that I am sure will get you going.

Stop network-manager first.

  # service network-manager stop

Edit /etc/network/interfaces and set the following.  You can simply
uncomment the "#NetworkManager#iface eth0 inet dhcp" line.  See
for the details of that particular line.  See this next
for general information about that file.

  auto eth0
  allow-hotplug eth0
  iface eth0 inet dhcp

Plug in your ethernet wire.  Bring up the interface.

  # ifup eth0

You should be able to watch the progress by tailing the syslog in
another window.  (Hint: Alt-F2 gets you to the second virtual console
terminal.)  After it is up something like 'netstat -nr' should print
useful network information about the network.

At that point you should be up and on the network and can re-install
anything that you want.  That should get your system going.

The /var/log/dpkg.log could be useful in seeing what was recently
uninstalled.  Also /var/backups/ contains dpkg.status* and other files
that should allow you to know what was previously installed and
therefore be able to get back to a known good state.

  # apt-get install dctrl-tools

  $ grep-dctrl -s Package -n "install ok installed" /var/backups/dpkg.status.0
  ...dumps a list of previously installed packages...

  $ grep-status -s Package -n "install ok installed"
  ...dumps the current list of packages installed now...

Putting that information to use you can see what was different between
the backup file and now.

  $ grep-dctrl -s Package -n "install ok installed" /var/backups/dpkg.status.0 | sort > /tmp/list.prev

  $ grep-status -s Package -n "install ok installed" | sort > /tmp/list.now

  $ comm -3 /tmp/list.prev /tmp/list.now

And then inspecting that list make a decision about how to repair.

Whew!  That above is somewhat complicated.  But if you are in a hurry
then you probably you just need the following to pull in what you
lost.  These metapackages (and gdm I prefer over the gdm3) will
probably pull in what you need.  But the above would give you exact

  # apt-get install gnome gnome-core gnome-desktop-environment gdm

Hope that helps,

Attachment: signature.asc
Description: Digital signature

Reply to: