vankuik.nl RecentChanges 2010-09-09 XML TXT

Debian

Package tools

Summary of dpkg options:

-i deb fileInstall .deb package
-r packageRemove installed package
-P packagePurge installed package including configuration files
-s packageDisplay summary on package name
-L packageList files of package
-S patternSearch in package names and filenames for pattern
-l packageList install status of package, can use wildcards. Use grep "ii" to see only installed ones.

To find which package owns a file:

  $ dpkg-query -S /usr/lib/libqwt.so

The following will do the same, but fail if the package isn't installed:

  $ dpkg -S /usr/lib/libqwt.so

Some columns look squashed. Try something like:

  COLUMNS=150 dpkg -l packagename | less

To search for a keyword in name and description of all available packages:

  $ apt-cache search ''keyword''

To search for a keyword in names of all available packages:

  $ apt-cache search --names-only ''keyword''

Of you get too much results, remember it's a regex you're searching. To search for all packages that start with 'apache' in the name:

  $ apt-cache search --names-only '^apache'

Once found, you often want more info:

  $ apt-cache show packagename

Search for a package which provides a certain file:

  $ apt-file search mysql.h

Or use the web frontend at http://www.debian.org/distrib/packages#search_contents

If you don't have apt-file installed, do:

  $ sudo apt-get install apt-file
  $ sudo apt-file update

Search for installed package name which owns a certain file:

  $ dpkg --search "/usr/games/fortune"

Nice trick: show the 10 largest packages on your system:

  $ dpkg-query -Wf '${Installed-Size} ${Package}\n' | sort -n -r | head

To see which packages depend on a specific package:

  $ apt-cache showpkg libevent1

Font size issues

A default Debian Testing installation can have both Gnome and KDE installed. However, when running GTK applications (like Mozilla and Eclipse), the font sizes are not the same size. Adjusting this through gnome-control-center is possible but awkward, since the DPI settings of both desktops are different.

It's easiest to set them to the same DPI. To find the current DPI, start Konsole or Gnome Terminal and type

  xdpyinfo | grep "dots"

Gnome its DPI setting is adjustable through Gnome Control Center, Font. Then press the Details... button. For KDE, you'll have to edit the file /etc/kde3/kdm/Xservers and add to the uncommented line -dpi x where x is the same value as was set through the Gnome Control Center.

Logout and press CTRL+ALT+Backspace. This restarts the Xserver. Now use both KDE and Gnome Control Center to set all apps to the same font size.

Differences in startup

Debian uses the runlevels in a different manner than RedHat and SuSe do. In Debian, runlevel 1 is single-user and runlevel 2 (the default) goes multi-user including network and X.

Note also that maintaining the symlinks in the SysV init-style is done through the 'update-rc.d' utility rather than 'chkconfig'.

Unicode in Debian

If you have KDE and you want your terminals to be aware of unicode, create a directory .kde/env and put a shellscript in there. The name must end with .sh and the contents should be something like:

  export LANG=en_US.UTF-8