Fight for the Internet 1!

Sunday, September 5, 2010

How to Edit a Configuration File

HOW TO EDIT A CONFIGURATION FILE

New users to Linux may have trouble editing configuration text files at first. I'll try to be simple, and this guide is for people using Gnome or KDE.

The simplest way is using a user friendly program. In Gnome (which is normal Ubuntu), the default text editor is gedit. In KDE (in Kubuntu) it is Kate. Also, this is a protected system file, so you need to use special Administrator privileges before you can edit it. Don't worry. This is simply.

In this example I am showing how to open a BlueTooth configuration file, but it works for any other example configuration files.

KDE

In KDE, you need to find the "Run Command" option the Application menu. (The App menu is usually in the lower left-hand corner, with a colorful K-button.) In KDE4's new menu style, the "Run Command" is (currently) under the 'Computer' section, near the top of the small list. Find the option and click it.

In the input box that displays, copy/paste the this command into it and press enter:
kdesu kate /lib/udev/rules.d/70-hid2hci.rules

The 'kdesu' program tells the system you want to run the text editor (kate) with Admin access. You will be prompted for your individual user password, which you enter. Then kate should open with a file ready for you. (This is the /lib/udev/rules.d/70-hid2hci.rules file which we told kate to open for us.) If this file does not open, you can open it manually by going to menu File -> Open... and then navigating to the '/' root directory, down to 'lib' and so on until you find the file ' 70-hid2hci.rules'.

Edit the file as directed earlier in this article. Save the file, close the file (menu File -> Close), and then finally exit Kate.

GNOME

In Gnome, first open the Terminal through the Application menu. (The App menu is usually in the upper left-hand corner, labeled as Applications.) On my system, it is under Applications -> Accessories -> Terminal.

In the input command window that displays, copy/paste the this command into it and press enter:
gksu gedit /lib/udev/rules.d/70-hid2hci.rules

The 'gksu' tells the system you want to run the text editor (gedit) with Admin access. You will be prompted for your individual user password, which you enter. Then gedit should open with a file ready for you. (This is the /lib/udev/rules.d/70-hid2hci.rules file which we told gedit to open for us.) If this file does not open, you can open it manually by going to menu File -> Open... and then navigating to the '/' root directory, down to 'lib' and so on until you find the file ' 70-hid2hci.rules'.

Edit the file as directed earlier in this article. Save the file, close the file (menu File -> Close), and then finally exit gedit. You can close the Terminal also.

Hope that helps.

Network Management Disabled

I am surprised I have not mentioned this before. This is a recurrent bug that's been cropping up in KDE 4 since version 4.3 as far as I can tell. (It may have started later, so don't quote me on the exact date, and it might have nothing to do with KDE itself, and might be an Ubuntu thing.)

The symptoms are the computer boots, the desktop environment loads (Gnome, KDE, etc.) and there is no Internet, when there should be. You click on the Network Manager and it tells you "Network Management Disabled." Bug report here. This bug has come and gone for me for a while now.

The problem is an incorrectly configured configuration file. (Basically, this is a bug that should never have happened but it did. Thankfully it's easy to fix.)

Open this file /var/lib/NetworkManager/NetworkManager.state with Admin privileges, and make the following changes. (If you need help on editing a system text file / configuration file, see this Article for a simple New Users guide.)
NetworkingEnabled=false
to
NetworkingEnabled=true
Save the file and close it. There may be a system service you can restart, but I cannot recall it at this time. Just reboot and your network should return to normally.