Saturday, 11 August 2012

How to reinstall the network-manager if you accidentally removed it

Using the aptitude package manager in Debian, I noticed a message that suggested me to use the command:

$ apt-get autoremove

This would have removed the unused dependencies following to having removed some unused packages. The list was long and I skimmed quickly through it, noting the fact that there weren't important packages, as someone would expect.

Unfortunately, the Gnome network-manager was included in the list, and when I run the command it removed my possibility to connect to the internet and even to re-install the network-manager itself!

In this ironic situation, angry by being tricked to run a damaging command, I was already thinking to reinstall Debian. But wait! That would be a silly move.

The solution


In order to have an internet connection, you don't need the network manager. If you still have ethernet available, grab that cable and open a terminal:

$ sudo ifconfig eth0 up
$ sudo dhclient




This will make your ethernet working even without the Gnome network-manager. After this, you can run a:

$ sudo apt-get install network-manager-gnome

and have your wireless connection working again.

A suggestion


Do not use the auto-remove command if you do not know what it is removing. It might be a vital component for your system and damage it heavily.

You can use the auto-remove with the simulate option first (-s), or just deactivate the auto-remove in /etc/apt/apt.conf 

 // auto-remove breaks on meta packages
APT::Get::AutomaticRemove "0";
APT::Get::HideAutoRemove "1";

// Recommends are as of now still abused in many packages
APT::Install-Recommends "0";
APT::Install-Suggests "0";
Debug::pkgAutoRemove "0";

// PDiffs reduce the required download for apt-get update, but increase the
// CPU requirements and quite often fail.
Acquire::PDiffs "0";

// Remove apt unauthenticated warnings
APT::Get::AllowUnauthenticated "0";

Tuesday, 7 August 2012

Change language in Firefox and Thunderbird

Just after I installed Debian, I immediately felt the need to install Firefox and Thunderbird, as they are my favorite web and mail browsers.

As they are not present in the debian repositories, I had to use the ones from linuxmint (I added to my /etc/apt/sources.list):

deb http://debian.linuxmint.com/latest testing main contrib non-free

And after I installed Firefox and Thunderbird, I found myself with a Firefox in Afrikaans and Thunderbird in Arabic. Why this weird combination?

It is because of a bug in the Linux Mint repositories. When you go to install the browsers, they pick the first language pack they find, in alphabetical order!

In order to go back to english, you need to remove the language packs, using the package manager, and then install the english ones:

$ sudo apt-get remove firefox-l10n-af thunderbird-l10n-ar

This command alone actually automatically asked to install the English language packs. You can install also other languages by browsing in the repository:

$ apt-cache search firefox | grep l10n

For some reason, though, after this operations, the browsers did not work, so I tried:

$ sudo apt-get install firefox thunderbird

And everything worked like a charm, in a familiar language.

Sunday, 5 August 2012

Ethernet connection not working in Debian after fresh installation

Just after I installed Debian Squeeze, at first boot, the wired ethernet connection, which worked so well during the install, was not working in the X system (Gnome).

I wondered a lot trying to find an error in ifconfig or dmesg, but could find none. After a while, I noticed that the "status" of the connection in Gnome whenever I clicked on the network manager icon was:

 "Wired device not managed"


The device was simply not activated in the interfaces!

In order to activate it, type from a terminal:

$ sudo emacs /etc/NetworkManager/NetworkManager.conf
(or 'vi' or 'nano' instead of emacs, depending on your favourite text editor)

Then change the line:


[ifupdown]
managed=false

to

[ifupdown]
managed=true

Then save the file and restart the network manager:

$ sudo service network-manager restart

And the wired connection should be working straight away.