1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
7
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
9
<title>The Debian GNU/Linux FAQ - Customizing your installation of Debian GNU/Linux</title>
15
<p><a name="ch-customizing"></a></p>
19
[ <a href="ch-kernel.en.html">previous</a> ]
20
[ <a href="index.en.html#contents">Contents</a> ]
21
[ <a href="ch-basic_defs.en.html">1</a> ]
22
[ <a href="ch-getting.en.html">2</a> ]
23
[ <a href="ch-compat.en.html">3</a> ]
24
[ <a href="ch-software.en.html">4</a> ]
25
[ <a href="ch-ftparchives.en.html">5</a> ]
26
[ <a href="ch-pkg_basics.en.html">6</a> ]
27
[ <a href="ch-pkgtools.en.html">7</a> ]
28
[ <a href="ch-uptodate.en.html">8</a> ]
29
[ <a href="ch-kernel.en.html">9</a> ]
31
[ <a href="ch-support.en.html">11</a> ]
32
[ <a href="ch-contributing.en.html">12</a> ]
33
[ <a href="ch-redistrib.en.html">13</a> ]
34
[ <a href="ch-nexttime.en.html">14</a> ]
35
[ <a href="ch-faqinfo.en.html">15</a> ]
36
[ <a href="ch-support.en.html">next</a> ]
42
The Debian GNU/Linux FAQ
43
<br>Chapter 10 - Customizing your installation of Debian GNU/Linux
48
<h2><a name="s-papersize"></a>10.1 How can I ensure that all programs use the same paper size?</h2>
51
Install the <code>libpaper1</code> package, and it will ask you for a
52
system-wide default paper size. This setting will be kept in the file
53
<samp>/etc/papersize</samp>.
57
Users can override the paper size setting using the <samp>PAPERSIZE</samp>
58
environment variable. For details, see the manual page
59
<code>papersize(5)</code>.
64
<h2><a name="s-hardwareaccess"></a>10.2 How can I provide access to hardware peripherals, without compromising security?</h2>
67
Many device files in the <samp>/dev</samp> directory belong to some predefined
68
groups. For example, <samp>/dev/fd0</samp> belongs to the <samp>floppy</samp>
69
group, and <samp>/dev/dsp</samp> belongs to the <samp>audio</samp> group.
73
If you want a certain user to have access to one of these devices, just add the
74
user to the group the device belongs to, i.e. do:
82
This way you won't have to change the file permissions on the device.
87
<h2><a name="s-consolefont"></a>10.3 How do I load a console font on startup the Debian way?</h2>
90
The <code>kbd</code> and <code>console-tools</code> packages support this, edit
91
<samp>/etc/kbd/config</samp> or <samp>/etc/console-tools/config</samp> files.
96
<h2><a name="s-appdefaults"></a>10.4 How can I configure an X11 program's application defaults?</h2>
99
Debian's X programs will install their application resource data in the
100
<samp>/etc/X11/app-defaults/</samp> directory. If you want to customize X
101
applications globally, put your customizations in those files. They are marked
102
as configuration files, so their contents will be preserved during upgrades.
107
<h2><a name="s-booting"></a>10.5 Every distribution seems to have a different boot-up method. Tell me about Debian's.</h2>
110
Like all Unices, Debian boots up by executing the program <samp>init</samp>.
111
The configuration file for <samp>init</samp> (which is
112
<samp>/etc/inittab</samp>) specifies that the first script to be executed
113
should be <samp>/etc/init.d/rcS</samp>. This script runs all of the scripts in
114
<samp>/etc/rcS.d/</samp> by sourcing or forking subprocess depending on their
115
file extension to perform initialization such as to check and to mount file
116
systems, to load modules, to start the network services, to set the clock, and
117
to perform other initialization. Then, for compatibility, it runs the files
118
(except those with a `.'in the filename) in <samp>/etc/rc.boot/</samp> too.
119
Any scripts in the latter directory are usually reserved for system
120
administrator use, and using them in packages is deprecated.
124
After completing the boot process, <samp>init</samp> executes all start scripts
125
in a directory specified by the default runlevel (this runlevel is given by the
126
entry for <samp>id</samp> in <samp>/etc/inittab</samp>). Like most System V
127
compatible Unices, Linux has 7 runlevels:
139
1 (single-user mode),
146
2 through 5 (various multi-user modes), and
153
6 (reboot the system).
159
Debian systems come with id=2, which indicates that the default runlevel will
160
be '2' when the multi-user state is entered, and the scripts in
161
<samp>/etc/rc2.d/</samp> will be run.
165
In fact, the scripts in any of the directories, <samp>/etc/rcN.d/</samp> are
166
just symbolic links back to scripts in <samp>/etc/init.d/</samp>. However, the
167
<em>names</em> of the files in each of the <samp>/etc/rcN.d/</samp> directories
168
are selected to indicate the <em>way</em> the scripts in
169
<samp>/etc/init.d/</samp> will be run. Specifically, before entering any
170
runlevel, all the scripts beginning with 'K' are run; these scripts kill
171
services. Then all the scripts beginning with 'S' are run; these scripts start
172
services. The two-digit number following the 'K' or 'S' indicates the order in
173
which the script is run. Lower numbered scripts are executed first.
177
This approach works because the scripts in <samp>/etc/init.d/</samp> all take
178
an argument which can be either `start', `stop', `reload', `restart' or
179
`force-reload' and will then do the task indicated by the argument. These
180
scripts can be used even after a system has been booted, to control various
185
For example, with the argument `reload' the command
189
/etc/init.d/sendmail reload
193
sends the sendmail daemon a signal to reread its configuration file. (BTW,
194
Debian supplies <code>invoke-rc.d</code> as a wrapper for invoking the scripts
195
in <samp>/etc/init.d/</samp>.)
200
<h2><a name="s-custombootscripts"></a>10.6 It looks as if Debian does not use <samp>rc.local</samp> to customize the boot process; what facilities are provided?</h2>
203
Suppose a system needs to execute script <samp>foo</samp> on start-up, or on
204
entry to a particular (System V) runlevel. Then the system administrator
210
Enter the script <samp>foo</samp> into the directory <samp>/etc/init.d/</samp>.
217
Run the Debian command <samp>update-rc.d</samp> with appropriate arguments, to
218
set up links between the (command-line-specified) directories rc?.d and
219
<samp>/etc/init.d/foo</samp>. Here, '?' is a number from 0 through 6 and
220
corresponds to each of the System V runlevels.
233
The command <samp>update-rc.d</samp> will set up links between files in the
234
directories rc?.d and the script in <samp>/etc/init.d/</samp>. Each link will
235
begin with a 'S' or a 'K', followed by a number, followed by the name of the
236
script. Scripts beginning with 'S' in <samp>/etc/rcN.d/</samp> are executed
237
when runlevel <samp>N</samp> is entered. Scripts beginning with a 'K' are
238
executed when leaving runlevel <samp>N</samp>.
242
One might, for example, cause the script <samp>foo</samp> to execute at
243
boot-up, by putting it in <samp>/etc/init.d/</samp> and installing the links
244
with <samp>update-rc.d foo defaults 19</samp>. The argument 'defaults' refers
245
to the default runlevels, which are 2 through 5. The argument '19' ensures
246
that <samp>foo</samp> is called before any scripts containing numbers 20 or
252
<h2><a name="s-interconffiles"></a>10.7 How does the package management system deal with packages that contain configuration files for other packages?</h2>
255
Some users wish to create, for example, a new server by installing a group of
256
Debian packages and a locally generated package consisting of configuration
257
files. This is not generally a good idea, because <code>dpkg</code> will not
258
know about those configuration files if they are in a different package, and
259
may write conflicting configurations when one of the initial "group"
260
of packages is upgraded.
264
Instead, create a local package that modifies the configuration files of the
265
"group" of Debian packages of interest. Then <code>dpkg</code> and
266
the rest of the package management system will see that the files have been
267
modified by the local "sysadmin" and will not try to overwrite them
268
when those packages are upgraded.
273
<h2><a name="s-divert"></a>10.8 How do I override a file installed by a package, so that a different version can be used instead?</h2>
276
Suppose a sysadmin or local user wishes to use a program
277
"login-local" rather than the program "login" provided by
278
the Debian <code>login</code> package.
282
Do <strong>not</strong>:
287
Overwrite <samp>/bin/login</samp> with <samp>login-local</samp>.
293
The package management system will not know about this change, and will simply
294
overwrite your custom <samp>/bin/login</samp> whenever <samp>login</samp> (or
295
any package that provides <samp>/bin/login</samp>) is installed or updated.
308
dpkg-divert --divert /bin/login.debian /bin/login
312
in order to cause all future installations of the Debian <code>login</code>
313
package to write the file <samp>/bin/login</samp> to
314
<samp>/bin/login.debian</samp> instead.
325
cp login-local /bin/login
329
to move your own locally-built program into place.
335
Details are given in the manual page <code>dpkg-divert(8)</code>.
340
<h2><a name="s-localpackages"></a>10.9 How can I have my locally-built package included in the list of available packages that the package management system knows about?</h2>
347
dpkg-scanpackages BIN_DIR OVERRIDE_FILE [PATHPREFIX] > my_Packages
356
BIN-DIR is a directory where Debian archive files (which usually have an
357
extension of ".deb") are stored.
364
OVERRIDE_FILE is a file that is edited by the distribution maintainers and is
365
usually stored on a Debian FTP archive at <samp>indices/override.main.gz</samp>
366
for the Debian packages in the "main" distribution. You can ignore
367
this for local packages.
374
PATHPREFIX is an <em>optional</em> string that can be prepended to the
375
<samp>my_Packages</samp> file being produced.
381
Once you have built the file <samp>my_Packages</samp>, tell the package
382
management system about it by using the command:
386
dpkg --merge-avail my_Packages
390
If you are using APT, you can add the local repository to your
391
<code>sources.list(5)</code> file, too.
396
<h2><a name="s-diverse"></a>10.10 Some users like mawk, others like gawk; some like vim, others like elvis; some like trn, others like tin; how does Debian support diversity?</h2>
399
There are several cases where two packages provide two different versions of a
400
program, both of which provide the same core functionality. Users might prefer
401
one over another out of habit, or because the user interface of one package is
402
somehow more pleasing than the interface of another. Other users on the same
403
system might make a different choice.
407
Debian uses a "virtual" package system to allow system administrators
408
to choose (or let users choose) their favorite tools when there are two or more
409
that provide the same basic functionality, yet satisfy package dependency
410
requirements without specifying a particular package.
414
For example, there might exist two different versions of newsreaders on a
415
system. The news server package might 'recommend' that there exist
416
<em>some</em> news reader on the system, but the choice of <samp>tin</samp> or
417
<samp>trn</samp> is left up to the individual user. This is satisfied by
418
having both the <code>tin</code> and <code>trn</code> packages provide the
419
virtual package <code>news-reader</code>. <em>Which</em> program is invoked is
420
determined by a link pointing from a file with the virtual package name
421
<samp>/etc/alternatives/news-reader</samp> to the selected file, e.g.,
422
<samp>/usr/bin/trn</samp>.
426
A single link is insufficient to support full use of an alternate program;
427
normally, manual pages, and possibly other supporting files must be selected as
428
well. The Perl script <samp>update-alternatives</samp> provides a way of
429
ensuring that all the files associated with a specified package are selected as
434
For example, to check what executables provide `x-window-manager', run:
438
update-alternatives --display x-window-manager
442
If you want to change it, run:
446
update-alternatives --config x-window-manager
450
And follow the instructions on the screen (basically, press the number next to
451
the entry you'd like better).
455
If a package doesn't register itself as a window manager for some reason (file
456
a bug if it's in error), or if you use a window manager from /usr/local
457
directory, the selections on screen won't contain your preferred entry. You
458
can update the link through command line options, like this:
462
update-alternatives --install /usr/bin/x-window-manager \
463
x-window-manager /usr/local/bin/wmaker-cvs 50
467
The first argument to `--install' option is the symlink that points to
468
/etc/alternatives/NAME, where NAME is the second argument. The third argument
469
is the program to which /etc/alternatives/NAME should point to, and the fourth
470
argument is the priority (larger value means the alternative will more probably
471
get picked automatically).
475
To remove an alternative you added, simply run:
479
update-alternatives --remove x-window-manager /usr/local/bin/wmaker-cvs
485
[ <a href="ch-kernel.en.html">previous</a> ]
486
[ <a href="index.en.html#contents">Contents</a> ]
487
[ <a href="ch-basic_defs.en.html">1</a> ]
488
[ <a href="ch-getting.en.html">2</a> ]
489
[ <a href="ch-compat.en.html">3</a> ]
490
[ <a href="ch-software.en.html">4</a> ]
491
[ <a href="ch-ftparchives.en.html">5</a> ]
492
[ <a href="ch-pkg_basics.en.html">6</a> ]
493
[ <a href="ch-pkgtools.en.html">7</a> ]
494
[ <a href="ch-uptodate.en.html">8</a> ]
495
[ <a href="ch-kernel.en.html">9</a> ]
497
[ <a href="ch-support.en.html">11</a> ]
498
[ <a href="ch-contributing.en.html">12</a> ]
499
[ <a href="ch-redistrib.en.html">13</a> ]
500
[ <a href="ch-nexttime.en.html">14</a> ]
501
[ <a href="ch-faqinfo.en.html">15</a> ]
502
[ <a href="ch-support.en.html">next</a> ]
508
The Debian GNU/Linux FAQ
512
version 3.1.5, 17 January 2007<br>
514
Authors are listed at <a href="ch-faqinfo.en.html#s-authors">Debian FAQ Authors</a><br>