FAQ

FAQ: abbrev. <em>frequently asked questions</em>

Debian linux

I think I've various packages installed on my Debian system which I do not really need. Is there a way to find and remove them?
There are two kinds of 'unneeded' packages: Those applications that you've installed without really needing them and unneeded libraries. Debian can't help you with the first (you have to find out which software you want and which not. You should manually go through the list of installed software using graphical tools such as kpackage).

If, however, you're talking about the latter, ie. libraries that are not required by any other package, then you're lucky. There's a Debian program called deborphan, which finds all these 'orphans'. If it's not installed on your system already, do so using apt-get install deborphan.
You can then automatically remove unnecessary software by executing
apt-get remove --purge $(deborphan)
Strange... Some of my logfiles are rotated daily or weekly, but not /var/log/messages, /var/log/syslog etc. They keep getting bigger and bigger. What's wrong here?
Well, have a look at /etc/crontab. You'll see that it executes your cron jobs (daily, weekly and monthly) around 6 in the morning. If your machine isn't running all the time, the cron jobs won't be executed, if you don't boot your machine before 6 in the morning.
That's one thing. The strange thing - I admit - is however, why some log files are rotated and some not. I do not have a clue as to why this happens, but you should know that logrotate only rotates a few logfiles (specified in /etc/logrotate.d/. Other logs such as /var/log/messages are handled by the sysklogd cron script. If you manually execute it, it will also rotate the remaining log files.
The real solution would be to install a cron software that can handle downtimes (anacron etc. is your friend).
Suppose eth0 is the internal NIC. You would then edit /etc/default/dhcp and change the line
INTERFACES=""
to eth0:

INTERFACES="eth0"
Issue a /etc/init.d/dhcp start. The service should start without complaining now.
Just upgraded KDE to version 3.3 (using Debian testing/sarge), but now my keyboard is blocked in KDM. In other words, I can't login and have to click on "Console Login" to get a text console. There, the keyboard works fine. If I login as root and restart KDM manually, the keyboard works again in KDM. What's going on here?
Well, I don't have a clue what exactly is going on here, but this usually helps: Open /etc/kde3/kdm/Xservers and change the line
:0 local@tty1 /usr/X11R6/bin/X -nolisten tcp
to this (and then restart KDM):

:0 local@tty1 /usr/X11R6/bin/X -nolisten tcp vt7
My iptables firewall script does not log any messages to /var/log/messages, despite having iptables --log options set! What am I doing wrong?
iptables uses klogd to log messages. In Debian, klogd by default sends messages only to the console, not to the syslog log files. This default behaviour can be changed by editing /etc/init.d/klogd. Search for the line
KLOGD = ""
and replace it with
KLOGD = "-c 2"
Then, restart klogd by executing /etc/init.d/klogd force-reload
I use some GNOME apps under KDE and the fonts of these apps are too big. Even worse, after starting a GNOME app, my KDE fonts shrinked in size!
This is quite a common debian problem. If you try to change your GNOME fonts via gnome-font-properties, your GTK apps will display beautiful fonts, but the fonts in KDE decrease in size as well and become unreadable small.
I actually have no idea what causes this weirdness, but there's one easy thing you can do: By default, Debian starts XFree in 100 dpi mode, which doesn't make much sense unless you have a really hugh monitor. In order to start X with 74 dpis, just edit edit /etc/kde3/kdm/Xservers. There should be a line looking like this somewhere at the beginning:
:0 local@tty1 /usr/X11R6/bin/X -dpi 100 -nolisten tcp vt7
Now just change the -dpi 100 statement to -dpi 75 or add it if not present. You also might have to change /etc/X11/xinit/xserverrc to
#!/bin/sh
exec /usr/bin/X11/X -dpi 75 -nolisten tcp
Restart your X server and adjust your fonts (they will be to small, as the dpi mode has changed).
I'm using different USB memory sticks / flash drives / card readers. The assigned devices change all the time (i.e. sometimes /dev/sda1, then /dev/sda4 etc.). That makes automount pretty much impossible, doesn't it?
First of all, it was an absolutely dumb idea in the windows world to format removable drives only on the 4th partition (ZIP drives still work that way). That's why we can't rely on the filesystem to be on the first partition (i.e. /dev/sdX1) as one would expect. The only real solution to this is to use the sysfs kernel interface together with udev (see next section for details).
I'm using Debian testing with KDE and KDM. When using LDAP for user authentication, my locales (UTF-8 etc.) are not used within KDE and X in general. Instead, the command locale tells me that I'm using POSIX encodings. On a plain console outside X, it works, however. When I use GDM as login manager, everything is fine as well.
A weird problem and I don't have a clue about the reason for this to happen. However, have a look at /etc/pam.d/kdm. It should have the following lines:
@include common-auth
@include common-account
@include common-password
@include common-session

auth       required     pam_nologin.so
auth       required     pam_env.so
session    required     pam_limits.so
Now, either open /etc/pam.d/gdm as well and copy and paste its content into /etc/pam.d/kdm or change the latter to the following:
auth    requisite       pam_nologin.so
auth    required        pam_env.so
@include common-auth
@include common-account
session required        pam_limits.so
@include common-session
@include common-password

Relogin into KDE and your locales should work.

Linux udev specific issues

I've installed udev, but my NVIDIA card doesn't work anymore.
Older NVIDIA drivers don't let sysfs know that an NVIDIA card is present, hence udev has no chance to create the device nodes. Newer drivers should solve the issue, otherwise you can also create the device nodes yourself using this little script:
#!/bin/bash

for i in `seq 0 7`; do
   mknod /dev/nvidia$i c 195 $i
   chown :video /dev/nvidia$i
   chmod 660 /dev/nvidia$i
done

mknod /dev/nvidiactl c 195 255
chown :video /dev/nvidiactl
chmod 660 /dev/nvidia$i
You should make this script executed at boot time, before starting the X server.
VMware's some problems with udev as well. What can I do?
VMware assumes its devices are already there when it starts. To solve this issue, simple put the following lines into /etc/init.d/vmware, right after the # See how we were called comment, but before the case "$1" in start statement:
for a in `seq 0 9`; do
mknod /dev/vmnet$a c 119 $a > /dev/null 2>&1
done
mknod /dev/vmmon c 10 165 > /dev/null 2>&1

If VMware wants you to run vwmare-config.pl again, just ignore it and delete the file /etc/vmware/not_configured

Latex related Q&A's

I'm writing a normal (ie portrait format) report to which I'd like to add some very wide graphs or tables. To do so, they should be displayed in landscape orientation. How can I change the page layout just for these contents?
The easiest solution is to use the lscape package. You can then display any content in landscape format if you enclose it with \begin{lscape} and \end{lscape}:
\usepackage{lscape}
...
\begin{document}
This text is in portrait orientation.
\begin{lscape}
This text is displayed on a page in landscape orientation
\end{lscape}
...
\end{document}
Note that headings and other page-specific stuff won't be rotated. In other words, Latex makes sure that the content in landscape still fits into the layout of the rest of the document.
I want to create a landscape pdf file from latex (using pdflatex)
Just use the following settings before your \begin{document} statement:
\documentclass[a4paper,landscape]{article}
\usepackage{setspace}
\usepackage[pdftex]{geometry}
\geometry{headsep=2.0em,hscale=0.80}

I did what you said to get portrait output. However, when I use fancyheading, my footers sometimes are not displayed at all!
There is a bug in older geometry.sty files. Just make sure you use a recent version (2002/07/08 v3.2 should do it). To upgrade, you can just replace your old geometry.sty with the new version.
How can I produce Powerpoint-like presentations with Latex? In particular, I want to include animations, links and other multimedia stuff.
The best Latex slide package I've found so far is prosper. It's very easy to use and customize to your needs and gusto. It also supports custom-made transitions between succeeding slides.