This article is an introduction to tune up your Linux box to an intermediate level and supports Debian Lenny (5.0) as the target platform. With this guide, I bet your PC will shine and really become personal again. Debian is a Linux distribution which is stable yet easy to use and has its basis on powerful package management system called Advanced Packaging Tool (APT).
As of this writing, ATI cards have a reputation for uneven Linux video driver quality, so, at present I prefer ELSA's NVIDIA-based cards. The cards are well supported under Linux although there are issues associated with installing NVIDIA drivers, which this article covers partly.
To rescue data from, for example, a Red Hat Linux box, mount the large LVM'd partition in the HD in the following way:
$ sudo aptitude install lvm2 $ sudo lvs $ sudo mount -t ext3 /dev/VolGroup00/LogVol00 /mnt/rh # mount RedHat
Copy everything back to the server that's running now.
Download one from here . I recommend using `Advanced Driver Search' and among the archived drivers choosing the latest version that's not coming from beta in a short period of time. Then, I bet your choice is the correct stable driver.
Linux x64 (AMD64/EM64T) Display Driver 180.60
The task of installing a device driver is closely correlated to the kernel and by some way tedious and time-consuming. You can't download the precompiled kernel interface for the latest operating system and that's why you need to build the kernel interface from the source coming from NVIDIA using a C compiler with root access.
Requirements:
If you are prepared, enter the runlevel 3 that doesn't require X.
$ su - # telinit 3
You can't use `sudo' below because you need to set the environment variable `CC' by yourself.
`su' does not change the current directory by default, and sets the environment variables `HOME' and `SHELL' to the respective vaules in the user's password entry.
You can use the kernel for example compiled with `gcc-4.1' and the newer compiler such as `gcc-4.3' at once, but device drivers need to have the gcc version that could build the kernel running in the first place.
# export CC=gcc-4.1 # sh NVIDIA*.run
Run the prompted `nvidia-xconfig' and then restart your computer. You will need to come back to this place when you upgrade the X server.
You may also need to check /etc/X11/xorg.conf (in Debian case), and remove unnecessary portions in the auto-generated entries. In my case it showed an error (while starting up) searching for a module to utilize Type1 fonts as you can check in the '/var/log/Xorg.0.log' file, that's why I commented out Load "type1" line in the section "Module" :
Section "Module" Load "dbe" Load "extmod" # Load "type1" Load "freetype" Load "glx" EndSection
By default in many distributions, Gnome display manager (gdm) will come up to let you log in.
Are you really keen with typing and need keyboard acceleration?
$ xset r rate 150 60
sets the key repeat rate to 60 cps (characters per second) and the delay to 150 msec.
You may need xfce which is a well-balanced desktop environment system compared to KDE or Gnome, even though I use lighter lxde.
To change your default web browser that's invoked from email message reader or a url text in other places, do this once :
$ sudo update-alternatives --config x-www-browser
Then set your default browser from there. What you set here will become the default browser system-wide.
If you use any of KDE components like KMail, invoke kcontrol to set its default browser to Epiphany, Opera, Firefox (Iceweasel) or anything more stable than Konqueror. Konqueror is not good as a browser at all already.
$ kcontrol &
ALSA (Advanced Linux Sound Architecture) provides efficient audio interface for programs running in multithreaded environment. It also has older OSS emulation support so that most OSS programs don't need to be rewritten.
Most PCI sound cards should work with ALSA. USB audio interfaces from Roland like UA-30 also work. You can check whether your card is supported here . AFAIK Onkyo is not well supported.
In general, they should work without changing/creating alias for something like 'usbaudio' with snd-usb-audio. You don't need to change anything in '/etc/modprobe.d/alsa-base'.
First try alsamixer and then aplay with root privilege.
$ sudo alsamixer $ sudo aplay -l $ sudo aplay /usr/share/sounds/Noise.wav
As you see in the property of '/dev/dsp' device file, general users are not given the permission to read and write audio device. Thus you will need to add the user you want to the 'audio' group ('cdrom' group for CD playback, and 'video' for video hardware access). Only those users can play sound.
$ ls -l /dev/dsp /dev/cdrom lrwxrwxrwx 1 root root 4 2009-10-06 16:27 /dev/cdrom -> scd0 crw-rw---- 1 root audio 14, 3 2009-10-11 19:52 /dev/dsp
$ ls -l /dev/scd0 brw-rw---- 1 root cdrom 11, 0 2009-10-06 16:27 /dev/scd0
$ sudo adduser username audio $ sudo adduser username cdrom $ sudo adduser username video
And do not forget: this user must logout and login before it works.
$ groups $ aplay /usr/share/sounds/Front_Right.wav
For applications which do not provide ALSA output, you can use aoss from the alsa-oss package. To use aoss, when you run the program, prefix it with aoss, e.g.
$ aoss realplay
Check first aplay and amixer work.
After installation, set options in /usr/local/etc/mplayer/mplayer.conf (or /etc/mplayer/mplayer.conf)
vfm=ffmpeg ao=alsa
To play DVD,
$ mplayer dvd://1 -chapter 1
With a web browser open the location
http://localhost:631/
Then CUPS will automatically detect the printer and take care of everything else.
If you use a SCSI scanner, make sure your SCSI adapter works fine with the default driver. For Adaptec AHA-2930CU for example, you will see something like this in lsmod listing.
$ sudo lsmod | grep scsi scsi_mod 141457 4 sg,aic7xxx,libata,sd_mod
If the scanner is attached properly,
a device name like sg0
or sg1
will appear
depending on your environment.
$ sudo dmesg | grep scsi Attached scsi generic sg0 at scsi1, channel 0, id 0, lun 0, type 0 Attached scsi generic sg1 at scsi4, channel 0, id 4, lun 0, type 3
The SCSI device ID 0 is used by the adapter.
scanimage
with -L
option shows you the recognized
scanner's name.
$ sudo scanimage -L device `epson:/dev/sg1' is a Epson GT-7600 flatbed scanner
You can change the permission with write access so that general users other than root can access the device.
$ sudo chmod 666 /dev/sg1 $ ls -l /dev/sg1 crw-rw-rw- 1 root disk 21, 1 Mar 2 09:06 /dev/sg1
Now you can begin scanning sheets of paper with the command :
$ scanimage --resolution 300 | convert - page1.png
scanimage
accesses image acquisition devices through the SANE
(Scanner Access Now Easy) interface
and can thus support any device for which there exists
a SANE backend. See the manual page for more options.
The command above will simply scan the image with resolution of 300dpi and convert it to png file format.
Packages : Non-free packages are not generally permitted as a free software in Debian society, and packages under Contrib are free themselves but depend on other non-free programs.
NsPluginWrapper is a Netscape 4 (NPAPI) compatible plugins viewer and is a contrib package. You have to have an entry with contrib like this in '/etc/apt/sources.list':
deb http://ftp.jp.debian.org/debian/ lenny main contrib non-free
When you add the above line, you will be able to download the package created by a Frenchman .
$ sudo aptitude install nspluginwrapper
Although npviewer executable is actually included in the nspluginwrapper package, it isn't symlinked correctly (as of version 0.9.91.4-3).
$ sudo ln -s /usr/lib/nspluginwrapper/noarch/npviewer /usr/bin/npviewer
Get Flash player this way:
$ sudo aptitude install flashplayer-mozilla
Use nspluginwrapper to install the plugin. The command is like this :
$ sudo nspluginwrapper -v -i /usr/lib/flashplayer/libflashplayer.so
Restart the browser and you should be good to go.
You can directly download and install 64-bit version of Flash Player 10 , although it's still a prerelease version (alpha).
Or you could try using wget:
$ wget http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.32.18.linux-x86_64.so.tar.gz
If you've installed 32-bit version of Flash player in the past, you will also delete it.
$ sudo nspluginwrapper -r /usr/lib/mozilla/plugins/npwrapper.libflashplayer.so
Restart Firefox. Enter this in the URL box:
about:plugins
and the plugins installed in the browser are shown. Now, you should be ready to enjoy YouTube and Initial D !
If something goes wrong, you could probably do:
$ pkill npviewer.bin
SWFDec is a popular and native 64-bit plugin but slow and also it might sometimes freeze the browser.
There is a free standalone player called Gnash as well that's based on gameswf (pronounced "game swiff"), but it has been beta for a long time. I'd recommend you better using gnash 0.8.4 (at the time of writing). If you want to use gnash, you will have to disable the other mozilla player which by default means swfdec.
$ sudo aptitude install mozilla-plugin-gnash $ sudo aptitude remove swfdec-mozilla
For example, you'd want to show a hot movie in youtube.com. Then you can go to the page and will see a blank window and a few icons in the right part of it. Click on the arrow at the top right corner to open a new window. The movie will automatically be loaded and played.
Simply install Snes9x :
$ sudo aptitude install snes9x-x
To unarchive ROMs in '7z' format which is mostly used in Windows world, install p7zip:
$ sudo aptitude install p7zip $ 7z x hoge.7z
Use alsa-oss and run the emulator with the archive as described earlier in this article. For example:
$ aoss snes9x Chrono\ Trigger\ \(J\).zip &
Add this line into /etc/apt/sources.list
:
deb http://www.lamaresh.net/apt lenny main
Install the latest Wine and run winecfg
.
You may also need to install lib32nss-mdns
$ sudo aptitude update $ sudo aptitude install wine $ sudo aptitude install lib32nss-mdns $ winecfg