Digits graph Printable characters except space lower Lowercase letters print Printable characters punct Punctuation space Whitespace (horizontal or vertical) upper Uppercase letters xdigit Hexadecimal digits [=char=] The class of characters in which char belongs. Examples Change uppercase to lowercase in a file: cat file | tr ‘[A-Z]’ ‘[a-z]’ Turn spaces into newlines (ASCII code 012): tr ‘ ‘ ‘ 12′ < file Strip blank lines from file and save in new.file (or use 011 to change successive tabs into one tab): cat file | tr -s "" " 12" > new.file Delete colons from file; save result in new.file: tr -d : < file > new.file #BREAK# traceroute traceroute [options] host [packetsize] TCP/IP command. Trace route taken by packets to reach network host. traceroute attempts tracing by launching UDP probe packets with a small TTL (time to live), then listening for an ICMP “time exceeded” reply from a gateway. host is the destination hostname or the IP number of host to reach. packetsize is the packet size in bytes of the probe datagram. Default is 38 bytes. Options -d Turn on socket-level debugging. -g addr Enable the IP LSRR (Loose Source Record Route) option in addition to the TTL tests, to ask how someone at IP address addr can reach a particular target. -l Include the time-to-live value for each packet received. -m max_ttl Set maximum time-to-live used in outgoing probe packets to max-ttl hops. Default is 30 hops. -n Show numerical addresses; do not look up hostnames. (Useful if DNS is not functioning properly.) -p port Set base UDP port number used for probe packets to port. Default is (decimal) 33434. -q n Set number of probe packets for each time-to-live setting to the value n. Default is 3. -r Bypass normal routing tables and send directly to a host on an attached network. -s src_addr Use src_addr as the IP address that will serve as the source address in outgoing probe packets. -t tos Set the type-of-service in probe packets to tos (default 0). The value must be a decimal integer in the range 0 to 255. -v Verbose — received ICMP packets (other than TIME_EXCEEDED and PORT_UNREACHABLE) will be listed. -w wait Set time to wait for a response to an outgoing probe packet to wait seconds (default is 3 seconds). #BREAK# troff troff See groff. true true A null command that returns a successful (0) exit status. See also false. tune2fs tune2fs [options] device System administration command. Tune the parameters of a Linux Second Extended Filesystem by adjusting various parameters. You must specify the device on which the filesystem resides; it must not be mounted read/write when you change its parameters. Options -c mount-counts Specify the maximum number of mount counts between two checks on the filesystem. -e behavior Specify the kernel’s behavior when encountering errors. behavior must be one of: continue Continue as usual. remount-ro Remount the offending filesystem in read-only mode. panic Cause a kernel panic. -g group Allow group (a group ID or name) to use reserved blocks. -i interval[d|w|m] Specify the maximum interval between filesystem checks. Units may be in days (d), weeks (w), or months (m). If interval is 0, checking will not be time-dependent. -l Display a list of the superblock’s contents. -m percentage Specify the percentage of blocks that will be reserved for use by privileged users. -r num Specify the number of blocks that will be reserved for use by privileged users. -u user #BREAK# Allow user (a user ID or name) to use reserved blocks. tunelp tunelp device [options] System administration command. Control a lineprinter’s device parameters. Without options, print information about device(s). Options -a [on|off] Specify whether or not to abort if the printer encounters an error. By default, do not abort. -c n Retry device n times if it refuses a character. (Default is 250.) After exhausting n, sleep before retrying. -i irq Use irq for specified parallel port. Ignore -t and -c. If 0, restore noninterrupt driven (polling) action. -o [on|off] Specify whether to abort if device is not online or is out of paper. -q [on|off] Specify whether to print current IRQ setting. -r Reset port. -s Display printer’s current status. -t time Specify a delay of time in jiffies to sleep before resending a refused character to the device. A jiffy is defined as either one tick of the system clock or one AC cycle time; it should be approximately 1/100th of a second. -w time Specify a delay of time in jiffies to sleep before resending a strobe signal. -C [on|off] Specify whether to be extremely careful in checking for printer error. #BREAK# ul ul [options] [names] Translate underscores to underlining. The correct sequence with which to do this will vary by terminal type. Some terminals are unable to handle underlining. Options -i Translate -, when on a separate line, to underline, instead of translating underscores. -t terminal-type Specify terminal type. By default, TERM is consulted. umount umount [options] [special-device/directory] System administration command. Unmount a filesystem. umount announces to the system that the removable file structure previously mounted on device special-device is to be removed. umount also works by specifying the directory. Any pending I/O for the filesystem is completed, and the file structure is flagged as clean. Options -a Unmount all filesystems that are listed in /etc/mtab. -n Unmount, but do not record changes in /etc/mtab. -t type Unmount only filesystems of type type. uname uname [options] Print information about the machine and operating system. Without options, print the name of the operating system (Linux). Options -a, –all Combine all the system information from the other options. -m, –machine Print the hardware the system is running on. -n, –nodename Print the machine’s hostname. -r, –release Print the release number of the kernel. -s, –sysname Print the name of the operating system (Linux). -p, –processor #BREAK# Print the type of processor (not available on all versions). -v Print build information about the kernel. –help Display a help message and then exit. –version Print version information and then exit. uncompress uncompress [options] files Uncompress files that were compressed (i.e., whose names end in .Z). See compress for the available options; uncompress takes all the same options except -r and -b. unexpand unexpand [options] [files] Convert strings of initial whitespace, consisting of at least two spaces and/or tabs to tabs. Read from standard input if given no file or a file named -. Options -a, –all Convert all, not just initial, strings of spaces and tabs. -nums, -t nums, –tabs nums nums is a comma-separated list of integers that specify the placement of tab stops. If a single integer is provided, the tab stops are set to every integer spaces. By default, tab stops are 8 spaces apart. With -t and –tabs, the list may be separated by whitespace instead of commas. This option implies -a. –help Print help message and then exit. –version Print the version number and then exit. uniq uniq [options] [file1 [file2]] Remove duplicate adjacent lines from sorted file1, sending one copy of each line to file2 (or to standard output). Often used as a filter. Specify only one of -d or -u. See also comm and sort. Options -n, -f n, –skip-fields=n Ignore first n fields of a line. Fields are separated by spaces or by tabs. +n, -s n, –skip-chars=n Ignore first n characters of a field. -c, –count Print each line once, prefixing number of instances. #BREAK# -d, –repeated Print duplicate lines once but no unique lines. -i, –ignore-case Ignore case differences when checking for duplicates. -u, –unique Print only unique lines (no copy of duplicate entries is kept). -w n, –check-chars=n Compare only first n characters per line (beginning after skipped fields and characters). –help Print a help message and then exit. –version Print version information and then exit. Examples Send one copy of each line from list to output file list.new: uniq list list.new Show which names appear more than once: sort names | uniq -d unshar unshar [options] [files] Unpack a shell archive (shar file). unshar scans mail messages looking for the start of a shell archive. It then passes the archive through a copy of the shell to unpack it. unshar accepts multiple files. If no files are given, standard input is used. Options -c, –overwrite Overwrite existing files. -d directory, –directory=directory Change to directory before unpacking any files. -e, –exit-0 Sequentially unpack multiple archives stored in same file; uses clue that many shar files are terminated by an exit 0 at the beginning of a line. (Equivalent to -E “exit 0″.) -E string, –split-at=string Like -e, but allows you to specify the string that separates archives. #BREAK# -f, –force Same as -c. –help Print help message and then exit. –version Print the version number and then exit. update update [options] System administration command. update is a daemon that controls how often the kernel’s disk buffers are flushed to disk. update is also known as bdflush. The daemon forks a couple of processes to call system functions flush() and sync(). When called by an unprivileged user, no daemon is created. Instead, update calls sync() and then exits. By default, update will wake up every 5 seconds and flush() some dirty buffers. If that doesn’t work, it will try waking up every 30 seconds to sync() the buffers to disk. Not all of the listed options are available in every version of update. Options -d Display the kernel parameters. This does not start the update daemon. -f seconds Call flush() at this interval. Default is 5. -h Help. Print a command summary. -s seconds Call sync() at this interval. Default is 30. -S Always use sync() instead of flush. -0 percent Flush buffers when the specified percent of the buffer cache is dirty. -1 blocks The maximum number of dirty blocks to write out per wake cycle. -2 buffers The number of clean buffers to try to obtain each time the free buffers are refilled. -3 blocks Flush buffers if dirty blocks exceed blocks when trying to refill the buffers. -4 percent #BREAK# Percent of buffer cache to scan when looking for free clusters. -5 seconds Time for a data buffer to age before being flushed. -6 seconds Time for a nondata buffer to age before being flushed. -7 constant The time constant to use for load average. -8 ratio How low the load average can be before trimming back the number of buffers. uptime uptime Print the current time, amount of time logged in, number of users currently logged in (which may include the same user multiple times), and system load averages. This output is also produced by the first line of the w command. useradd useradd [options] [user] System administration command. Create new user accounts or update default account information. Unless invoked with the -D option, user must be given. useradd will create new entries in system files. Home directories and initial files may also be created as needed. Options -c comment Comment field. -d dir Home directory. The default is to use user as the directory name under the home directory specified with the -D option. -e date Account expiration date. date is in the format MM/DD/YYYY. Two-digit year fields are also accepted. The value is stored as the number of days since January 1, 1970. This option requires the use of shadow passwords. -f days Permanently disable account this many days after the password has expired. A value of -1 disables this feature. This option requires the use of shadow passwords. -g group Initial group name or ID number. If a different default group has not been specified using the -D option, the default group is 1. -G groups #BREAK# Supplementary groups given by name or number in a comma-separated list with no whitespace. -k [dir] Copy default files to user’s home directory. Meaningful only when used with the -m option. Default files are copied from /etc/skel/ unless an alternate dir is specified. -m Make user’s home directory if it does not exist. The default is not to make the home directory. -o Override. Accept a nonunique uid with the -u option. (Probably a bad idea.) -s shell Login shell. -u uid Numerical user ID. The value must be unique unless the -o option is used. The default value is the smallest ID value greater than 99 and greater than every other uid. -D [options] Set or display defaults. If options are specified, set them. If no options are specified, display current defaults. The options are: -b dir Home directory prefix to be used in creating home directories. If the -d option is not used when creating an account, the user name will be appended to dir. -e date Expire date. Requires the use of shadow passwords. -f days Number of days after a password expires to disable an account. Requires the use of shadow passwords. -g group Initial group name or ID number. -s shell Default login shell. #BREAK# userdel userdel [option] user System administration command. Delete all entries for user in system account files. Option -r Remove the home directory of user and any files contained in it. usermod usermod [options] user System administration command. Modify user account information. Options -c comment Comment field. -d dir Home directory. -e date Account expiration date. date is in the format MM/DD/YYYY. Two-digit year fields are also accepted, but the value is stored as the number of days since January 1, 1970. This option requires the use of shadow passwords. -f days Permanently disable account this many days after the password has expired. A value of -1 disables this feature. This option requires the use of shadow passwords. -g group Initial group name or number. -G groups Supplementary groups given by name or number in a comma-separated list with no whitespace. user will be removed from any groups to which they currently belong that are not included in groups. -l name Login name. This cannot be changed while the user is logged in. -o Override. Accept a nonunique uid with the -u option. -s shell Login shell. -u uid Numerical user ID. The value must be unique unless the -o option is used. Any files owned by user in the user’s home directory will have their user ID changed automatically. Files outside of the home directory #BREAK# will not be changed. user should not be executing any processes while this is changed. users users [file] Print a space-separated list of each login session on the host. Note that this may include the same user multiple times. Consult file or, by default, /etc/utmp. usleep usleep [microseconds] usleep [options] Sleep some number of microseconds (default is 1). Options –help Print help information and then exit. –usage Print usage message and then exit. -v, –version Print version information. uudecode uudecode [-o outfile] [file] Read a uuencoded file and re-create the original file with the permissions and name set in the file (see uuencode). The -o option specifies an alternate output file. uuencode uuencode [-m] [file] name Encode a binary file. The encoding uses only printable ASCII characters and includes the permissions and name of the file. When file is reconverted via uudecode, the output is saved as name. If the file argument is omitted, uuencode can take standard input, so a single argument is taken as the name to be given to the file when it is decoded. With the -m option, base64 encoding is used. Example It’s common to encode a file and save it with an identifying extension, such as .uue. This example encodes the binary file flower12.jpg, names it rose.jpg, and saves it to a .uue file: % uuencode flower12.jpg rose.jpg > rose.uue Encode flower12.jpg and mail it: % uuencode flower12.jpg flower12.jpg | mail ellen@oreilly.com #BREAK# vacation vacation vacation [options] [user] Automatically return a mail message to the sender announcing that you are on vacation. Use vacation with no options to initialize the vacation mechanism. The process performs several steps. 1. Creates a .forward file in your home directory. The .forward file contains: user, “|/usr/bin/vacation user” user is your login name. The action of this file is to actually deliver the mail to user (i.e., you) and to run the incoming mail through vacation. 2. Creates the .vacation.pag and .vacation.dir files. These files keep track of who has sent you messages, so that they receive only one “I’m on vacation” message from you per week. 3. Starts an editor to edit the contents of .vacation.msg. The contents of this file are mailed back to whomever sends you mail. Within its body, $subject is replaced with the contents of the incoming message’s Subject line. Remove or rename the .forward file to disable vacation processing. Options The -a and -r options are used within a .forward file; see the example. -a alias Mail addressed to alias is actually mail for the user and should produce an automatic reply. -i Reinitialize the .vacation.pag and .vacation.dir files. Use this right before leaving for your next vacation. -r interval By default, no more than one message per week is sent to any sender. This option changes that interval. interval is a number with a trailing s, m, h, d, or w indicating seconds, minutes, hours, days, or weeks, respectively. If interval is infinite, only one reply is sent to each sender. Example Send no more than one reply every three weeks to any given sender: $ cd$ vacation -I$ cat .forwardjp, “|/usr/bin/vacation -r3w jp” $ cat .vacation.msgFrom: jp@wizard-corp.com (J. Programmer, via the vacation program) Subject: I’m out of the office … Hi. I’m off on a well-deserved vacation after finishingup whizprog 1.0. I will read and reply to your mailregarding “$SUBJECT” when I return. Have a nice day. #BREAK# vi vi [options] [files] A screen-oriented text editor based on ex. For more information on vi, see Chapter 11, “The vi Editor”. vidmode vidmode [option] image [mode [offset]] System administration command. Sets the video mode for a kernel image. If no arguments are specified, print current mode value. mode is a 1-byte value located at offset 506 in a kernel image. You may change the mode by specifying the kernel image to change, the new mode, and the byte offset at which to place the new information (the default is 506). Note that rdev -v is a synonym for vidmode. If LILO is used, vidmode is not needed. The video mode can be set from the LILO prompt during a boot. Modes -3 Prompt -2 Extended VGA -1 Normal VGA 0 Same as entering 0 at the prompt 1 Same as entering 1 at the prompt 2 Same as entering 2 at the prompt 3 Same as entering 3 at the prompt n Same as entering n at the prompt Option -o offset Same as specifying an offset as an argument. #BREAK# w w [options] [user] Print summaries of system usage, currently logged-in users, and what they are doing. w is essentially a combination of uptime, who, and ps -a. Display output for one user by specifying user. Options -f Toggle printing the from (remote hostname) field. -h Suppress headings and uptime information. -s Use the short format. -u Ignore the username while figuring out the current process and CPU times. -V Display version information. File /var/run/utmp List of users currently logged on. wall wall [file] System administration command. Write to all users. wall reads a message from the standard input until an end-of- file. It then sends this message to all users currently logged in, preceded by “Broadcast Message from…” If file is specified, read input from that, rather than from standard input. wc wc [options] [files] Print character, word, and line counts for each file. Print a total line for multiple files. If no files are given, read standard input. See other examples under ls and sort. Options -c, -bytes, –chars Print character count only. -l, –lines Print line count only. -w, –words Print word count only. –help #BREAK# Print help message and then exit. –version Print the version number and then exit. Examples Count the number of users logged in: who | wc -l Count the words in three essay files: wc -w essay.[123] Count lines in the file named by variable $file (don’t display filename): wc -l < $file whatis whatis keywords Search the short manual page descriptions in the whatis database for each keyword and print a one-line description to standard output for each match. Like apropos, except that it only searches for complete words. Equivalent to man -f. whereis whereis [options] files Locate the binary, source, and manual page files for specified commands/files. The supplied filenames are first stripped of leading pathname components and any (single) trailing extension of the form .ext (for example, .c). Prefixes of s. resulting from use of source code control are also dealt with. whereis then attempts to locate the desired program in a list of standard Linux directories (e.g., /bin, /etc, /usr/bin, /usr/local/bin/, etc.). Options -b Search only for binaries. -f Terminate the last directory list and signal the start of filenames; required when any of the -B, -M, or -S options are used. -m Search only for manual sections. -s Search only for sources. -u Search for unusual entries, that is, files that do not have one entry of each requested type. Thus, the command whereis -m -u * asks for those files in the current directory that have no documentation. -B directories #BREAK# Change or otherwise limit the directories to search for binaries. -M directory Change or otherwise limit the directories to search for manual sections. -S directory Change or otherwise limit the directories to search for sources. Example Find all files in /usr/bin that are not documented in /usr/man/man1 but that have source in /usr/src: % cd /usr/bin% whereis -u -M /usr/man/man1 -S /usr/src -f * which which [options] [--] [command] [...] List the full pathnames of the files that would be executed if the named commands had been run. which searches the user's $PATH environment variable. The C shell and tcsh have a built-in which command that has no options. To use the options, specify the full pathname (e.g., /usr/bin/which). Options -a, --all Print all matches, not just the first. -i, --read-alias Read aliases from standard input and write matches to standard output. Useful for using an alias for which. --skip-alias Ignore --read-alias if present. Useful for finding normal binaries while using --read-alias in an alias for which. --skip-dot Skip directories that start with a dot. --skip-tilde Skip directories that start with a tilde (~) and executables in $HOME. --show-dot If a matching command is found in a directory that starts with a dot, print ./cmdname instead of the full pathname. --show-tilde Print a tilde (~) to indicate the user's home directory. Ignored if the user is root. --tty-only Stop processing options on the right if not on a tty. #BREAK# -v, -V, --version Print version information and then exit. Example $ which cc ls/usr/bin/ccls: aliased to ls -sFC who who [options] [file] who am i Show who is logged in to the system. With no options, list the names of users currently logged in, their terminal, the time they have been logged in, and the name of the host from which they have logged on. An optional system file (default is /etc/utmp) can be supplied to give additional information. Options am i Print the username of the invoking user. --help Print a help message and then exit. -i, -u, --idle Include idle times. An idle time of . indicates activity within the last minute; one of old indicates no activity in more than a day. -l, --lookup Attempt to include canonical hostnames via DNS. -m Same as who am i. -q, --count "Quick." Display only the usernames and total number of users. --version Print version information and then exit. -w, -T, --mesg, --message, --writable Include user's message status: + mesg y (write messages allowed) - mesg n (write messages refused) #BREAK# ? Cannot find terminal device -H, --heading Print headings. Example This sample output was produced at 8 a.m. on April 17: $ who -uHNAME LINE TIME IDLE PID COMMENTSEarvin ttyp3 Apr 16 08:14 16:25 2240 Larry ttyp0 Apr 17 07:33 . 15182 Since Earvin has been idle since yesterday afternoon (16 hours), it appears that he isn't at work yet. He simply left himself logged in. Larry's terminal is currently in use. whoami whoami Print current user ID. Equivalent to id -un. write write user [tty] message Initiate or respond to an interactive conversation with user. A write session is terminated with EOF. If the user is logged in to more than one terminal, specify a tty number. See also talk; use mesg to keep other users from writing to your terminal. xargs xargs [options] [command] Execute command (with any initial arguments), but read remaining arguments from standard input instead of specifying them directly. xargs passes these arguments in several bundles to command, allowing command to process more arguments than it could normally handle at once. The arguments are typically a long list of filenames (generated by ls or find, for example) that get passed to xargs via a pipe. Options -0, --null Expect filenames to be terminated by NULL instead of whitespace. Do not treat quotes or backslashes specially. -e[string], --eof[=string] Set EOF to _ or, if specified, to string. --help Print a summary of the options to xargs and then exit. -i[string], --replace[=string] Edit all occurrences of {}, or string, to the names read in on standard input. Unquoted blanks are not considered argument terminators. Implies -x and -l 1. #BREAK# -l[lines], --max-lines[=lines] Allow no more than 1, or lines, nonblank input lines on the command line. Implies -x. -n args, --max-args=args Allow no more than args arguments on the command line. May be overridden by -s. -p, --interactive Prompt for confirmation before running each command line. Implies -t. -P max, --max-procs=max Allow no more than max processes to run at once. The default is 1. A maximum of 0 allows as many as possible to run at once. -r, --no-run-if-empty Do not run command if standard input contains only blanks. -s max, --max-chars=max Allow no more than max characters per command line. -t, --verbose Verbose mode. Print command line on standard error before executing. -x, --exit If the maximum size (as specified by -s) is exceeded, exit. --version Print the version number of xargs and then exit. Examples grep for pattern in all files on the system: find / -print | xargs grep pattern > out & Run diff on file pairs (e.g., f1.a and f1.b, f2.a and f2.b …): echo $* | xargs -n2 diff The previous line would be invoked as a shell script, specifying filenames as arguments. Display file, one word per line (same as deroff -w): cat file | xargs -n1 Move files in olddir to newdir, showing each command: ls olddir | xargs -i -t mv olddir/{} newdir/{} #BREAK# yacc yacc [options] file Given a file containing context-free grammar, convert file into tables for subsequent parsing and send output to y.tab.c. This command name stands for yet another compiler-compiler. See also flex, bison, and lex & yacc by John Levine, Tony Mason, and Doug Brown. Options -b prefix Prepend prefix, instead of y, to the output file. -d Generate y.tab.h, producing #define statements that relate yacc’s token codes to the token names declared by the user. -l Exclude #line constructs from code produced in y.tab.c. (Use after debugging is complete.) -t Compile runtime debugging code. -v Generate y.output, a file containing diagnostics and notes about the parsing tables. yes yes [strings] yes [option] Print the command-line arguments, separated by spaces and followed by a newline, until killed. If no arguments are given, print y followed by a newline until killed. Useful in scripts and in the background; its output can be piped to a program that issues prompts. Options –help Print a help message and then exit. –version Print version information and then exit. ypbind ypbind [options] NFS/NIS command. NIS binder process. ypbind is a daemon process typically activated at system startup time. Its function is to remember information that lets client processes on a single node communicate with some ypserv process. The information ypbind remembers is called a binding — the association of a domain name with the Internet address of the NIS server and the port on that host at which the ypserv process is listening for service requests. This information is cached in the file /var/yp/bindings/domainname.version. Options -ypset #BREAK# May be used to change the binding. This option is very dangerous and should be used only for debugging the network from a remote machine. -ypsetme ypset requests may be issued from this machine only. Security is based on IP address checking, which can be defeated on networks on which untrusted individuals may inject packets. This option is not recommended. ypcat ypcat [options] mname NFS/NIS command. Print values in an NIS database specified by mname, which may be either a map name or a map nickname. Options -d domain Specify domain other than default domain. -k Display keys for maps in which values are null or key is not part of value. -t Do not translate mname to map name. -x Display map nickname table listing the nicknames (mnames) known and map name associated with each nickname. Do not require an mname argument. ypchfn ypchfn [option] [user] NFS/NIS command. Change your information stored in /etc/passwd and displayed when you are fingered; distribute the change over NIS. Without options, ypchfn enters interactive mode and prompts for changes. To make a field blank, enter the keyword none. The superuser can change the information for any user. See also yppasswd and ypchsh. Options -f Behave like ypchfn (default). -l Behave like ypchsh. -p Behave like yppasswd. #BREAK# ypchsh ypchsh [option] [user] NFS/NIS command. Change your login shell and distribute this information over NIS. Warn if shell does not exist in /etc/shells. The superuser can change the shell for any user. See also yppasswd and ypchfn. Options -f Behave like ypchfn. -l Behave like ypchsh (default). -p Behave like yppasswd. ypinit ypinit [options] NFS/NIS command. Build and install an NIS database on an NIS server. ypinit can be used to set up a master or a slave server or slave copier. Only a privileged user can run ypinit. Options -c master_name Set up a slave copier database. master_name should be the hostname of an NIS server, either the master server for all the maps or a server on which the database is up-to-date and stable. -m Indicates that the local host is to be the NIS server. -s master_name Set up a slave server database. master_name should be the hostname of an NIS server, either the master server for all the maps or a server on which the database is up-to-date and stable. ypmatch ypmatch [options] key…mname NFS/NIS command. Print value of one or more keys from an NIS map specified by mname. mname may be either a map name or a map nickname. Options -d domain Specify domain other than default domain. -k Before printing value of a key, print key itself, followed by a colon (:). -t Do not translate nickname to map name. #BREAK# -x Display map nickname table listing the nicknames (mnames) known, and map name associated with each nickname. Do not require an mname argument. yppasswd yppasswd [option] [name] NFS/NIS command. Change login password in Network Information Service. Create or change your password, and distribute the new password over NIS. The superuser can change the password for any user. See also ypchfn and ypchsh. Options -f Behave like ypchfn. -l Behave like ypchsh. -p Behave like yppasswd (default). yppasswdd rpc.yppasswdd [option] NFS/NIS command. Server for modifying the NIS password file. yppasswdd handles password change requests from yppasswd. It changes a password entry only if the password represented by yppasswd matches the encrypted password of that entry and if the user ID and group ID match those in the server’s /etc/passwd file. Then it updates /etc/passwd and the password maps on the local server. Option -s Support shadow password functions. yppoll yppoll [options] mapname NFS/NIS command. Determine version of NIS map at NIS server. yppoll asks a ypserv process for the order number and the hostname of the master NIS server for the named map. Options -h host Ask the ypserv process at host about the map parameters. If host is not specified, the hostname of the NIS server for the local host (the one returned by ypwhich) is used. -d domain Use domain instead of the default domain. #BREAK# yppush yppush [options] mapnames NFS/NIS command. Force propagation of changed NIS map. yppush copies a new version of an NIS map, mapname, from the master NIS server to the slave NIS servers. It first constructs a list of NIS server hosts by reading the NIS map ypservers with the -d option’s domain argument. Keys within this map are the ASCII names of the machines on which the NIS servers run. A “transfer map” request is sent to the NIS server at each host, along with the information needed by the transfer agent to call back the yppush. When the attempt has been completed and the transfer agent has sent yppush a status message, the results may be printed to stdout. Normally invoked by /var/yp/Makefile. Options -d domain Specify a domain. -v Verbose — print message when each server is called and for each response. ypserv ypserv [options] NFS/NIS command. NIS server process. ypserv is a daemon process typically activated at system startup time. It runs only on NIS server machines with a complete NIS database. Its primary function is to look up information in its local database of NIS maps. The operations performed by ypserv are defined for the implementor by the NIS protocol specification and for the programmer by the header file . Communication to and from ypserv is by means of RPC calls. Options -d NIS service should go to the DNS for more host information. -localonly Indicates ypserv should not respond to outside requests. Files and directories /var/yp/[domainname]/ Location of NIS databases. /var/yp/Makefile Makefile that is responsible for creating NIS databases. ypset ypset [options] server NFS/NIS command. Point ypbind at a particular server. ypset tells ypbind to get NIS services for the specified domain from the ypserv process running on server. server indicates the NIS server to bind to and can be specified as a name or an IP address. Options -d domain Use domain instead of the default domain. #BREAK# -h host Set ypbind’s binding on host, instead of locally. host can be specified as a name or an IP address. ypwhich ypwhich [options] [host] NFS/NIS command. Return hostname of NIS server or map master. Without arguments, ypwhich cites the NIS server for the local machine. If host is specified, that machine is queried to find out which NIS master it is using. Options -d domain Use domain instead of the default domain. -m map Find master NIS server for a map. No host can be specified with -m. map may be a map name or a nickname for a map. -t mapname Inhibit nickname translation. -x Display map nickname table. Do not allow any other options. ypxfr ypxfr [options] mapname NFS/NIS command. Transfer an NIS map from the server to the local host by making use of normal NIS services. ypxfr creates a temporary map in the directory /etc/yp/domain (where domain is the default domain for the local host), fills it by enumerating the map’s entries, and fetches the map parameters and loads them. If run interactively, ypxfr writes its output to the terminal. However, if it is invoked without a controlling terminal, and if the log file /usr/admin/nislog exists, it appends all its output to that file. Options -b Preserve the resolver flag in the map during the transfer. -C tid prog ipadd port This option is for use only by ypserv. When ypserv invokes ypxfr, it specifies that ypxfr should call back a yppush process at the host with IP address ipadd, registered as program number prog, listening on port port, and waiting for a response to transaction tid. -c Do not send a “Clear current map” request to the local ypserv process. -d domain Specify a domain other than the default domain. -f Force the transfer to occur even if the version at the master is older than the local version. #BREAK# -h host Get the map from host, regardless of what the map says the master is. If host is not specified, ypxfr asks the NIS service for the name of the master and tries to get the map from there. host may be a name or an Internet address in the form h.h.h.h. -S Use only NIS servers running as root and using a reserved port. -s domain Specify a source domain from which to transfer a map that should be the same across domains (such as the services.byname map). zcat zcat [options] [files] Read one or more files that have been compressed with gzip or compress and write them to standard output. Read standard input if no files are specified or if - is specified as one of the files; end input with EOF. zcat is identical to gunzip -c and takes the options -fhLV described for gzip/gunzip. zcmp zcmp [options] files Read compressed files and pass them, uncompressed, to the cmp command, along with any command-line options. If a second file is not specified for comparison, look for a file called file.gz. zdiff zdiff [options] files Read compressed files and pass them, uncompressed, to the diff command, along with any command-line options. If a second file is not specified for comparison, look for a file called file.gz. zdump zdump [options] [zones] System administration command. Dump a list of all known time zones or, if an argument is provided, a specific zone or list of zones. Include each zone’s current time with its name. Options -c year Specify a cutoff year to limit verbose output. Meaningful only with -v. -v Verbose mode. Include additional information about each zone. zforce zforce [names] Rename all gzipped files to filename.gz, unless file already has a .gz extension. #BREAK# zgrep zgrep [options] [files] Uncompress files and pass to grep, along with any command-line arguments. If no files are provided, read from (and attempt to uncompress) standard input. May be invoked as zegrep or zfgrep and will in those cases invoke egrep or fgrep. zic zic [options] [files] System administration command. Create time conversion information files from the file or files specified. If the specified file is -, read information from standard input. Options -d directory Place the newly created files in directory. Default is /usr/local/etc/zoneinfo. -l timezone Specify a timezone to use for local time. zic links the zone information for timezone with the zone localtime. -p timezone Set the default rules for handling POSIX-format environment variables to the zone name specified by timezone. -s Store time values only if they are the same when signed as when unsigned. -v Verbose mode. Include extra error checking and warnings. -y command Check year types with command. Default is yearistype. -L file Consult file for information about leap seconds. The source file(s) for zic should be formatted as a sequence of rule lines, zone lines, and link lines. An optional file containing leap second rules can be specified on the command line. Rule lines describe how time should be calculated. They describe changes in time, daylight savings time, war time, and any other changes that might affect a particular time zone. Zone lines specify which rules apply to a given zone. Link lines link similar zones together. Leap lines describe the exact time when leap seconds should be added or subtracted. Each of these lines is made up of fields. Fields are separated from one another by any number of whitespace characters. Comment lines are preceded by a #. The fields used in each line are listed next. Rule line fields The format of a rule line is: Rule NAME FROM TO TYPE IN ON AT SAVE LETTERS NAME Name this set of rules. #BREAK# FROM Specify the first year to which this rule applies. Gregorian calendar dates are assumed. Instead of specifying an actual year, you may specify minimum or maximum for the minimum or maximum year representable as an integer. TO Specify the last year to which this rule applies. Syntax is the same as for the FROM field. TYPE Specify the type of year to which this rule should be applied. The wildcard - instructs that all years be included. Any given year’s type will be checked with the command given with the -y option or the default yearistype year type. An exit status of 0 is taken to mean the year is of the given type; an exit status of 1 means that it is not of the given type (see -y option). IN Specify month in which this rule should be applied. ON Specify day in which this rule should be applied. Whitespace is not allowed. For example: 1 The 1st firstSun The first Sunday Sun>=3 The first Sunday to occur before or on the 3rd AT Specify the time after which the rule is in effect. For example, you may use 13, 13:00, or 13:00:00 for 1:00 p.m.. You may include one of several suffixes (without whitespace between): s Local standard time. u, g, z Universal time. w Wall clock time (default). SAVE Add this amount of time to the local standard time. Formatted like AT, without suffixes. LETTERS #BREAK# Specify letter or letters to be used in time zone abbreviations (for example, S for EST). For no abbreviation, enter -. Zone line fields The format of a zone line is: Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL] NAME Time zone name. GMTOFF The amount of hours by which this time zone differs from GMT. Formatted like AT. Negative times are subtracted from GMT; by default, times are added to it. RULES/SAVE Either the name of the rule to apply to this zone or the amount of time to add to local standard time. To make the zone the same as local standard time, specify -. FORMAT How to format time zone abbreviations. Specify the variable part with %s. UNTIL Change the rule for the zone at this date. The next line must specify the new zone information and therefore must omit the string “Zone” and the NAME field. Link line fields The format of a link line is: Link LINK-FROM LINK-TO LINK-FROM The name of the zone that is being linked. LINK-TO An alternate name for the zone that was specified as LINK-FROM. Leap line fields The format of a leap line is: Leap YEAR MONTH DAY HH:MM:SS CORR R/S YEAR MONTH DAY HH:MM:SS Specify when the leap second happened. CORR Uses a + or a - to show whether the second was added or skipped. R/S #BREAK# An abbreviation of Rolling or Stationary to describe whether the leap second should be applied to local wall clock time or to GMT. zmore zmore [files] Similar to more. Uncompress files and print them, one screenful at a time. Works on files compressed with compress, gzip, or pack and with uncompressed files. Commands space Print next screenful. i[number] Print next screenful, or number lines. Set i to number lines. d, ^D Print next i, or 11, lines. iz Print next i lines or a screenful. is Skip i lines. Print next screenful. if Skip i screens. Print next screenful. q, Q, :q, :Q Go to next file, or, if current file is the last, exit zmore. e, q Exit zmore when the prompt “–More–(Next file: file)” is displayed. s Skip next file and continue. = Print line number. i/expr Search forward for ith occurrence (in all files) of expr, which should be a regular expression. Display occurrence, including the two previous lines of context. in Search forward for the ith occurrence of the last regular expression searched for. #BREAK# !command Execute command in shell. If command is not specified, execute last shell command. To invoke a shell without passing it a command, enter !. . Repeat the previous command. znew znew [options] [files] Uncompress .Z files and recompress them in .gz format. Options -9 Optimal (and slowest) compression method. -f Recompress even if filename.gz already exists. -t Test new .gz files before removing .Z files. -v Verbose mode. -K If the original .Z file is smaller than the .gz file, keep it. -P Pipe data to conversion program. This saves disk space. PreviousHomeNext2.8. RPC and XDR Book Index4. Boot Methods Copyright 2001 O’Reilly & QKFIN. All rights reserved. #BREAK# Book HomeSearch this bookLinux in a Nutshell PreviousLinux in a Nutshell, 3rd EditionNext Chapter 4. Boot Methods Contents: The Boot ProcessLILO: The Linux LoaderLoadlin: Booting from MS-DOSDual Booting Linux and Windows NT/2000Boot-time Kernel Optionsinitrd: Using a RAM Disk This chapter describes some techniques for booting your Linux system. Depending on your hardware and whether you want to run any other operating systems, you can configure the system to boot Linux automatically or to provide a choice between several operating systems. Choosing between operating systems is generally referred to as dual booting, but you can boot more than two (e.g., Linux and Windows 95/98/NT/2000). This chapter covers the following topics: l The boot process l LILO: the Linux loader l Loadlin: booting from MS-DOS l Dual booting Linux and Windows NT/2000 l Boot-time kernel options l initrd: using a RAM disk 4.1. The Boot Process Once your Linux system is up and running, booting the system generally is pretty #BREAK# straightforward. But with the wide variety of hardware and software in use, there are many possibilities for configuring your boot process. The three most common choices are: l Boot Linux from a floppy, leaving any other operating system to boot from the hard drive. l Use the Linux Loader, LILO.[2] This is probably the most common method of booting and lets you boot both Linux and other operating systems. [2]LILO is the standard boot program for i386-architecture machines. On the Alpha, the equivalent boot program is called MILO (Mini Loader), and on the SPARC, it is SILO. l Run Loadlin, which is an MS-DOS program that boots Linux from within DOS. Other boot managers that can load Linux are available, but we don’t discuss them in this chapter. We also won’t talk further about booting from a floppy except to say that whatever method you choose for booting, you should be sure to have a working boot floppy available for emergency use. In particular, don’t experiment with the files and options in this chapter unless you have a boot floppy, because any error could leave you unable to boot from the hard disk. On an Intel-based PC, the first sector of every hard disk is known as the boot sector and contains the partition table for that disk and possibly also code for booting an operating system. The boot sector of the first hard disk is known as the master boot record (MBR), because when you boot the system, the BIOS transfers control to a program that lives on that sector along with the partition table. That code is the boot loader, the code that initiates an operating system. When you add Linux to the system, you need to modify the boot loader, replace it, or boot from a floppy disk to start Linux. In Linux, each disk and each partition on the disk is treated as a device. So, for example, the entire first hard disk is known as /dev/hda and the entire second hard disk, if there is one, is /dev/hdb. The first partition of the first hard drive is /dev/hda1, and the second partition is /dev/hda2; the first partition of the second hard drive is /dev/hdb1; and so on. If your drives are SCSI instead of IDE, the naming works the same way except that the devices are /dev/sda, /dev/sda1, and so on. Thus, if you want to specify that the Linux partition is the second partition of the first hard drive (as in the examples in this chapter), you refer to it as /dev/hda2. The rest of the chapter describes the various techniques for booting Linux and the options that you can specify to configure both the boot loader that you use and the Linux kernel. Both LILO and Loadlin let you pass options to the loader and they also let you specify options for the kernel. #BREAK# PreviousHomeNext3. Linux Commands Book Index4.2. LILO: The Linux Loader Copyright 2001 O’Reilly & QKFIN. All rights reserved. #BREAK# Book HomeSearch this bookLinux in a Nutshell PreviousLinux in a Nutshell, 3rd EditionNext 4.2. LILO: The Linux Loader Once you’ve made the decision to install LILO, you still need to decide how it should be configured. If you want your system to dual boot Linux and Windows 95/98, you can install LILO on the master boot record (MBR) and set it up to let you select the system to boot. Dual booting Linux and Windows NT is not quite as straightforward, because Windows NT has its own loader on the MBR, and it expects to be the one in charge. Therefore, you need to make Linux an option in the NT loader and install LILO in the Linux partition as a secondary boot loader. The result is that the Windows NT loader transfers control to LILO, which then boots Linux. The same applies to Windows 2000, which uses the NT loader. See Section 4.4, “Dual Booting Linux and Windows NT/2000″ later in this chapter for more information. In addition to booting Linux, LILO can boot other operating systems, such as MS-DOS, Windows 95/98, or OS/2. During installation, the major Linux distributions provide the opportunity to install LILO; it can also be installed later if necessary. LILO can be installed on the master boot record (MBR) of your hard drive or as a secondary boot loader on the Linux partition. LILO consists of several pieces, including the boot loader itself, a configuration file (/etc/lilo.conf), a map file (/boot/map) containing the location of the kernel, and the lilo command (/sbin/lilo), which reads the configuration file and uses the information to create or update the map file and to install the files LILO needs. If LILO is installed on the MBR, it replaces the MS-DOS boot loader. If you have problems with your installation or you simply want to uninstall LILO and restore the original boot loader, you can do one of the following: l Boot Linux from a floppy disk and restore the backed-up boot sector: % /sbin/lilo -u l Boot to DOS and run a special version of the fdisk command that rebuilds the MBR: C:> fdisk /mbr One thing to remember about LILO is that it has two aspects: the boot loader and the lilo command. The lilo command configures and installs the boot loader and updates it as necessary. The boot loader is the code that executes at system boot time and boots Linux or another operating system. 4.2.1. The LILO Configuration File The lilo command reads the LILO configuration file, /etc/lilo.conf, to get the information it needs to install LILO. Among other things, it builds a map file containing the locations of all disk sectors needed for booting. Note that any time you change /etc/lilo.conf or rebuild or move a kernel image, you need to rerun lilo to rebuild the map file and update LILO. The configuration file starts with a section of global options, described in the next section. Global options are those that apply to every system boot, regardless of what operating system you are booting. Here is an example of a global section (a hash sign, #, begins a comment): boot = /dev/hda # The boot device is /dev/hda map = /boot/map # Save the map file as /boot/mapinstall = /boot/boot.b # The file to install as the new boot sector #BREAK# prompt # Always display the boot prompttimeout = 30 # Set a 3-second (30 tenths of a second) timeout Following the global section, there is one section of options for each Linux kernel and for each non-Linux operating system that you want LILO to be able to boot. Each of those sections is referred to as an image section, because each boots a different kernel image (shorthand for a binary file containing a kernel) or another operating system. Each Linux image section begins with an image= line. image = /boot/vmlinuz # Linux image file label = linux # Label that appears at the boot prompt root = /dev/hda2 # Location of the root filesystem vga = ask # Always prompt the user for VGA mode read-only # Mount read-only to run fsck for a filesystem check The equivalent section for a non-Linux operating system begins with other= instead of image=. For example: other = /dev/hda1 # Location of the partition label = dos table = /dev/hda # Location of the partition table Put LILO configuration options that apply to all images into the global section of /etc/lilo.conf and options that apply to a particular image into the section for that image. If an option is specified in both the global section and an image section, the setting in the image section overrides the global setting for that image. Here is an example of a complete /etc/lilo.conf file for a system that has the Linux partition on /dev/hda2: ## Global sectionboot=/dev/hda2map=/boot/map delay=30timeout=50promptvga=ask## Image section: For regular Linuximage=/boot/vmlinuz label=linux root=/dev/hda2 install=/boot/boot.b map=/boot/map read-only ## Image section: For testing a new Linux kernelimage=/testvmlinuz label=testlinux root=/dev/hda2 install=/boot/boot.b map=/boot/map read-only optional # Omit image if not available when map is built## Image section: For booting DOSother=/dev/hda1 label=dos loader=/boot/chain.b table=/dev/hda # The current partition table## Image section: For booting Windows 95other=/dev/hda1 #BREAK# label=win95 loader=/boot/chain.b table=/dev/hda 4.2.1.1. Global options In addition to the options listed here, the kernel options append, read-only, read-write, root, and vga (described in Section 4.2.1.3, “Kernel options” later) also can be set as global options. backup=backup-file Copies the original boot sector to backup-file instead of to the file /boot/boot.nnnn, where nnnn is a number that depends on the disk device type. boot=boot-device Sets the name of the device that contains the boot sector. boot defaults to the device currently mounted as root, such as /dev/hda2. Specifying a device such as /dev/hda (without a number) indicates that LILO should be installed in the master boot record; the alternative is to set it up on a particular partition such as /dev/hda2. compact Merges read requests for adjacent disk sectors to speed up booting. Use of compact is particularly recommended when booting from a floppy disk. Use of compact may conflict with linear. default=name Uses the image name as the default boot image. If default is omitted, the first image specified in the configuration file is used. delay=tsecs Specifies, in tenths of a second, how long the boot loader should wait before booting the default image. If serial is set, delay is set to 20 at a minimum. The default is to not wait. disk=device-name Defines parameters for the disk specified by device-name if LILO can’t figure them out. Normally, LILO can determine the disk parameters itself and this option isn’t needed. When disk is specified, it is followed by one or more parameter lines, such as: disk=/dev/sda bios= 0×80 # First disk is usually 0×80, second is usually 0×81 sectors= … heads= … Note that this option is not the same as the disk geometry parameters you can specify with the hd boot command-line option. With disk, the information is given to LILO; with hd, it is passed to the kernel. The parameters that can be specified with disk are listed briefly here. They are described in detail in the LILO User’s Guide, which comes with the LILO distribution. bios=bios-device-code The number the BIOS uses to refer to the device. See the previous example. cylinders=cylinders The number of cylinders on the disk. heads=heads The number of heads on the disk. #BREAK# inaccessible Tells LILO that the BIOS can’t read the disk; used to prevent the system from becoming unbootable if LILO thinks the BIOS can read it. partition=partition-device Starts a new section for a partition. The section contains one variable, start=partition-offset, which specifies the zero-based number of the first sector of the partition: partition=/dev/sda1 start=2048 sectors=sectors The number of sectors per track. disktab=disktab-file This option has been superseded by the disk= option. fix-table If set, allows lilo to adjust 3D addresses (addresses specified as sector/head/cylinder) in partition tables. This is sometimes necessary if a partition isn’t track-aligned and another operating system such as MS-DOS is on the same disk. See the lilo.conf manpage for details. force-backup=backup-file Like backup but overwrites an old backup copy if one exists. ignore-table Tells lilo to ignore corrupt partition tables. install=boot-sector Installs the specified file as the new boot sector. If install is omitted, the boot sector defaults to /boot/boot.b. lba32 Generates 32-bit Logical Block Addresses instead of sector/head/cylinder addresses, allowing booting from any partition on hard disks greater than 8.4GB (i.e., it removes the 1024-cylinder limit). Requires BIOS support for the EDD packet call interface[3] and at least LILO Version 21-4. [3]If your BIOS is dated after 1998, it should include EDD packet call interface support. linear Generates linear sector addresses, which do not depend on disk geometry, instead of 3D (sector/head/cylinder) addresses. If LILO can’t determine your disk’s geometry itself, you can try using linear; if that doesn’t work, then you need to specify the geometry with disk=. Note, however, that linear sometimes doesn’t work with floppy disks, and it may conflict with compact. lock #BREAK# Tells LILO to record the boot command line and use it as the default for future boots until it is overridden by a new boot command line. lock is useful if there is a set of options that you need to enter on the boot command line every time you boot the system. map=map-file Specifies the location of the map file. Defaults to /boot/map. message=message-file Specifies a file containing a message to be displayed before the boot prompt. The message can include a formfeed character (Ctrl-L) to clear the screen. The map file must be rebuilt by rerunning the lilo command if the message file is changed or moved. The maximum length of the file is 65,535 bytes. nowarn Disables warning messages. optional Specifies that any image that is not available when the map is created should be omitted and not offered as an option at the boot prompt. Like the per-image option optional but applies to all images. password=password Specifies a password that the user is prompted to enter when trying to load an image. The password is not encrypted in the configuration file, so if passwords are used, permissions should be set so that only the superuser is able to read the file. This option is like the per-image version, except that all images are password-protected and they all have the same password. prompt Automatically displays the boot prompt without waiting for the user to press the Shift, Alt, or Scroll Lock key. Note that setting prompt without also setting timeout prevents unattended reboots. restricted Can be used with password to indicate that a password needs to be entered only if the user specifies parameters on the command line. Like the per-image restricted option but applies to all images. serial=parameters Allows the boot loader to accept input from a serial line as well as from the keyboard. Sending a break on the serial line corresponds to pressing a Shift key on the console to get the boot loader’s attention. All boot images should be password-protected if serial access is insecure (e.g., if the line is connected to a modem). Setting serial automatically raises the value of delay to 20 (i.e., 2 seconds) if it is less than that. The parameter string parameters has the following syntax: port[,bps[parity[bits]]] For example, to initialize COM1 with the default parameters: serial=0,2400n8 The parameters are: #BREAK# port The port number of the serial port. The default is 0, which corresponds to COM1 (/dev/ttys0). The value can be one of 0 through 3, for the four possible COM ports. bps The baud rate of the serial port. Possible values of bps are 110, 300, 1200, 2400, 4800, 9600, 19200, and 38400. The default is 2400 bps. parity The parity used on the serial line. Parity is specified as: n or N for no parity, e or E for even parity, and o or O for odd parity. However, the boot loader ignores input parity and strips the 8th bit. bits Specifies whether a character contains 7 or 8 bits. Default is 8 with no parity and 7 otherwise. timeout=tsecs Sets a timeout (specified in tenths of a second) for keyboard input. If no key has been pressed after the specified time, the default image is booted automatically. timeout is also used to determine when to stop waiting for password input. The default timeout is infinite. verbose=level Turns on verbose output, where higher values of level produce more output. If -v is also specified on the lilo command line, the level is incremented by 1 for each occurrence of -v. The maximum verbosity level is 5. 4.2.1.2. Image options The following options are specified for a particular image. alias=name Provides an alternate name for the image that can be used instead of the name specified with the label option. image=pathname Specifies the file or device containing the boot image of a bootable Linux kernel. Each per-image section that specifies a bootable Linux kernel starts with an image option. See also the range option. label=name Specifies the name that is used for the image at the boot prompt. Defaults to the filename of the image file (without the path). loader=chain-loader For a non-Linux operating system, specifies the chain loader to which LILO should pass control for booting that operating system. The default is /boot/chain.b. If the system will be booted from a drive that is neither the first hard disk or a floppy, the chain loader must be specified. lock #BREAK# Like lock as described in the global options section; it can also be specified in an image section. optional Specifies that the image should be omitted if it is not available when the map is created by the lilo command. Useful for specifying test kernels that are not always present. password=password Specifies that the image is password-protected and provides the password that the user is prompted for when booting. The password is not encrypted in the configuration file, so if passwords are used, only the superuser should be able to read the file. range=sectors Used with the image option, when the image is specified as a device (e.g., image=/dev/fd0), to indicate the range of sectors to be mapped into the map file. sectors can be given as the range start-end or as start+number, where start and end are zero-based sector numbers and number is the increment beyond start to include. If only start is specified, only that one sector is mapped. For example: image = /dev/fd0 range = 1+512 # take 512 sectors, starting with sector 1 restricted Specifies that a password is required for booting the image only if boot parameters are specified on the command line. table=device Specifies, for a non-Linux operating system, the device that contains the partition table. If table is omitted, the boot loader does not pass partition information to the operating system being booted. Note that /sbin/lilo must be rerun if the partition table is modified. This option cannot be used with unsafe. unsafe Can be used in the per-image section for a non-Linux operating system to indicate that the boot sector should not be accessed when the map is created. If unsafe is specified, then some checking isn’t done, but the option can be useful for running the lilo command without having to insert a floppy disk when the boot sector is on a fixed-format floppy disk device. This option cannot be used with table. 4.2.1.3. Kernel options The following kernel options can be specified in /etc/lilo.conf as well as on the boot command line: append=string Appends the options specified in string to the parameter line passed to the kernel. This typically is used to specify certain hardware parameters. For example, if your system has more than 64 MB of memory (i.e., more than your BIOS can recognize), you can use append: append = “mem=128M” initrd=filename Specifies the file to load into /dev/initrd when booting with a RAM disk. See also the options load_ramdisk (in #BREAK# Section 4.5, “Boot-time Kernel Options”), prompt_ramdisk, ramdisk_size, and ramdisk_start (in Section 4.6, “initrd: Using a RAM Disk”). literal=string Like append but replaces all other kernel boot options. noinitrd Preserves the contents of /dev/initrd so they can be read once after the kernel is booted. prompt_ramdisk=n Specifies whether the kernel should prompt you to insert the floppy disk that contains the RAM disk image, for use during Linux installation. Values of n are: 0 Don’t prompt. Usually used for an installation in which the kernel and the RAM disk image both fit on one floppy. 1 Prompt. This is the default. ramdisk=size Obsolete; use only with kernels older than Version 1.3.48. For newer kernels, see the option load_ramdisk in Section 4.5, “Boot-time Kernel Options” as well as prompt_ramdisk, ramdisk_size, and ramdisk_start, elsewhere in this section. ramdisk_size=n Specifies the amount of memory, in kilobytes, to be allocated for the RAM disk. The default is 4096, which allocates 4 megabytes. ramdisk_start=offset Used for a Linux installation in which both the kernel and the RAM disk image are on the same floppy. offset indicates the offset on the floppy where the RAM disk image begins; it is specified in kilobytes. root=root-device Specifies the device that should be mounted as root. If the special name current is used as the value, the root device is set to the device on which the root filesystem currently is mounted. Defaults to the root-device setting contained in the kernel image. vga=mode Specifies the VGA text mode that should be selected when booting. mode defaults to the VGA mode setting in the kernel image. The values are case-insensitive. They are: ask Prompts the user for the text mode. Pressing Enter in response to the prompt displays a list of the available modes. extended (or ext) Selects 80×50 text mode. normal Selects normal 80×25 text mode. number Use the text mode that corresponds to number. A list of available modes for your video card can be obtained by booting with vga=ask and pressing Enter. #BREAK# 4.2.2. The lilo Command You need to run the lilo command to install the LILO boot loader and to update it whenever the kernel changes or to reflect changes to /etc/lilo.conf. The path to the lilo command is usually /sbin/lilo. The syntax of the command is: lilo [options] Some of the options correspond to /etc/lilo.conf keywords: Configuration Keyword Command Option boot=bootdev -b bootdev compact -c delay=tsecs -d tsecs default=label -D label disktab=file -f file install=bootsector -i bootsector lba32 -L linear -l map=mapfile -m mapfile fix-table -P fix ignore-table -P ignore backup=file -s file force-backup=file -S file verbose=level -v These options should be put in the configuration file whenever possible; putting them on the lilo command line instead of in /etc/lilo.conf is now deprecated. The next section describes those options that can be given only on the lilo command line; the others are described earlier in this section. 4.2.3. lilo Command Options The following list describes those lilo command options that are available only on the command line. Multiple options are given separately: % lilo -q -v -C config-file Specifies an alternative to the default configuration file (/etc/lilo.conf). lilo uses the configuration file to determine what files to map when it installs LILO. -I label #BREAK# Prints the path to the kernel specified by label to standard output or an error message if no matching label is found. For example: % lilo -I linux/boot/vmlinuz-2.0.34-0.6 -q Lists the currently mapped files. lilo maintains a file (by default /boot/map), containing the name and location of the kernel(s) to boot. Running lilo with this option prints the names of the files in the map file to standard output, as in this example (in which the asterisk indicates that linux is the default): % lilo -qlinux * test -r root-directory Specifies that before doing anything else, lilo should chroot to the indicated directory. Used for repairing a setup from a boot floppy — you can boot from a floppy but have lilo use the boot files from the hard drive. For example, if you issue the following commands, lilo will get the files it needs from the hard drive: % mount /dev/hda2 /mnt% lilo -r /mnt -R command-line Sets the default command for the boot loader the next time it executes. The command executes once and then is removed by the boot loader. This option typically is used in reboot scripts, just before calling shutdown -r. -t Indicates that this is a test. Does not really write a new boot sector or map file. Can be used with -v to find out what lilo would do during a normal run. -u device-name Uninstalls lilo by restoring the saved boot sector from /boot/boot.nnnn, after validating it against a timestamp. device-name is the name of the device on which LILO is installed, such as /dev/hda2. -U device-name Like -u but does not check the timestamp. -V Prints the lilo version number. PreviousHomeNext4. Boot Methods Book Index4.3. Loadlin: Booting from MS-DOS Copyright 2001 O’Reilly & QKFIN. All rights reserved. #BREAK# Book HomeSearch this bookLinux in a Nutshell PreviousLinux in a Nutshell, 3rd EditionNext 4.3. Loadlin: Booting from MS-DOS Loadlin is a Linux boot loader that you run from within a bootable MS-DOS partition; the system must be in real DOS mode, not in an MS-DOS window running under Windows. No installation is required; you just need to copy the executable file loadlin.exe from the Loadlin distribution to your MS-DOS partition.[4] You also need a compressed Linux kernel (e.g., vmlinuz), which you can load from a floppy, from the DOS partition, or from a RAM disk. For example: [4]If Loadlin didn’t come with your Linux distribution, you can download it from any of the major Linux sites, such as the Metalab site at http://metalab.unc.edu/pub/Linux. C:> loadlin c:vmlinuz root=/dev/hda2 This example loads the Linux kernel image vmlinuz, passing it the boot parameter root=/dev/hda2, telling the kernel that the Linux root partition is /dev/hda2. (If you are using a RAM disk, see Section 4.6, “initrd: Using a RAM Disk” later in this chapter.) If you want to use Loadlin with Windows 95/98, see the Loadlin User Guide and the Loadlin+Win95 mini-HOWTO for how to do that. Note that if your disk uses the FAT32 filesystem, the standard techniques for using Loadlin and Windows 95 won’t work; if this is the case or if you aren’t sure whether you have FAT16 or FAT32, it’s important to read the mini-HOWTO before you proceed. Loadlin can be run directly from the DOS prompt, as in the example, or it can be invoked from CONFIG.SYS or AUTOEXEC.BAT. Like LILO, Loadlin takes both options that direct its operation and options (also referred to as parameters) that it passes to the kernel. There are two forms of the Loadlin syntax: LOADLIN @paramsLOADLIN [zimage_file] [options] [boot_params] #BREAK# 4.3.1. Using a Parameter File In the first form of the preceding syntax, params is a DOS file that contains the options you want Loadlin to run with. The Loadlin distribution comes with a sample parameter file, test.par, that you can use as a basis for creating your own. Each line in a parameter file contains one parameter. If you want to specify the name of the Linux kernel to use (the image= parameter), it must be the first entry in the file. Comments start with a hash sign (#). The entries in the parameter file can be overridden or appended on the command line. For example, to override the value of vga set in the parameter file: C:> LOADLIN @myparam vga=normal 4.3.2. Putting Parameters on the Command Line In the second form of the preceding Loadlin syntax, zimage_file is the name of a Linux kernel to run, followed by a list of Loadlin options and/or boot options. Specifying LOADLIN with no parameters gives a help message listing the Loadlin options and some of the possible kernel boot options. The message is long enough that you probably want to pipe the output through a pager like more: C:> LOADLIN | more The Loadlin options are: -clone Bypasses certain checks — read the LOADLIN User Guide that comes with the Loadlin distribution before using. -d file Debug mode. Like -t but sends output to file as well as to standard output. -dskreset Causes disks to be reset after loading but before booting Linux. -noheap For use by serious Linux hackers only; disables use of the setup heap. -t #BREAK# Test mode. Goes through the loading process but doesn’t actually start Linux. Also sets -v. -txmode Sets the screen to text mode (80×25) on startup. -v Verbose. Prints parameter and configuration information to standard output. -wait=nn After loading, waits nn (DOS) ticks before booting Linux. In addition to these Loadlin options, the help message prints a number of kernel boot options that you can specify. The boot options that it prints are only a few of the many available boot options. See also the BootPrompt-HOWTO for a more complete list. PreviousHomeNext4.2. LILO: The Linux Loader Book Index4.4. Dual Booting Linux and Windows NT/2000 Copyright 2001 O’Reilly & QKFIN. All rights reserved. #BREAK# Book HomeSearch this bookLinux in a Nutshell PreviousLinux in a Nutshell, 3rd EditionNext 4.4. Dual Booting Linux and Windows NT/2000 As we said earlier, when you run Windows NT, its boot loader expects to be the one in charge; therefore, the normal way to dual boot Windows NT and Linux is to add Linux as an option on the NT boot menu. The information in this section also applies to Windows 2000, which uses the NT loader. To accomplish this, you need to provide the NT loader with a copy of the Linux boot sector. Here’s how you do that on a computer running Windows NT with an NTFS filesystem (note that Windows NT should be installed on your system already). See the NT OS Loader+Linux mini-HOWTO for more information and other alternatives. You should have a Linux boot floppy available so that, if necessary, you can boot Linux before the NT boot loader has been modified. You also should have a DOS-formatted floppy to transfer the boot sector to the Windows NT partition. If LILO is already installed, you may need to modify /etc/lilo.conf as described later. Otherwise, you’ll either install LILO as part of the Linux installation, or you can install it with the QuickInst script that comes with LILO. Once LILO is installed, and you have a configuration file, you can set up the system for dual booting. Note that the following instructions assume your Linux partition is on /dev/hda2. If Linux is on another partition, be sure to replace /dev/hda2 in the following examples with the correct partition. 1. Specify the Linux root partition as your boot device. If you are editing /etc/lilo.conf manually, your entry will look like this: boot=/dev/hda2 and will be the same as the root= entry. 2. Run the lilo command to install LILO on the Linux root partition. 3. At this point, if you need to reboot Linux, you’ll have to use the boot floppy, because the NT loader hasn’t been set up yet to boot Linux. 4. From Linux, run the dd command to make a copy of the Linux boot sector: % dd if=/dev/hda2 of=/bootsect.lnx bs=512 count=1 This command copies one block, with a blocksize of 512 bytes, from the input file /dev/hda2 to the output file /bootsect.lnx. (The output filename can be whatever makes sense to you; it doesn’t have to be bootsect.lnx.) 5. Copy bootsect.lnx to a DOS-formatted floppy disk: % mount -t msdos /dev/fd0 /mnt% cp /bootsect.lnx /mnt% umount /mnt 6. Reboot the system to Windows NT and copy the boot sector from the floppy disk to the hard disk. For example, using the command line to copy the file: C:> copy a:bootsect.lnx c:bootsect.lnx #BREAK# It doesn’t matter where on the hard drive you put the file because you’ll tell the NT loader where to find it in step 8. 7. Modify the attributes of the file boot.ini[5] to remove the system and read-only attributes so you can edit it: [5]boot.ini is the Windows NT counterpart to /etc/lilo.conf. It defines what operating systems the NT loader can boot. C:> attrib -s -r c:boot.ini 8. Edit boot.ini with a text editor to add the line: C:bootsect.lnx=”Linux” This line adds Linux to the boot menu and tells the Windows NT boot loader where to find the Linux boot sector. You can insert the line anywhere in the [operating systems] section of the file. Its position in the file determines where it will show up on the boot menu when you reboot your computer. Adding it at the end, for example, results in a boot.ini file that looks something like this (the second multi(0) entry is wrapped to fit in the margins of this page): [boot loader] timeout=30default=multi(0)disk(0)rdisk(0)partition(1)WINNT[operating systems] multi(0)disk(0)rdisk(0)partition(1)WINNT=”Windows NT Server Version 4.00″ multi(0)disk(0)rdisk(0)partition(1)WINNT=”Windows NT Server Version 4.00 [VGA mode]” /basevideo /sosC:bootsect.lnx=”Linux” If you want Linux to be the default operating system, modify the default= line to say: default=C:bootsect.lnx 9. Rerun attrib to restore the system and read-only attributes: C:> attrib +s +r c:boot.ini Now you can shut down Windows NT and reboot; NT will prompt you with a menu that looks something like this: OS Loader V4.00Please select the operating system to start: Windows NT Workstation Version 4.00Windows NT Workstation Version 4.00 [VGA mode] Linux Select Linux, and the NT loader reads the Linux boot sector and transfers control to LILO, on the Linux partition. If you later modify /etc/lilo.conf or rebuild the kernel, you need to rerun the lilo command, create a new bootsect.lnx file, and replace the version of bootsect.lnx on the Windows NT partition with the new version. That is, you need to rerun steps 2-6. NOTE If you have any problems or you simply want to remove LILO later, you can reverse the installation procedure: boot to Windows NT, change the system and read-only attributes on boot.ini, reedit boot.ini to remove the Linux entry, save the file, restore the system and read-only attributes, and remove the Linux boot sector from the NT partition. #BREAK# PreviousHomeNext4.3. Loadlin: Booting from MS-DOS Book Index4.5. Boot-time Kernel Options Copyright 2001 O’Reilly & QKFIN. All rights reserved. #BREAK# Book HomeSearch this bookLinux in a Nutshell PreviousLinux in a Nutshell, 3rd EditionNext 4.5. Boot-time Kernel Options The Loadlin and LILO sections of this chapter described some of the options you can specify when you boot Linux. There are many more options that can be specified. This section touches on the ways to pass options to the kernel and then describes some of the kinds of parameters you might want to use. The parameters in this section affect the kernel and therefore apply regardless of which boot loader you use. As always with Unix systems, there are a number of choices for the boot process itself. If you are using Loadlin, you can pass parameters to the kernel on the command line or in a file. If LILO is your boot loader, you can add to or override the parameters specified in /etc/lilo.conf during the boot process as follows: l If prompt is set in /etc/lilo.conf, LILO always presents the boot prompt and waits for input. At the prompt, you can choose the operating system to be booted. If you choose Linux, you also can specify parameters. l If prompt isn’t set, when the word “LILO” appears, press Control, Shift, or Alt, and the boot prompt appears. You also can press the Scroll Lock key before LILO is printed and not have to wait poised over the keyboard for the right moment. l At the boot prompt, specify the system you want to boot or press Tab to get a list of the available choices. You then can enter the name of the image to boot. For example: LILO boot:
linux test dosboot: linux You also can add boot command options: boot: linux single l If you don't provide any input, LILO waits the amount of time specified in the delay parameter and then boots the default operating system with the default parameters as #BREAK# set in /etc/lilo.conf. Some of the boot parameters have been mentioned earlier. Many of the others are hardware- specific and are too numerous to mention here. For a complete list of parameters and a discussion of the booting process, see the BootPrompt-HOWTO. Some of the parameters not shown earlier that you might find useful are listed next; many more are covered in the HOWTO. Most of the following parameters are used to provide information or instructions for the kernel, rather than to LILO. debug Prints all kernel messages to the console. hd=cylinders,heads,sectors Specifies the hard drive geometry to the kernel. Useful if Linux has trouble recognizing the geometry of your drive, especially if it's an IDE drive with more than 1024 cylinders. load_ramdisk=n Tells the kernel whether to load a RAM disk image for use during Linux installation. Values of n are: 0 Don't try to load the image. This is the default. 1 Load the image from a floppy disk to the RAM disk. mem=size Specifies the amount of system memory installed. Useful if your BIOS reports memory only up to 64 MB and your system has more memory installed. Specify as a number with M or k (case-insensitive) appended: mem=128M Because mem would have to be included on the command line for every boot, it often is specified on a command line saved with lock or with append to be added to the parameters passed to the kernel. #BREAK# noinitrd When set, disables the two-stage boot and preserves the contents of /dev/initrd so the data is available after the kernel has booted. /dev/initrd can be read only once, and then its contents are returned to the system. number Starts Linux at the runlevel specified by number. A runlevel is an operating state that the system can be booted to, such as a multiuser system or a system configuration running the X Window System. A runlevel is generally one of the numbers from 1 to 6; the default usually is 3. The runlevels and their corresponding states are defined in the file /etc/inittab. See the manpage for /etc/inittab for more information. ro Mounts the root filesystem read-only. Used for doing system maintenance, such as checking the filesystem integrity, when you don't want anything written to the filesystem. rw Mounts the root filesystem read-write. If neither ro nor rw is specified, the default value (usually rw) stored in the kernel image is used. single Starts Linux in single-user mode. This option is used for system administration and recovery. It gives you a root prompt as soon as the system boots, with minimal initialization. No other logins are allowed. PreviousHomeNext4.4. Dual Booting Linux and Windows NT/2000 Book Index4.6. initrd: Using a RAM Disk Copyright 2001 O'Reilly & QKFIN. All rights reserved. #BREAK# Book HomeSearch this bookLinux in a Nutshell PreviousLinux in a Nutshell, 3rd EditionNext 4.6. initrd: Using a RAM Disk Modern Linux distributions use a modular kernel, which allows modules to be added without requiring that the kernel be rebuilt. If your root filesystem is on a device whose driver is a module, as is frequently true of SCSI disks, you can use the initrd facility, which provides a two-stage boot process, to first set up a temporary root filesystem in a RAM disk containing the modules you need to add (e.g., the SCSI driver) and then load the modules and mount the real root filesystem. The RAM disk containing the temporary filesystem is the special device file /dev/initrd. Before you can use initrd, both RAM disk support (CONFIG_BLK_DEV_RAM=y) and initial RAM disk support (CONFIG_BLK_DEV_INITRD=y) must be compiled into the Linux kernel. Then you need to prepare the normal root filesystem and create the RAM disk image. Your Linux distribution may have utilities to do some of the setup for you; for example, the Red Hat distribution comes with the mkinitrd command, which builds the initrd image. For detailed information, see the initrd manpage and the file initrd.txt (the path may vary but is usually something like /usr/src/linux/Documentation/initrd.txt). Once your Linux system has been set up for initrd, you can do one of the following, depending on which boot loader you are using: l If LILO is your boot loader, add the initrd option to the appropriate image section: image = /vmlinuz initrd = /boot/initrd # The file to load as the contents of /dev/initrd ... Run the /sbin/lilo command, and you can reboot with initrd. l If you are using Loadlin, add the initrd option to the command line: loadlin c:linuxvmlinuz initrd=c:linuxinitrd PreviousHomeNext4.5. Boot-time Kernel Options Book Index5. Red Hat and Debian Package Managers Copyright 2001 O'Reilly & QKFIN. All rights reserved. #BREAK# Book HomeSearch this bookLinux in a Nutshell PreviousLinux in a Nutshell, 3rd EditionNext Chapter 5. Red Hat and Debian Package Managers Contents: The Red Hat Package ManagerThe Debian Package Manager This chapter describes the two major Linux packaging systems, the Red Hat Package Manager (RPM) and the Debian GNU/Linux Package Manager. When you want to install applications on your Linux system, most often you'll find a binary or a source package containing the application you want, instead of (or in addition to) a .tar.gz file. A package is a file containing the files necessary to install an application. But note that while the package contains the files you need for installation, the application might require the presence of other files or packages that are not included, such as particular libraries (and even specific versions of the libraries), in order to be able to run. Such requirements are known as dependencies. Package management systems offer many benefits. As a user, you may find you want to query the package database to find out what packages are installed on the system and their versions. As a system administrator, you need tools to install and manage the packages on your system. And, if you are also a developer, you need to know how to build a package for distribution. Among other things, package managers: l Provide tools for installing, updating, removing, and managing the software on your system. l Let you install new or upgraded software directly across a network. l Tell you what software package a particular file belongs to or what files a package contains. l Maintain a database of packages on the system and their state, so you can find out what packages or versions are installed on your system. l Provide dependency checking, so you don't mess up your system with incompatible software. l Provide PGP, MD5, or other signature verification tools. l Provide tools for building packages. Any user can list or query packages. However, installing, upgrading, or removing packages generally requires superuser privileges. This is because the packages normally are installed in systemwide directories that are #BREAK# writable only by root. Sometimes you can specify an alternate directory, to install, for example, a package into your home directory or into a project directory where you have write permission. Both RPM and the Debian Package Manager back up old files before installing an updated package. Not only does this let you go back if there is a problem, but also if you've made changes (to configuration files, for example), they aren't completely lost. 5.1. The Red Hat Package Manager The Red Hat Package Manager (RPM) is a freely available packaging system for software distribution and installation. In addition to Red Hat and Red Hat-based distributions, both SuSE and Caldera are among the Linux distributions that use RPM. Using RPM is straightforward. A single command, rpm, has options to perform all the package functions. For example, to find out if the Emacs editor is installed on your system, you could say: % rpm -q emacsemacs-20.4-4 In addition, the GNOME-RPM program provides an X-based graphical frontend to RPM (that can be run even if you are not running GNOME). This section describes the rpm command and then the gnorpm command that runs GNOME-RPM. 5.1.1. The rpm Command RPM packages are built, installed, and queried with the rpm command. RPM package names usually end with a .rpm extension. rpm has a set of modes, each with its own options. The format of the rpm command is: rpm [options] [packages] With a few exceptions, as noted in the lists of options that follow, the first option specifies the rpm mode (e.g., install, query, update, build, etc.), and any remaining options affect that mode. In the option descriptions that refer to packages, you'll sometimes see them specified as package-name and sometimes as package-file. The package name is the name of the program or application, such as gif2png. The package file is the name of the RPM file: gif2png-2.2.5-1.i386.rpm. RPM provides a configuration file for specifying frequently used options. The system configuration file is usually /etc/rpmrc, and users can set up their own $HOME/.rpmrc file. You can use the --showrc option to show the values RPM will use for all the options that may be set in an rpmrc file: rpm --showrc The rpm command includes FTP and HTTP clients, so you can specify an ftp:// or http:// URL to install or query a package across the Internet. You can use an FTP or HTTP URL wherever package-file is specified in the commands presented here. Any user can query the RPM database. Most of the other functions require superuser privileges. 5.1.1.1. General options The following options can be used with all modes: #BREAK# --dbpath path Use path as the path to the RPM database. --ftpport port Use port as the FTP port. --ftpproxy host Use host as a proxy server for all transfers. Specified if you are FTPing through a firewall system that uses a proxy. --help Print a long usage message (running rpm with no options gives a shorter usage message). --justdb Update only the database; don't change any files. --pipe command Pipe the rpm output to command. --quiet Display only error messages. --rcfile filename Use filename as the configuration file instead of the system configuration file /etc/rpmrc or $HOME/.rpmrc. --root dir Perform all operations within directory dir. --version Print the version number of rpm. -vv Print debugging information. 5.1.1.2. Install, upgrade, and freshen options Install or upgrade an RPM package. The syntax of the install command is: rpm -i [install-options] package_file ... #BREAK# rpm --install [install-options] package_file ... To install a new version of a package and remove an existing version at the same time, use the upgrade command instead: rpm -U [install-options] package_file ... rpm --upgrade [install-options] package_file ... One feature of -U is that if the package doesn't already exist on the system, it acts like -i and installs it. To prevent that behavior, you can freshen a package instead; in that case, rpm upgrades the package only if an earlier version is already installed. The freshen syntax is: rpm -F [install-options] package_file ... rpm --freshen [install-options] package_file ... Installation and upgrade options are: --allfiles Install or upgrade all files. --badreloc Used with --relocate to force relocation even if the package is not relocatable. --excludedocs Don't install any documentation files. --excludepath path Don't install any file whose filename begins with path. --force Force the installation. Equivalent to using --replacepkgs, --replacefiles, and --oldpackage. -h, --hash Print 50 hash marks as the package archive is unpacked. Use with --version for a nicer display. --ignorearch Install even if the binary package is intended for a different architecture. --ignoreos Install binary package even if the operating systems don't match. --ignoresize Don't check disk space availability before installing. #BREAK# --includedocs Install documentation files. This is needed only if excludedocs: 1 is specified in an rpmrc file. --nodeps Don't check whether this package depends on the presence of other packages. --noorder Don't reorder packages to satisfy dependencies before installing. --noscripts Don't execute any preinstall or postinstall scripts. --notriggers Don't execute any scripts triggered by package installation. --oldpackage Allow an upgrade to replace a newer package with an older one. --percent Print percent-completion messages as files are unpacked. --prefix path Set the installation prefix to path for relocatable packages. --replacefiles Install the packages even if they replace files from other installed packages. --replacepkgs Install the packages even if some of them are already installed. --test Go through the installation to see what it would do, but don't actually install the package. 5.1.1.3. Query options The syntax for the query command is: rpm -q[information-options] [package-options] rpm --query[information-options] [package-options] #BREAK# There are two subsets of query options: package selection options that determine what packages to query and information selection options that determine what information to provide. 5.1.1.3.1. Package selection options package_name Query the installed package package_name. -a, --all Query all installed packages. -f file, --file file Find out what package owns file. -g group, --group group Find out what packages have group group. -p package_file Query the uninstalled package package_file. --querybynumber num Query the numth database entry. Primarily useful for debugging. -qf, --queryformat num Specify the format for displaying the query output, using tags to represent different types of data (e.g., NAME, FILENAME, DISTRIBUTION). The format specification is a variation of the standard printf formatting. (Use --querytags in Section 5.1.1.8, "Miscellaneous options" to view a list of available tags. --specfile specfile Query specfile as if it were a package. --triggeredby pkg List packages that trigger installation of package pkg. --whatrequires capability List packages that require the given capability to function. --whatprovides capability List packages that provide the given capability. 5.1.1.3.2. Information selection options -c, --configfiles List configuration files in the package. #BREAK# --changelog Display the log of change information for the package. -d, --docfiles List documentation files in the package. --dump Dump information for each file in the package. This option must be used with at least one of -l, -c, or -d. The output includes the following information in this order: path size mtime md5sum mode owner group isconfig isdoc rdev symlink --filesbypkg List all files in each package. -i Display package information, including the name, version, and description. -l, --list List all files in the package. --last List packages by install time, with the latest packages listed first. --provides List the capabilities this package provides. -R, --requires List any packages this package depends on. -s, --state List each file in the package and its state. The possible states are normal, not installed, or replaced. --scripts List any package-specific shell scripts used during installation and uninstallation of the package. 5.1.1.4. Uninstall options The syntax for the uninstall command is: #BREAK# rpm -e package_namerpm --erase package_name The uninstall options are: --allmatches Remove all versions of the package. Only one package should be specified; otherwise, an error results. --nodeps Don't check dependencies before uninstalling the package. --noscripts Don't execute any preuninstall or postuninstall scripts. --notriggers Don't execute any scripts triggered by the removal of this package. --test Don't really uninstall anything; just go through the motions. 5.1.1.5. Verify options The syntax for the verify command is: rpm -V|-y| -- verify[package-selection-options] Verify mode compares information about the installed files in a package with information about the files that came in the original package and displays any discrepancies. The information compared includes the size, MD5 sum, permissions, type, owner, and group of each file. Uninstalled files are ignored. The package selection options include those available for query mode, as well as the following: --nofiles Ignore missing files. --nomd5 Ignore MD5 checksum errors. --nopgp Ignore PGP checking errors. The output is formatted as an eight-character string, possibly followed by a "c" to indicate a configuration file, and then the filename. Each of the eight characters in the string represents the result of comparing one file attribute to the value of that attribute from the RPM database. A period (.) indicates that the file passed that test. The #BREAK# following characters indicate failure of the corresponding test: 5 MD5 sum D Device G Group L Symlink M Mode (includes permissions and file type) S File size T Mtime U User 5.1.1.6. Database rebuild options The syntax of the command to rebuild the RPM database is: rpm --rebuilddb [options] You also can build a new database: rpm --initdb [options] The options available with the database rebuild mode are the --dbpath and --root options described earlier under Section 5.1.1.1, "General options". 5.1.1.7. Signature check options RPM packages may have a PGP signature built into them. PGP configuration information is read from /etc/rpmrc. The syntax of the signature-check mode is: rpm --checksig package_file... rpm -K package_file... The signature-checking options are: --nogpg Don't check any GPG signatures. --nomd5 Don't check any MD5 signatures. --nopgp Don't check any PGP signatures. #BREAK# Two other options let you add signatures to packages: --addsign binary-pkgfile... Generate and append new signatures to those that already exist in the specified binary packages. --resign binary-pkgfile... Generate and insert new signatures in the specified binary packages, removing any existing signatures. 5.1.1.8. Miscellaneous options Several additional rpm options are available: --querytags Print the tags available for use with the --queryformat option in query mode. --setgids packages Set file owner and group of the specified packages to those in the database. --setperms packages Set file permissions of the specified packages to those in the database. --showrc Show the values rpm will use for all options that can be set in an .rpmrc file. 5.1.1.9. FTP/HTTP options The following options are available for use with ftp:// and http:// URLs in install, update, and query modes: --ftpport port Use port for making an FTP connection on the proxy FTP server instead of the default port. Same as specifying the macro _ftpport. --ftpproxy host Use host as the proxy server for FTP transfers through a firewall that uses a proxy. Same as specifying the macro _ftpproxy. --httpport port Use port for making an HTTP connection on the proxy HTTP server instead of the default port. Same as specifying the macro _httpport. --httpproxy host #BREAK# Use host as a proxy server for HTTP transfers. Same as specifying the macro _httpproxy. 5.1.1.10. Build options The syntax for the build options is: rpm -[b|t]step [build-options] spec-file ... Specify -b to build a package directly from a spec file or -t to open a tarred gzipped file and use its spec file. Both forms take the following single-character step arguments: p Perform the prep stage, unpacking source files and applying patches. l Do a list check, expanding macros in the files section of the spec file and verifying that each file exists. c Perform the build stage. Done after the prep stage; generally equivalent to doing a make. i Perform the install stage. Done after the prep and build stages; generally equivalent to doing a make install. b Build a binary package. Done after prep, build, and install. s Build a source package. Done after prep, build, and install. a Build both binary and source packages. Done after prep, build, and install. The following additional options can be used when building an rpm file: --buildarch arch --buildos os For use with pre-3.0 versions of RPM. Build the package for architecture arch or the operating system os. Replaced in 3.0 with --target. --buildroot dir Override the BuildRoot tag with dir when building the package. #BREAK# --clean Clean up (remove) the build files after the package has been made. --rmsource Remove the source files and the spec file when the build is done. Can be used as a standalone option with rpm to clean up files separately from creating the packages. --short-circuit Can be used with -bc and -bi to skip previous stages. --sign Add a PGP signature to the package. --target platform When building the package, set the macros _target, _target_arch, and _target_os to the value indicated by platform. --test Go through the motions, but don't execute any build stages. Used for testing spec files. --timecheck Set the timecheck age (the maximum age in seconds of a file being packaged). Set to 0 to disable. Two other options can be used standalone with rpm to recompile or rebuild a package: --rebuild source-pkgfile... Like --recompile, but also build a new binary package. Remove the build directory, the source files, and the spec file once the build is complete. --recompile source-pkgfile... Install the named source package, and prep, compile, and install the package. 5.1.1.11. RPM examples Query the RPM database to find Emacs-related packages: % rpm -q -a | grep emacs Query an uninstalled package, printing information about the package, and list the files it contains: % rpm -qpil ~/downloads/bash2-doc-2.03-8.i386.rpm Install a package (assumes superuser privileges): #BREAK# % rpm -i sudo-1.5.3-6.i386.rpm 5.1.2. GNOME-RPM GNOME-RPM is a graphical user frontend to rpm that runs under X. You can run gnorpm even if you are not running GNOME. When you run gnorpm, it opens a window that lets you manage your rpm packages via a graphical interface. The format of the gnorpm command is: gnorpm [options] 5.1.2.1. gnorpm options The gnorpm options are: --geometry=geom Specify the geometry of the main window in standard X geometry format (i.e., w h+x+y). -i pkgfiles, --install pkgfiles Install the specified packages. -p pkgs, --packages pkgs The packages are in files, not in the rpm database (i.e., they haven't been installed yet). -q pkgs, --query pkgs Display a query window for the specified installed packages. -qp pkgfiles, --query --packages pkgfiles Display a query window for the specified package files. This is the same as specifying the -q and -p options. -U pkgfiles, --upgrade pkgfiles Upgrade the specified packages. -K pkgfiles, --checksig pkgfiles Check the signatures on the specified packages. -y pkgs, --verify pkgs Verify the specified packages. -?, --help Display a help message and exit. #BREAK# --root=dir Specify the filesystem root to use. --usage Display a brief usage message and exit. 5.1.2.2. The GNOME-RPM window The GNOME-RPM main window has five parts. At the top is a menu bar with three buttons: Packages Menu options are Query, Uninstall, and Verify. Operations Menu options are Find, Web find, Install, and Preferences. Help Provides online help for GNOME-RPM. Below the menu bar is a toolbar, with buttons to Install, Unselect, Uninstall, Query, Verify, Find, and Web find. At the very bottom of the window is a status bar. The rest of the window is the main panel. On the left is the package panel, which displays package folders in a tree structure. Clicking on a folder selects it; double-click to display the contents of the folder (i.e., the packages in that folder) on the righthand panel. Clicking on a package selects it; you then can use the menus and the toolbar buttons to operate on the package. You can select several packages at the same time and operate on them as a group. Right-clicking on a package icon selects the package if it isn't already and presents a menu with Query, Uninstall, and Verify options. See the GNOME-RPM documentation and online help for full details. PreviousHomeNext4.6. initrd: Using a RAM Disk Book Index5.2. The Debian Package Manager Copyright 2001 O'Reilly & QKFIN. All rights reserved. #BREAK# Book HomeSearch this bookLinux in a Nutshell PreviousLinux in a Nutshell, 3rd EditionNext 5.2. The Debian Package Manager Debian GNU/Linux provides several package management tools, primarily intended to facilitate the building, installation, and management of binary packages. Debian package names generally end in .deb. The Debian package management tools include: dpkg Until recently, the most important of the Debian packaging tools and still the primary package management program. Used to install or uninstall packages or as a frontend to dpkg-deb. dpkg-deb Lower-level packaging tool. Used to create and manage the Debian package archives. Accepts and executes commands from dpkg or can be called directly. dselect An interactive frontend to dpkg. apt-get The currently available piece of the Advanced Package Tool (APT), which is still being developed and is intended to be a modern, user-friendly package management tool. Can be run from the command line or selected as a method from dselect. One of the features of apt-get is that you can use it to get and install packages across the Internet by specifying an ftp:// or http:// URL. Another feature is that you can use it to upgrade all packages currently installed on your system in a single operation. 5.2.1. Files Some important files used by the Debian package management tools are: control Comes with each package; documents dependencies; contains the name and version of the package, a description, maintainer, installed size, and so on. conffiles Comes with each package and contains a list of the configuration files associated with the package. preinst, postinst, prerm, postrm Scripts that can be included in a package to be run before installation, after installation, before removal, or after removal of the package. /var/lib/dpkg/available #BREAK# Contains information about packages available on the system. /var/lib/dpkg/status Contains information about the status of packages available on the system. /etc/apt/sources.list A list for APT of package sources, used to locate packages. The sources are listed one per line, in order of preference. /etc/apt/apt.conf The main APT configuration file. 5.2.2. Package States and Selection States The possible states that a package can be in are: config-files Only the configuration files for the package are present on the system. half-configured The package is unpacked and configuration was started but not completed. half-installed Installation was started but not completed. installed The package is unpacked and configured. not-installed The package is not installed. unpacked The package is unpacked but not configured. The possible package selection states are: deinstall The package has been selected for deinstallation (i.e., for removal of everything but configuration files). install The package has been selected for installation. purge The package has been selected to be purged (i.e., for removal of everything including the configuration files). #BREAK# 5.2.3. Package Flags There are two possible package flags that can be set for a package. They are: hold The package is not to be handled by dpkg, unless forced with the --force-hold option. reinst-required The package is broken and needs to be reinstalled. Such a package cannot be removed, unless forced with the --force- reinstreq option. 5.2.4. Scripts In addition to the commands described in the next subsection, several shell and Perl scripts are included with the package manager for use in building packages: dpkg-buildpackage Help automate package building. Shell script. dpkg-distaddfile Add an entry for a file to debian/files. Perl script. dpkg-genchanges Generate an upload control file from the information in an unpacked, built, source tree and the files it has generated. Perl script. dpkg-gencontrol Read information from an unpacked source tree and display a binary package control file on standard output. Perl script. dpkg-name Rename Debian packages to their full package names. Shell script. dpkg-parsechangelog Read and parse the changelog from an unpacked source tree and write the information to standard output in machine- readable form. Perl script. dpkg-scanpackages Create a Packages file from a tree of binary packages. The Packages file is used by dselect to provide a list of packages available for installation. Perl script. dpkg-shlibdeps Calculate shared library dependencies for named executables. Perl script. dpkg-source #BREAK# Pack and unpack Debian source archives. Perl script. 5.2.5. Debian Package Manager Command Summary apt- cdrom apt-cdrom [options] command Add a new CD-ROM to APT's list of available sources. Currently, the only command is add, which is required (except with the --help option). The database of CD-ROM IDs that APT maintains is /var/state/apt/cdroms.list. Options Options can be specified on the command line or they may be set in the configuration file. Boolean options set in the configuration file can be overridden on the command line in a number of different ways, a couple of which are --no-opt and -opt=no, where opt is the single-character or full name of the option. -a, --thorough Do a thorough package scan. May be needed with some old Debian CD-ROMs. -c, --config-file Specify a configuration file to be read after the default configuration file. -d, --cdrom Specify the CD-ROM mount point, which must be listed in /etc/fstab. The configuration option is Acquire::cdrom::mount. -f, --fast Do a fast copy, assuming the files are valid and don't all need checking. Specify this only if this disk has been run before without error. The configuration option is APT::CDROM::Fast. -h, --help Print help message and exit. -m, --no-mount Don't mount or unmount the mount point. The configuration option is APT::CDROM::NoMount. -n, --just-print, --recon, --no-act Check everything, but don't actually make any changes. The configuration option is APT::CDROM::NoAct. -o, --option Set a configuration option. Syntax is -o group::tool=option (e.g., APT::CDROM=Fast). -r, --rename Prompt for a new label and rename the disk to the new value. The configuration option is APT::CDROM::Rename. -v, --version #BREAK# Print the version information and exit. apt-get apt-get [options] command [package...] A command-line tool for handling packages. Will eventually be a backend to APT. Commands autoclean Like clean, but remove only package files that can no longer be downloaded. clean Clear the local repository of retrieved package files. check Update the package cache and check for broken packages. dist-upgrade Like upgrade but also handle dependencies intelligently. dselect-upgrade Used together with dselect. Track the changes made by dselect to the Status field of available packages and take actions necessary to realize that status. install package... Install one or more packages. Specify the package name, not the full filename. Other required packages also are retrieved and installed. With a hyphen appended to the package name, the package is removed if it is already installed. remove package... Remove one or more packages. Specify the package name, not the full filename. With a plus sign appended to the name, the package is installed. source package... Find source packages and download them into the current directory. If specified with --compile, the source packages are compiled into binary packages. With --download-only, the source packages are not unpacked. update Resynchronize the package overview files from their sources. Must be done before an upgrade or dist- upgrade. upgrade Install the latest versions of all packages currently installed. Run update first. Options #BREAK# Options can be specified on the command line or they may be set in the configuration file. Boolean options set in the configuration file can be overridden on the command line in one of several ways, a couple of which are --no- opt and -opt=no, where opt is the single-character or full name of the option. -b, --compile, --build Compile source packages after download. -c, --config-file Specify a configuration file to read after the default. -d, --download-only Retrieve package files, but don't unpack or install them. The configuration option is APT::Get::Download- only. -f, --fix-broken Try to fix a system with broken dependencies. Can be used alone or with a command. The configuration option is APT::Get::Fix-Broken. --force-yes Force yes. Causes APT to continue without prompting if it is doing something that could damage your system. Use with great caution and only if absolutely necessary. The configuration option is APT::Get::force-yes. -h, --help Display a help message and exit. --ignore-hold Ignore a hold placed on a package. Use with dist-upgrade to override many undesired holds. The configuration option is APT::Get::Ignore-Hold. -m, --ignore-missing, --fix-missing Ignore missing or corrupted packages or packages that cannot be retrieved. Can cause problems when used with -f. --no-download Disable package downloading; use with --ignore-missing to force APT to use only the packages that have already been downloaded. --no-upgrade Do not upgrade packages. Use with install to prevent upgrade of packages that are already installed. The configuration option is APT::Get::no-upgrade. -o, --option Set a configuration option. Syntax is -o group::tool=option (e.g., APT::Get=force-yes). #BREAK# --print-uris Print URIs of files instead of fetching them. Print path, destination filename, size, and expected MD5 hash. The configuration option is APT::Get::Print-URIs. -q, --quiet Quiet. Omit progress indicators, produce only logging output. Add a q to make even quieter. -s, --simulate, --just-print, --dry-run, --recon, --no-act Go through the motions, but don't actually make any changes to the system. The configuration option is APT::Get::Simulate. -u, --show-upgraded Print a list of all packages to be upgraded. The configuration option is APT::Get::Show-Upgraded. -v, --version Display the version and exit. -y, --yes, --assume-yes Automatically reply "yes" to prompts and run noninteractively. Abort if there is an error. The configuration option is APT::Get::Assume-Yes. dpkg dpkg [options] action A tool for installing, managing, and building packages. Serves as a frontend to dpkg-deb. dpkg actions These actions are carried out by dpkg itself: -i pkgfile, --install pkgfile Install the package specified as pkgfile. With -R or --recursive, pkgfile must be a directory. --unpack pkgfile Unpack the package, but don't configure it. With -R or --recursive, pkgfile must be a directory. --configure [packages|-a|--pending] Reconfigure one or more unpacked packages. If -a or --pending is given instead of packages, configure all packages that are unpacked but not configured. -r, --remove [packages|-a|--pending] --purge [packages|-a|--pending] Remove or purge one or more installed packages. Removal gets rid of everything except the configuration files listed in debian/conffiles; purging also removes the configuration files. If -a or -- pending is given instead of packages, dpkg removes or purges all packages that are unpacked and marked (in /var/lib/dpkg/status) for removing or purging. #BREAK# --print-avail package Print the details about package from /var/lib/dpkg/available. --update-avail pkgs-file --merge-avail pkgs-file Update the record of available files kept in /var/lib/dpkg/available. This information is used by dpkg and dselect to determine what packages are available. Update will replace the information with the contents of the pkgs-file, distributed as Packages. Merge combines the information from Packages with the existing information. -A pkgfile, --record-avail pkgfile Update the record of available files kept in /var/lib/dpkg/available with information from pkgfile. This information is used by dpkg and dselect to determine what packages are available. With -R or -- recursive, pkgfile must be a directory. --forget-old-unavail Forget about uninstalled unavailable packages. --clear-avail Remove existing information about what packages are available. -l, --list [pkg-name-pattern] List all packages whose names match the specified pattern. With no pattern, list all packages in /var/lib/dpkg/available. The pattern can include standard shell wildcard characters and may have to be quoted to prevent the shell from doing filename expansion. -s packages, --status packages Report the status of one or more packages by displaying the entry in the status database /var/lib/dpkg/status. -C, --audit Search for partially installed packages and suggest how to get them working. --get-selections [pattern] Get list of package selections and write to standard output. With pattern specified, write selections that match the pattern. --set-selections Set package selections based on input file read from standard input. --yet-to-unpack Search for uninstalled packages that have been selected for installation. -L packages, --listfiles packages List installed files that came from the specified package or packages. #BREAK# -S filename-pattern, --search filename-pattern Search installed packages for a filename. The pattern can include standard shell wildcard characters and may have to be quoted to prevent the shell from doing filename expansion. --print-architecture Print target architecture. --print-gnu-build-architecture Print the GNU version of the target architecture. --print-installation-architecture Print host architecture for installation. --compare-versions ver1 op ver2 Perform a binary comparison of two version numbers. The operators lt le eq ne ge gt treat a missing version as earlier. The operators lt-nl le-nl ge-nl gt-nl treat a missing version as later (where nl is "not later"). There is a third set of operators (< << <= = >= >> >) that is provided for compatibility with control-file syntax. dpkg returns zero for success (i.e., the condition is satisfied) and nonzero otherwise. –help Print help message and exit. –force-help Print help message about the –force-list options and exit. -Dh, –debug=help Print debugging help message and exit. –license Print dpkg license information and exit. Accepts the spelling –licence in addition to –license. –version Print dpkg version information and exit. dpkg-deb actions The following actions can be specified for dpkg and are passed to dpkg-deb for execution. Also see dpkg-deb. -b dir [archive], –build dir [archive] Build a package. -c archive, –contents archive List the contents of a package. #BREAK# -e, –control archive dir Extract control information from a package. -f archive [control-fields], –field archive [control-fields] Display the control field or fields of a package. -I archive [control-files], –info archive [control-files] Show information about a package. –fsys-tarfile archive Display the filesystem tar- file contained by a package. -x archive dir, –extract archive dir Extract the files from a package. -X archive dir, –vextract archive dir Extract and display the filenames from a package. Options –abort-after=num Abort processing after num errors. Default is 50. -B, –auto-deconfigure When a package is removed, automatically deconfigure any other package that depended on it. -Doctal, –debug=octal Turn on debugging, with the octal value specifying the desired level of debugging information. Use -Dh or –debug=help to display the possible values. You can OR the values to get the desired output. -E, –skip-same-version Don’t install the package if this version is already installed. –force-list, –no-force-list, –refuse-list Force or refuse to force an operation. list is specified as a comma-separated item of options. With –force, a warning is printed, but processing continues. –refuse and –no-force cause processing to stop with an error. The force/refuse options are: architecture Process even if intended for a different architecture. auto-select Select or deselect packages to install or remove them. Forced by default. #BREAK# bad-path Some programs are missing from the path. configure-any Configure any unconfigured package that the package depends on. conflicts Permit installation of conflicting packages. Can result in problems from files being overwritten. depends Turn dependency problems into warnings. depends-version Warn of version problems when checking dependencies, but otherwise ignore. downgrade Install even if a newer version is already installed. Forced by default. hold Process packages even if they are marked to be held. not-root Try to install or remove even when not logged on as root. overwrite Overwrite a file from one package with the same file from another package. Forced by default. overwrite-dir Overwrite one package’s directory with a file from another package. overwrite-diverted Overwrite a diverted file with an undiverted version. remove-essential Remove an essential package. Note that this can cause your system to stop working. remove-reinstreq Remove packages that are broken and are marked to require reinstallation. -G Don’t install a package if a newer version is already installed. The same as –refuse-downgrade. #BREAK# –ignore-depends=pkglist Dependency problems result only in a warning for the packages in pkglist. –largemem Specify that dpkg can use as much memory as it needs. –new New binary package format. This is a dpkg-deb option. –no-act Go through the motions, but don’t actually write any changes. Used for testing. Be sure to specify before the action; otherwise changes might be written. –nocheck Ignore the contents of the control file when building a package. This is a dpkg-deb option. -O, –selected-only Process only packages that are marked as selected for installation. –old Old binary package format. This is a dpkg-deb option. -R, –recursive Recursively handle .deb files found in the directories specified with -A, –install, –unpack, and –avail and their subdirectories. -R, –root=dir, –admindir=dir, –instdir=dir Change default directories. admindir contains administrative files with status and other information about packages; it defaults to /var/lib/dpkg. instdir is the directory in which packages are installed and defaults to /. Changing the root directory to dir automatically changes instdir to dir and admindir to /dir/var/lib/dpkg. –smallmem Specify that dpkg should try to preserve memory. dpkg- deb dpkg-deb action [options] Backend command for building and managing Debian package archives. Also see dpkg; you’ll often want to use dpkg to pass commands through to dpkg-deb, rather than call dpkg-deb directly. Actions -b dir [archive], –build dir [archive] Create an archive from the filesystem tree starting with directory dir. The directory must have a DEBIAN subdirectory containing the control file and any other control information. If archive is specified and is a #BREAK# filename, the package is written to that file; if no archive is specified, the package is written to dir.deb. If the archive already exists, it is replaced. If archive is the name of a directory, the dpkg-deb looks in the control file for the information it needs to generate the package name. (Note that for this reason, you cannot use –no-check with a directory name.) -c archive, –contents archive List the filesystem-tree portion of archive. -e, –control archive dir Extract control information from archive into the directory dir, which is created if it doesn’t exist. -f archive [control-fields], –field archive [control-fields] Extract information about one or more fields in the control file for archive. If no fields are provided, print the entire control file. -h, –help Print help information and exit. -I archive [control-files], –info archive [control-files] Provide information about binary package archive. If no control files are provided, print a summary of the package contents; otherwise, print the control files in the order they were specified. An error message is printed to standard error for any missing components. –fsys-tarfile archive Extract the filesystem tree from archive, and send it to standard output in tar format. Can be used with tar to extract individual files from an archive. –license Print the license information and exit. Accepts the spelling –licence in addition to –license. –version Print the version number and exit. -x archive dir, –extract archive dir -X archive dir, –vextract archive dir Extract the filesystem tree from archive into the specified directory, creating dir if it doesn’t already exist. -x (–extract) works silently, while -X (–vextract) lists the files as it extracts them. Do not use this option to install packages; use dpkg instead. Options -D Turn on debugging. –new Build a new-style archive format (this is the default). #BREAK# –no-check Don’t check the control file before building an archive. This lets you build a broken archive. –old Build an old-style archive format. dpkg- split dpkg-split [action] [options] Split a binary package into smaller pieces and reassemble the pieces, manually or in automatic mode. The automatic mode maintains a queue of parts for reassembling. Useful for transferring to and from floppy disks. Actions -a -o output part, –auto -o ou