You are on page 1of 2

Dpkg

dpkg --compare--
Compare version numbers,
versions v1 gt
check with echo $?.
v2 Debian GNU/Linux Reference Card
Query installed packages, Version 5.0.1 2008-08-01
dpkg-query -W
format e.g. '${Package} http://www.debian.org/
--showformat=f-
${Version}
ormat
${Installed-Size}\n'. Getting Help
dpkg Read online help for every
Write package selections to man page or man
--get-selections command and many
file. bash
> file configuration files.
dpkg command [--help, Brief help for most
Set package selections from
--set-selections -h] commands.
file.
< file Find all documentation
/usr/share/doc/ here, optional file
package-name/ README.Debian contains
The Network specifics.
/etc/network/ Network interface Reference, manuals, FAQs,
interfaces configuration. Web
HOWTOs, etc. at http://w-
Start, stop network documentation
ifup, ifdown ww.debian.org/doc/
interfaces according to files Mailing lists at
[device] The community is always
above. http://lists.de-
Show and manipulate helpful, search for users.
bian.org/
/sbin/ip network interfaces and The Wiki at
routing, needs iproute. Contains all kind of useful
http://wiki.deb-
ssh -X user@host Login at other machine. information.
ian.org/
scp files Copy files to other machine
user@host:path (and vice versa).
Installation
All information about it at
Web Server (Apache2) Installer http://www.debian.org/d-
/etc/apache2/ Configuration files. evel/debian-installer/
Contains virtual hosts. To Download from http://ww-
/etc/apache2/ CD images
enable a virtual host, use w.debian.org/distrib/
sites-available/
a2ensite. E.g. to set up the network
Contains available modules boot: expert w/o DHCP or using LILO
/etc/apache2/
files. To enable a module, instead of GRUB.
mods-available/
use a2enmod.

Bugs
Bug Tracking at
All about existing and fixed
http://bugs.deb-
bugs.
Legal Notice
ian.org/
See http://bugs.debian.-
This document may be used under the terms the GNU org/package-name/, use
General Public License version 3 or higher. Conditions Package specific
wnpp to ask for new
for copying and translations can be found at http://x- packages.
inocat.com/refcard/, where you can always get the reportbug Report a bug by e-mail.
latest version of the reference card. Instructions at
Copyright © 2004, 2008 W. Martin Borgert Reporting http://www.debian.org/B-
Made by: http://xinocat.com/refcard/ ugs/Reporting
Configuration Important Shell Commands APT
All system configuration pager files Show contents of files. apt-cache Show package
/etc/ files are under directory ls [files] List files. showpkg dependencies (needed
/etc/. mkdir package-names packages).
Create directories.
Default text editor. May be directory-names Install packages from
editor files apt-get install
nano, emacs, vi, joe. mv file1 file2 Move, rename files. repositories with all
package-names
CUPS at http://- Browser interface to rm files Remove files. dependencies.
hostname:631 printing system. rmdir dirs Remove empty directories. Install newest versions of all
Reconfigure a package, e.g. Create, eXtract, list Table of apt-get upgrade packages currently
tar [c][x][t][z][j] -f
dpkg-reconfigure console-common archive file, z, j for .gz, installed.
file.tar [files]
package-name (keyboard), locales .bz2. Like apt-get upgrade, but
apt-get
(localisation). find directories Find files like -name name or with advanced conflict
dist-upgrade
update- expressions -size +1000, etc. resolution.
Manage command
alternatives grep apt-get remove Remove packages with all
alternatives.
options search-string Find search-string in files. package-names needed packages.
After changing files apt-get Remove packages that no
update-grub
/boot/grub/menu.lst. Send signal to process (e.g. autoremove other packages depend on.
kill [-9] number
make-kpkg terminate it). apt-cache depends List all packages needed by
Build a kernel packages
--initrd -- Create a symbolic link to a package-names the one given.
from sources, if a ln -s file link
revision=2:my.1.0 file. apt-cache
customised kernel is really List all packages that need
--rootcmd ps [options] Show current processes. rdepends
needed, needs the one given.
fakeroot --uc --us Become another user, e.g. package-names
kernel-package. su - [username]
kernel_image root. Update content listings
Create and install Execute a command as root apt-file update from package repositories,
m-a a-i module third-party modules (gspca, sudo command as normal user, see see apt-get update
kernel_image ...), needs /etc/sudoers apt-file search
Search packages for file.
module-assistant. Overwrite file with output of file-name
command > file
command. apt-file list
List contents of a package.
Append output of command package-name
command >> file
Daemons and System to file. Installs packages
/etc/init.d/file Restart a service, system Use output of command 1 as automatically if needed, can
cmd1 | cmd2 auto-apt
restart daemon. input of command 2. replace apt-file, needs
/etc/init.d/file Stop a service, system Use file as input for auto-apt.
command < file
stop daemon. command. Console interface to APT,
aptitude
/etc/init.d/file Start a service, system needs aptitude.
start daemon. GUI interface to APT, needs
synaptic
halt, reboot, Halts, reboots, shuts down APT synaptic.
poweroff system. Update packages listings
All log files are under this from package repositories
/var/log/
directory. as listed in Dpkg
Default values for many apt-get update /etc/apt/sources.list. dpkg -l [names] List packages.
/etc/default/
daemons and services. Required whenever that file dpkg -I pkg.deb Show package information.
or the contents of the dpkg -c pkg.deb List contents of package file.
repositories change. Show which package a file
dpkg -S filename
Important Shell Commands Search packages and belongs to.
apt-cache search
cat files Print files to screen. descriptions for dpkg -i pkg.deb Install package files.
search-string
cd directory Change to directory. search-string. Audit check sums of
cp files dest Copy files and directories. apt-cache policy Show versions and priorities debsums installed packages, needs
echo string Echo string to screen. package-names of available packages. debsums.
gzip, bzip2 [-d] apt-cache show Show package information dpkg-divert Override a package's
Compress, uncompress files. package-names incl. description. [options] file version of a file.
files

You might also like