12 February 2009

HowTo: Reset the XOrg configuration file in Debian

Here is a walk-through to resetting your XOrg configuration file (located at /etc/X11/xorg.conf if you want to see what you have now) to some very basic settings. This won't take into account, as far as I know, proprietary drivers nor touch-screen drivers and geometry, all of which can be added into this file in some way or another.

What is X you might ask? Back in the day there was a graphical 'windowing' interface named W for Unix systems. This allows graphics to be on the screen, the mouse pointer to do stuff, etc...The successor to W is... X, which does the same job of allowing graphics on your computer. Maybe some day there will be a Y and a Z?

Anyways, resetting that file:

In a terminal (I use Konsole on KDE), run as root:
shell# dpkg-reconfigure xserver-xorg

or as your normal user, if you have sudo access:
shell$ sudo dpkg-reconfigure xserver-xorg
From here you will have a few pages to go through; for the most part you can accept the defaults, but here is a brief overview of each page and the settings that I've chose. This is NOT a graphical application, so your mouse won't work here — use the [Tab] key to move around to various fields and [Enter] to 'click' a button ([Space Bar] may work also).

Run the above command, and on Page X you'll see...

Page 1. Use kernel framebuffer device interface?
No

Page 2. Autodetect keyboard layout?
Your call, but US keybd select No; if you don't know if you have a US keybd or if it has a lot of odd buttons, select Yes. Note that selecting Yes will give MORE PAGES than what I have listed here.

3. Keybd layout:
us
Well, I've got a US keybd; if you have something else or selected Yes to the first question, this may be something else.

4. XKB rule set to use:
xorg

5. Page 5 is some info; hit [tab] to highlight and then [enter] to pick

6. Keybd model:
accept default (pc104 on my computer)

7. Users of U.S. English keyboards should generally leave this entry blank
Click OK

8. Keyboard variant:
I kept myne blank, as recommended in Page 7

9. Experienced users can use any options compatible with the selected XKB model, layout and variant.
[Tab] to get to and [Enter] to move forward

10. Keyboard options:
I prefer my [Caps Lock] key to function as another [Control] Key (although I've really modified it to be a compose key in KDE, and likely this can be done at this screen — anyone know how?) and my 'Windows' key the function as a Meta key. If you want these enter this info on this tenth screen:
ctrl:nocaps altwin:meta_win

That should be it to recreate your XOrg file, now located at /etc/X11/xorg.conf and the Terminal should also report where your previous XOrg configuration file is located (backed up), if there was one before.

To test your new XOrg configuration file, restart X from your KDE or GNOME login screen, or reboot the whole computer if you're a Windows user.

03 February 2009

Package Management Basics on Debian GNU/Linux

One of the 'hardest' parts of Linux for new users is often the installation of new software, or the understanding of how this all works. Generally a modern distribution has software 'repositories' and overall they function something like this:
  1. You have a text file with a list of internet addresses (URLs) and some additional information about that URL; these are the Repositories and act somewhat like a 'catalog of software'. You can shop from the distribution's usual 'catalogs', or you can add new 'catalogs' from which to obtain new software.
  2. Your system's Package Manager uses this information to contact the Repository to get the most up-to-date list of that available software
  3. A user can search for software by name, function, or other criteria; if the software looks interesting, the user selects that software to install and the Package Manager may alert the user that some additional software will be needed. This is like ordering a kitchen knife for example, and the catalog also makes sure that you get the sharpener and the cutting board. Or something like that, basically its additional software that the first piece relies upon to work.
Seems simple enough to me. I run Debian, so my list of software repositories is located in a single file at /etc/apt/sources.list and there can be additional repositories (well, text files with repositories written in them) in the folder at /etc/apt/sources.list.d/ The file's format is simple enough once you understand it:

  • type / location / branch / sections
  • deb http://debian.uchicago.edu/debian/ testing main contrib non-free
  • deb-src http://debian.uchicago.edu/debian/ unstable main contrib non-free

In the above two repositories, the Types are 'deb' for programs and 'deb-src' for source code

The location for each is the URL ' http://debian.uchicago.edu/debian/'

The Branch part, for Debian systems at least, is 'stable' or 'testing' or 'unstable' or 'experimental'. Note that these can also be referred to by their release names, which do not change — currently 'stable' is Etch but in a few weeks it is expected to be 'Lenny'. Software starts in Experimental and works its way to Unstable and then as more bugs are cleaned up, it works its way to Testing, and then every couple of years the software in Testing is released as a new version of Stable.

The Sections for a repository depend on what that repo has available; the general Debian repositories usually have three: main, contrib, and non-free. Depending on the licensing and distribution terms, an official package will go into one of these three Sections. Other repositories may only have one section.