home *** CD-ROM | disk | FTP | other *** search
Text File | 2004-12-14 | 70.9 KB | 1,879 lines |
- Debian Tips
- by Rick Moen
- revised 1999-12-09
-
- [Please pardon this document's Intel-centrism. Probably, almost all of
- it will generalise to Debian for Motorola 680x0, DEC Alpha, and Sun
- SPARC, but I cannot guarantee that.]
-
- This document, or a successor, will reside somewhere in
- http://linuxmafia.com/debian/
-
- Basic documentation
- -------------------
-
- Debian Installation Guide ("Installing Debian GNU/Linux") by Adam Di
- Carlo and other authors
- ftp://www.debian.org/debian/dists/stable/main/disks-i386/current/install.html
- 20 pages -- PRINT AND READ THIS BEFORE INSTALLING.
-
- Debian FAQ http://www.debian.org/doc/FAQ/ 75 pages
-
- Debian Users Guide (by Dale Sheetz)
-
- http://www.debian.org/~elphick/ddp/manuals.html#devel is helpful
-
- Debian Packaging Manual,
- http://www.debian.org/~elphick/manuals.html/packaging-manual/
-
- Debian Documentation Project, http://www.debian.org/~elphick/ddp/, which
- is generally a good place to find docs, some of which may not be in a
- finished state.
-
- Installation notes
- ------------------
-
- Most people will elect to install from CD-ROM. If so, configure your
- system to boot from CD-ROM before starting, if it supports that. Doing
- so allows you to dispense with installation boot floppies, a very
- frequent source of problems.
-
- If you need to start the installation process from floppy (i.e., cannot
- boot from CD-ROMs), then you need to generate (write) a floppy from
- image files on Debian CD #1. The installation diskette-image file is
- somewhat confusingly called a "rescue" floppy. (Some machines, such as
- IBM ThinkPads, will need the alternate "tecra" rescue floppy, because of
- drive-addressing peculiarities.)
-
- As is usual with Linux distributions, you can write the floppy from its
- image file using either the provided RAWRITE.EXE DOS utility or a Unix
- machine's "dd" utility. Watch carefully for errors or early
- termination of the write process: More installations fail because of
- subtly defective boot floppies than for any other reason.
-
- Debian 2.1 "Slink" has a fairly old XFree86 (v. 3.3.2.3a). (This software
- group comprises the video graphics engines for various video-card chipsets,
- and you may need to upgrade it to support recent video cards.) Newest are
- available at "http://www.netgod.net/x". You can either retrieve them
- using apt-get, or retrieve them manually and install using "dkpg -i".
-
- ftp://ftp.debian.org/debian/dists/potato/main/binary-i386/x11/
- (i.e., the current beta-version Debian distribution, "potato") also has
- X upgrade packages, _but_ those packages require GNU libc version 2.1,
- which would be essentially going partially to "potato", which you would
- probably consider undesirable.
-
- You should get upgrades for at least the following X-related packages:
-
- xserver-vga16 Generic 640x480x16 plain-VGA support. Good to have
- for testing, etc. Not all current cards have VGA16
- backwards compatibility, but most do.
- xserver-[...] Whichever X server is required for your video card.
- See: http://www.xfree86.org/cardlist.html
- xserver-common
- xfree86-common
- xf86setup
- xbase Only if you're upgrading from Debian 2.0
- xbase-clients
- xlib6 Libraries
- xlib6g
- xprt X printing support
- xfs X Font Server
- xfstt TrueType server
- xfonts-scalable
- xfonts-base
- xfonts-75dpi
- xfonts-100dpi
-
- Debian's installer puts you in cfdisk. If you prefer the traditional
- Linux fdisk, exit cfdisk and switch to a different virtual terminal
- (Ctrl-Alt-F2), then use fdisk there, then switch virtual terminals
- back (Ctrl-Alt-F1). (You should exit cfdisk because it would otherwise
- render fdisk unable to write to the disk device.)
-
- The installer may prompt you for an expansion card's (e.g., an ethernet
- card's) hardware resources, such as I/O base address and IRQ. Try
- _omitting_ that data, which induces a fairly reliable autoprobe process,
- to find the correct values: The installer fails to clarify that it
- will default to autoprobing, which is unfortunate, because that is
- almost always a better choice.
-
- Also, make sure you know the following hardware-configuration details
- before you start: What port your mouse is on (PS/2, ttyS0=COM1,
- ttyS1=COM2, etc.), what video chipset your video card uses, how much
- RAM your video card contains, what chipset your ethernet card (if any)
- is built on, and what device type your CD-ROM is if you'll be installing
- from it (SCSI, hda=primary master IDE device, hdb=primary slave, hdc=
- secondary master, hdd=secondary slave, or whatever else). Ignore video
- details if you're omitting X support (but most users won't be).
-
- Debian's installer needs to be told these things because of a design
- tradeoff: Because it doesn't autoprobe for this data, the installer
- can be stable and usable even on bizarre hardware that tends to confuse
- autoprobe programs. On the minus side, it means the user must know his
- system in more detail than usual.
-
- Because of that aspect and other rough spots in the installation
- noted throughout this piece, I recommend _against_ trying Debian
- as one's first Linux distribution. However, if you've tried (any of)
- SuSE, Red Hat, Turbo Linux, Caldera Open Linux, Slackware, Stampede
- Linux, Mandrake, etc., and generally know your hardware, you're more
- than qualified.
-
- Surviving "dselect": dselect is a software package-selection and
- configuration tool, liked by a few, detested by many, and due to be
- replaced soon. During Debian installation, you will briefly encounter
- it but need not ever use it thereafter, post-installation. (Better
- tools are available, e.g., apt-get, dpkg.)
-
- Suggestion: DO NOT attempt to adjust package selection in any way
- inside dselect, during your initial installation. Doing so can prolong
- your installation time by many hours, as you wrestle with dselect.
- One avoids this pitfall by selecting, on an installer screen just prior
- to entering dselect, a "profile" (a predefined set of packages to install,
- for a machine role such a network server, scientific workstation, etc.).
- You can recognise that installer screen by the following (rather
- confusing) text on it:
-
- Now you may choose one of several selections of packages to
- be installed. If you prefer to select one by one which packages
- to install on the system you may skip this step, else you may
- skip the 'Select' step later when I run the 'dselect' program.
-
- Let's translate that into English:
-
- It's saying you may choose either of two ways to specify packages to
- be installed.
-
- (1) You might elect to pick a "profile". After doing so, you will be
- run through a program called 'dselect' whose main menu consists of
- about six numbered steps. Ignore step number 3, 'Select', since having
- already specified a profile makes that step redundant.
-
- or...
-
- (2) You might prefer _not_ to use a "profile", in order to pick and
- choose individual packages during initial installation. In that case,
- you'll definitely want to perform all of the dselect program's numbered
- steps, including step number 3, 'Select'.
-
- You are strongly advised to go with the first option during initial
- installation: DO NOT attempt to tweak dselect's package selection to
- do a "kitchen sink" installation, or for any other reason. People who
- do that end up dealing with dependency issues in dselect for hours.
- You Have Been Warned.
-
- (Among many faults, dselect's 'Select' step presents you with a
- non-collapsible scrolling list of 2200+ packages. Horrors.)
-
- While you are in dselect, as the program is installing your packages, it
- will scroll past your eyes quite a lot of configuration information,
- sometimes prompting you for setup choices. (Unlike some other
- distributions, Debian has you make those choices during initial package
- installation rather than providing generic values for them.) You are
- strongly advised to take notes on paper and take your time, since some
- of the information displayed is valuable, and to my knowledge is not
- logged. (The latter fact is the single biggest reason I think dselect
- is Evil and Must Die, by the way.)
-
- In particular, don't think of dselect as a general system-administration
- and setup tool (like SuSE's "yast"). It isn't one. Other utilities
- perform those functions:
- -- Use xf86config or XF86Setup (those names are case-sensitive) to
- configure the X Window System after installing needed X packages.
- -- Use Wvdial or ppp-config to configure Internet dial-up networking.
- -- Use apt-get and dpkg to install/remove/configure Debian packages.
- -- Use ipmasq to set up firewalling.
-
- ===> PACKAGE-INSTALLATION OPTION #3 (the most interesting): Instead of
- _either_ picking a package "profile" _or_ picking and choosing packages in
- dselect, you can simply _quit_ the installer (ctrl-C) when shown the profile
- list. You will then have run completely through the first half of Debian
- installation (the "debootstrap" utility) and omitted the "dselect" second half.
- You will have thereby installed just the "Debian base system".
-
- The theory behind doing so is that you can then efficiently add _just_
- the packages you want, resulting in a lean, sparse, _secure_, and
- yet full-featured system. _However_, the Debian base system must be
- supplemented -- and can be as follows, on any network connected to the
- Internet:
-
- 1. Login as user "root". Stay in directory "/root".
- 2. If your machine requires a DHCP-issued dynamic IP address, get and
- add the dhcpcd-[version].deb package. ("dpkg -i dhcpcd-[version].deb")
- 3. Add the "apt" package-management system. (dpkg -i apt-[version].deb")
- 4. Do: script (this logs what follows to text file "typescript")
- apt-get update && apt-get -u dist-upgrade
- (This upgrades all installed packages to latest versions. The
- "-u" adds packages listed as "suggests" companions for those being
- installed .)
- 5. Install the following additional packages omitted from the
- Debian base system, by typing "apt-get install [deb1] [deb2] ...":
- autoconf automake bin86 binutils bison cpp doc-base dpkg-multicd
- file flex g++ gcc gettext gettext-base groff info kbd kbd-data
- less libc5 libc6-dev libg++27 libg++272 libstdc++2.10-dev
- libstdc++2.8 lilo make man-db manpages psmisc sysutils
-
- 6. If your system will support the X Window System, add:
- xbase-clients xlib6 xlib6g xlib6g-dev
-
- 7. Your system is now fairly functional (initially without X setup).
- Browse the package listings in the /var/state/apt/lists/*Packages
- files, and "apt-get install" what you need. You'll only need to do
- a few such "install" commands, to (e.g.) add a full-blown X
- setup, because apt-get retrieves additional packages as needed
- to meet dependencies.
-
- pine/pico:
-
- Debian does not by default install "non-free" packages -- those under
- restrictive software licences (although many are provided and available
- for installation). If you are a user of the "pine" e-mail client or
- the "pico" text editor that pine provides, please be aware that pine
- is non-free and therefore is not a default installation item.
-
- The U. of Washington's licence forbids distribution of pine/pico (v.
- 4.62 or later) in binary form. This restriction is routinely violated
- by many GNU/Linux distributions, but not by Debian. (U. of Washington
- is aware of this licencing problem, but elects not to fix it.) You can
- thus install pine and pico (in Debian) by installing the pine
- source-code package and then compiling the programs.
-
- apt-get build-dep pine
- apt-get source --compile pine
- dpkg -i *.deb
-
- or, equivalently:
-
- apt-get build-dep pine
- apt-get source pine
- dpkg-buildpackage
- dpkg -i *.deb
-
- However, there's a better alternative. Just put the following
- script in /usr/local/bin as "pine", and chmod it to 755 (executable):
-
- #!/bin/sh
- /usr/bin/mutt -F /usr/doc/mutt/examples/Pine.rc
-
- pico can be emulated by a symbolic link to the simple editor "ae", which
- is really very close to pico:
-
- cd /usr/local/bin
- ln -s ../../../bin/ae pico
-
- Qmail (the SMTP e-mail server) is available in the same way as pine/pico,
- as a source-code package (qmail-src) with a canned build script, in the
- Debian non-free packages collection.
-
- Post-installation adjustments:
- ------------------------------
-
- -- Consider manually creating symlinks cdrom, floppy, and mouse in the /dev
- directory.
-
- -- Consider changing the mountpoints for your floppy and CD-ROM devices
- from /floppy and /cdrom to /mnt/floppy and /mnt/cdrom (to make them
- more standards-compliant). Remember that you can always put personal
- symlinks in your home directory as shortcuts to frequently-visited
- directories.
-
- -- Consider cleaning up the format of /etc/fstab in a text editor, and
- adding entries for your CD-ROM and floppy devices, e.g.:
-
- #<filesys> <mount pnt> <type> <options> <dump><pass>
- /dev/sda1 / ext2 defaults,errors=remount-ro 0 1
- /dev/sda2 none swap sw 0 0
- /dev/fd0 /mnt/floppy ext2 noauto 0 0
- /dev/scd0 /mnt/cdrom iso9660 noauto,ro 0 0
- proc /proc proc defaults 0 0
-
- (The "noauto" options for the floppy and CD-ROM ensure that any floppies
- and CDs in those devices will not be automounted at boot time.)
-
- Post-installation addition/removal of software packages.
- -- dpkg: very decent command-line package installer/uninstaller
- -- The wonder that is apt-get:
- -- automatically retrieves additional packages as needed to
- satisfy dependencies
- -- can be used to systematically track either a named Debian
- version (e.g., potato, slink, hamm, bo) or the symlinks
- "stable" and "unstable". Sysadmin can either run apt-get
- manually or as a cron job.
- apt-get is intended, in the long term, to be just a "method"
- (subsidiary app) invoked by apt, the intended replacement
- for dselect. Thus, it is a command-line tool.
-
- Basic update of the already-installed packages:
-
- apt-get update && apt-get -u dist-upgrade
-
- If the dist-upgrade has problems, do "apt-get -f install" (to fix).
-
- To switch to tracking the "unstable" Debian branch:
-
- -- add the following to your /etc/apt/sources.list file:
- deb http://http.us.debian.org/debian unstable main contrib non-free
- deb http://non-us.debian.org/debian-non-US unstable/non-US main contrib non-free
- -- Re-run "apt-get update", to get the new available-package listings.
- -- In order to upgrade crucial packages first, do:
- "apt-get install perl libc6 dpkg apt apt-utils debconf"
- Whenever you're switching to a new development track, or are
- for any reason expecting a major jump in package versions, the
- foregoing command is a worthwhile precaution.
- -- Re-run "apt-get -u dist-upgrade". You are now upgraded to (and
- can track in the future) the "unstable" branch.
-
- You can make apt-get search your CD-ROM first (which is faster than
- getting packages from the Net) by adding something like the following as
- the first non-comment line in /etc/apt/sources.list:
-
- deb file:/mnt/cdrom/debian stable main non-free
-
- After installing packages, run
-
- apt-get clean
- to clear out /var/cache/apt/archives where .deb packages otherwise
- accumulate.
-
- apt-get autoclean
- will clear out only "useless" package files.
-
- Don Marti reports that he runs this, instead, as a nightly cron script:
-
- apt-get update && \
- apt-get -y --download-only dist-upgrade && \
- apt-get autoclean
-
- That updates the available-packages lists, retrieves into /var/lib/dpkg/archive
- but doesn't install any new packages, and removes those no longer
- essential. He later does a manual "apt-get dist-upgrade" to install the
- pre-fetched packages with human supervision.
-
- (Alternative: use aptcron, which is designed to be automated and to
- cooperate with debconf.)
-
-
- apt-get update && apt-get build-upgrade
- will update your system and then recompile all installed software.
- (The "build-upgrade" parameter is supported only by recent CVS betas
- of apt-get, at this date -- but is very slick.)
-
- You can edit your /etc/apt/sources.list file to make apt-get
- use a variety of sources, including various unofficial ".deb"
- archives. A list of the latter is maintained by StΘphane Bortzmeyer at
- http://www.internatif.org/bortzmeyer/debian/apt-sources/.
- (Consider particularly "deb http://security.debian.org/ stable updates".)
-
- (2002-12 update: Mike Markley's http://apt-get.org/ has mostly taken
- over from Bortzmeyer's list.)
-
- Tweak /etc/apt/build-options (?) to set compiler flags, etc.
- (This would be another cutting-edge feature in the betas.)
-
- Tip: Before using apt-get (or dselect, or dpkg) to do anything,
- start the "script" utility to make a session logfile. You are
- strongly advised to do this, since package-installers in Debian
- output meaningful information that may be important for you later.
-
- slink vs. potato
- ----------------
- At any given time, there is a Debian "stable" distribution and
- an "unstable" (development) distribution. At this writing,
- Debian-stable is named "slink" (v. 2.1, based on installation kernel
- 2.0.36), and Debian-unstable is "potato" (no version number yet
- assigned). potato is quite solid and close to release as the next
- "stable" branch, but installation diskette images for it are still being
- tested. Therefore, the only practical way to reach potato is to install
- slink first, and then upgrade.
-
- There is one exception: Debian developer Joey Hess has produced an
- ISO-9660 (CD-ROM filesystem) image of what he calls "slink-and-a-half",
- available at ftp://ftp.valinux.com/pub/support/joey/slink-and-a-half.iso .
- This is an upgraded slink, based on Linux kernel 2.2.12, with the vastly
- expanded hardware support that one gets with more-recent kernels.
- (Therefore, it will install on advanced, recent hardware that slink
- doesn't yet support.) The file is 620 MB, and pretty much the only
- practical thing to do with it is burn it to a CDR or CDRW disk (using a
- CD-burner drive). You can do that on any operating system; for tips on
- doing it on Linux, see http://www.linuxdoc.org/HOWTO/CD-Writing-HOWTO.html .
-
- Be aware that, if you upgrade a slink (or "slink-and-a-half") system to
- potato, you may encounter occasional problems inherent in the Debian
- development process. (In other words, before you complain, realise
- that they called it "unstable" for a reason.) To date, the problems
- have been small and resolved in a day or two. Many of us find these
- risks worthwhile to have access to the lastest software. Your call.
-
-
-
-
-
- DEBIAN 2.2 "POTATO"
- -------------------
-
- Until I properly update this "tips" file for 2.2 Potato, here's
- some update information I e-mailed to a friend in Ireland. I had
- just burned and sent him a set of the three official Debian 2.2
- CD-ROM images, and wanted to help him with his next steps:
-
- 1. Read the installation manual:
- http://www.debian.org/releases/stable/i386/install
-
- 2. Read the release note:
- http://www.debian.org/releases/2.2/i386/release-notes/
-
- 3. If your machine boots from CD-ROM, do so with disk 1. This is the
- "non-US" variant of disk 1, which differs from the "regular" one only
- by inclusion of strong crypto. If not, you'll have to write out
- rescue + root + drivers1 + drivers2 + drivers3 floppies. Pay close
- attention to the floppy-writing screens and listen for writing of bad
- sectors. Floppy quality these days really sucks, and is probably the
- biggest cause of Debian installation failure.
-
- Via either path, you'll enter the debootstrap installer routine,
- which guides you through the rest of the first-half of installation,
- including shelling out to cfdisk for partitioning, and calls the lilo
- map installer to write boot files. You reboot at the end (having now
- completed installation of the "Debian base" set), and go into a one-time
- shell where you set root password, create a regular user account, decide
- whether to enable shadowed passwords and remove PCMCIA support. Then,
- you're put into tasksel, a utility for specifying large-granularity
- groupings of packages to be installed.
-
- If you run tasksel and do not select any tasks, you get packages of
- priority "standard" and higher. If for some reason you want an
- absolutely bare-bones Debian system (essential packages only), then
- break out of the installer completely rather than using tasksel.
-
- You are strongly advised to pick one of those "tasks" (aka "profiles"),
- rather than defaulting to fine-granularity package selection in the next
- routine, the infamous "dselect" program. Specifically, it's generally
- wise to pick a minimal configuration. A typical mistake of those
- coming from Red Hat (et al.) is to attempt to specify the kitchen sink.
- Wrong. Bad. Debian does better if you start with a minimal
- configuration and build up as needed. Trust me on this one.
-
- Even if you've picked a profile, you'll be run through the "dselect"
- program as the penultimate step of installation. If you've selected
- a profile, make a point of _not_ doing step #2, "Select", on the dselect
- program's main menu (because you've already designated a package set
- to be installed).
-
- 0. [A]ccess Choose the access method to use.
- 1. [U]pdate Update list of available packages, if possible.
- 2 [S]elect Request which packages you want on your system.
- 3. [I]nstall Install and upgrade wanted packages.
- 4. [C]onfig Configure any packages that are unconfigured.
- 5. [R]emove Remove unwanted software.
- 6. [Q]uit Quit dselect.
-
- You'll be told how to proceed, but in essence dselect will take the
- list of packages to be installed (however it arose) and, transparently
- to the user, invoke the dpkg command-line tool to actually install them.
- Then, it will (again, transparently to the user) invoke "dpkg
- --configure -a" to put you through the configuration questions for
- all packages that need such.
-
- This is one of numerous reasons to _not_ do an initial kitchen-sink
- installation: dpkg has no logging of screen output, and the output of
- dpkg's "configure" mode includes some important facts that you do _not_
- want to scroll off the screen before you can note and digest them.
-
- Post-installation, you'll have the opportunity to start the "script"
- utility immediately prior to any major package installations, so as to
- capture screen output. You're advised to do so.
-
- After package installation and configuration is complete, dselect will
- terminate and log you out. You're now at the login prompt of a fully
- built (but not updated) Debian 2.2 system.
-
- Before I advise you about how to update the system, a few words about
- Debian's modular architecture for packages:
-
- "dpkg" always handles the low-level local mechanics of installing, removing,
- and configuring packages. It alone touches the package database files
- (which are ASCII) in /var/lib/dpkg. It knows nothing inherently about
- how and where to acquire .deb files from, and gets fed pathspecs by the
- user or by other utilities that call it.
-
- "dselect" is one of several package-acquisition and dependency-checking
- programs that call dpkg for actual installation. A few people like it,
- and a lot more loathe it. It, too, is modular, in the sense that it
- can invoke external utilities as "methods" for acquiring and
- dependency-checking packages before passing their names to dpkg. Among
- the possible "methods" are the utilities apt-get and apt-cdrom, to be
- discussed next.
-
- "apt" (Advanced Package Tool) is supposed to eventually supplant dselect
- entirely. It will be a replacement. comprehensive, full-screen
- package-handling utility. Unfortunately, it's still alphaware and
- entirely too scary, so nobody uses it. Fortunately, _its_ command-line
- "method" utilities, apt-get and apt-cdrom, _are_ finished, and are so
- incredibly good that hardly anyone cares that the front-end isn't
- finished. (I suspect that's the problem "apt" is moving so slowly.)
-
- "apt-get" is a tool for acquiring and managing packages from a variety
- of local _or_ remote "sources" (this term being defined below) of
- various types. Like dselect, it invokes dpkg for actual installation.
- When you tell it to query a remote (or local) package-archive for what
- packages and versions it has available, it caches that information in
- two places: /var/state/apt/lists/*Packages and /var/lib/dpkg/available .
- The former files are one file per package source, sorted alphabetically,
- and the latter are merged into a single file.
-
- One of the really cool things about apt-get is that it resolves
- dependencies automatically -- and will offer to retrieve packages you
- did _not_ specify, if they're required by the ones you did. That is why
- one of the more bearable ways of using dselect is by specifying apt-get
- as its "method".
-
- "apt-cdrom" is a special ability to deal intelligently with removable
- media. When it creates available-package indexes for such media, it
- also catalogues them by CD-ROM disk ID in a /var/state/apt/cdroms.list
- file. It likewise tracks them via custom package-source specifiers
- in /etc/apt/sources.list (discussed below). The command "apt-cdrom add"
- will scan a CD-ROM disk for package-listings and create matching indexes
- or it (which apt-get then knows about). You should do exactly that
- for each of your three Debian CDs.
-
- apt-get alone would not suffice for this task, because it thinks all package
- listings retrieved from the same URI are the same source (i.e., it has
- no ability to deal with removable media). There is also (very recently)
- "apt-zip" for Iomega ZIP cartridges.
-
- There have been several candidate substitutes for the unfinished "apt"
- front-end, such as gnome-apt, Corel and Storm Technologies's proprietary
- front-ends, console-apt, and aptitude (ncurses-based). None have really
- caught on, and most are defunct, but some may be worth trying. (I've
- already mentioned tasksel, which picks meta-packages dubbed "tasks" or
- "profiles". At exit, tasksel invokes apt-get, which invokes dpkg.)
-
- to review, the package-handling architecture goes like this:
-
- gnome-apt ---------
- aptitude | Package selection
- Corel Update |
- Storm Package Manager or
- dselect* |
- console-apt ------- |
- |
- | calls
- v
- apt-get Dependency-resolution,
- | package-retrieval
- |
- | calls
- v
- dpkg Package installation & removal,
- configuration
-
- *dselect _can_ use apt-get as a "method" as indicated here, but by default
- does not, bypassing that layer and calling dpkg directly.
-
- (Alternatively, skip the first category, package selection, and
- just use apt-get et al. directly from the command line. Many of
- us do this by preference.)
-
- apt-get (apt-cdrom, apt-zip)'s behaviour is controlled by the obscure
- apt.conf file that nobody bothers to configure, but more importantly
- by /etc/apt/sources.list, which is where it's told where packages
- are available from. Here's the rather messy one from linuxmafia.com:
-
- # Use for a local mirror - remove the ftp1 http lines for the bits
- # your mirror contains.
- # deb file:/your/mirror/here/debian stable main contrib non-free
- # See sources.list(5) for more information, especial
- # Remember that you can only use http, ftp or file URIs
-
- deb http://security.debian.org/ stable/updates main contrib non-free
- #
- ## ...which is equivalent to:
- #
- #deb http://security.debian.org/dists/stable/updates/contrib/binary-i386/ ./
- #deb http://security.debian.org/dists/stable/updates/main/binary-i386/ ./
- #deb http://security.debian.org/dists/stable/updates/non-free/binary-i386/ ./
-
- # What I used before potato went "stable" and I switched to my local mirror:
- #deb http://http.us.debian.org/debian frozen main contrib non-free
- #
- deb file:///usr/local/ftp/debian stable main contrib non-free
- deb http://non-us.debian.org/debian-non-US stable non-US/main non-US/contrib non-US/non-free
- deb http://forcix.cx/ debian
-
- Notice the "file:" URI. I'm telling linuxmafia.com to use its own
- public ftp directories as a Debian package source -- which is possible
- in its case, because linuxmafia.com happens to be an unofficial full
- Debian mirror site.
-
- Here's a sources.list file that will work well for you.
- (ftp.esat.net is in Ireland, and I found it from the mirror-site
- list at http://www.debian.org. I've tested the following, to ensure that
- it's correct.)
-
- deb ftp://ftp.esat.net/mirrors/ftp.debian.org/debian stable main contrib non-free
- deb ftp://ftp.esat.net/pub/linux/debian-non-US stable non-US/main non-US/contrib non-US/non-free
- deb http://security.debian.org/ stable/updates main contrib non-free
-
- So, try commenting out any existing lines in your sources.list, add the
- above ones, save, and do the magic incantation to refresh the
- available-files lists:
-
- apt-get update
-
- That will refresh /var/state/apt/lists/*Packages and
- /var/lib/dpkg/available, with the current package-descriptions from all
- sources listed in sources.list.
-
- The syntax requirements for sources.list are a bit peculiar. The best
- write-up I've seen, so far, is at
- http://www.everything2.com/index.pl?node=sources.list
-
- Here's a possibly even better one:
- http://www.ibiblio.org/gferg/ldp/giles/repository/repository-2.html
-
- It's a good idea to run "apt-get update" before using apt-get or other
- package-retrieval tools. If you don't, you may get 404 errors, because
- you're trying to get things listed in the local package lists, but no
- longer extant at the remote sources (usually because there's a later
- version there, instead).
-
- The following incantation updates all your installed packages to current
- available versions. You should run it on your machine, _especially_
- because of that third "source" I gave you, which is the
- early-availability security-updates source in the USA:
-
- apt-get -u dist-upgrade
-
- You can use the form "apt-get install [packagename1] [packagename2" to
- install the cited packages plus everything required to meet their
- dependencies. E.g., here's what I get on linuxmafia.com (a server with
- no X packages whatsoever), when I tell apt-get that I want to install
- the gnome-games package:
-
- uncle-enzo:/etc/apt# apt-get install gnome-games
- Reading Package Lists... Done
- Building Dependency Tree... Done
- The following extra packages will be installed:
- esound esound-common gdk-imlib1 gnome-bin gnome-card-games gnome-core
- gnome-games-locale gnome-gataxx gnome-glines gnome-gnibbles gnome-gnobots2
- gnome-gnometris gnome-gnomine gnome-gnotravex gnome-gtali gnome-gturing
- gnome-iagno gnome-libs-data gnome-mahjongg gnome-same-gnome gnome-stones
- gnome-xbill imlib-base libart2 libaudiofile0 libesd0 libgnome32
- libgnomesupport0 libgnomeui32 libgnorba27 libgnorbagtk0 libgtk1.2 libguile6
- liborbit0 libtiff3g libungif3g
- The following NEW packages will be installed:
- esound esound-common gdk-imlib1 gnome-bin gnome-card-games gnome-core
- gnome-games gnome-games-locale gnome-gataxx gnome-glines gnome-gnibbles
- gnome-gnobots2 gnome-gnometris gnome-gnomine gnome-gnotravex gnome-gtali
- gnome-gturing gnome-iagno gnome-libs-data gnome-mahjongg gnome-same-gnome
- gnome-stones gnome-xbill imlib-base libart2 libaudiofile0 libesd0 libgnome32
- libgnomesupport0 libgnomeui32 libgnorba27 libgnorbagtk0 libgtk1.2 libguile6
- liborbit0 libtiff3g libungif3g
- 0 packages upgraded, 37 newly installed, 0 to remove and 0 not upgraded.
- Need to get 0B/7634kB of archives. After unpacking 15.6MB will be used.
- Do you want to continue? [Y/n] n
- Abort.
- uncle-enzo:/etc/apt#
-
- apt-get is _almost_ but not quite good enough to figure out that I
- need all of X, too. The point I'm trying to drive towards is that you
- can take a _very_ minimal Debian system, and build it up to a
- full-featured but compact system using no more than about a dozen or so
- "apt-get install" commands.
-
- The above explanations are a partial updating of my modestly famous
- "Debian Tips" document, at http://linuxmafia.com/debian/tips .
- I still recommend you read the latter carefully, but bear in mind that
- it was current as of Debian 2.1 "slink", and badly needs updating.
-
- [e-mail ends]
-
-
-
-
- The apt-spy and netselect-apt utilities will both find the fastest
- Debian mirror (package-source) and then constructing
- /etc/apt/sources.list entries to match, but apt-spy uses the better
- algorithm of the two. (netselect-apt measures only latency, not
- throughput.) Standard, manual method of picking a Debian mirror:
- apt-setup utility.
-
-
-
-
- potato/2.2 unofficial installation-floppy images with ReiserFS support
- (John H. Robinson, IV):
- http://chao.ucsd.edu/debian/boot-floppies/
-
-
-
-
- Jules Bean's FAQ about the "testing" branch, including heuristics for
- package acceptance:
- http://linuxmafia.com/debian/testingfaq.html
-
-
- A good example /etc/apt/sources.list file for those running the
- "testing" branch is as follows:
-
- deb http://security.debian.org testing/updates main contrib non-free
- deb http://http.us.debian.org/debian/ testing main non-free contrib
- deb http://non-us.debian.org/debian-non-US testing/non-US main contrib non-free
-
- The second and third are standard entries using the main Debian mirrors.
- You may have faster mirrors locally: Use "netselect" to find the
- fastest one.
-
- The first line gives early access to security-update packages from the
- Debian Security Team -- generally a very good idea. There's a drawback:
- Unlike in the "testing" branch proper, the security archive sometimes
- releases one package needing a security update without simultaneously
- updating a package that depends on it. E.g., the security collection
- will update Mozilla to a version that breaks Galeon (which will thus be
- removed) or vice-versa. If this happens, you can inevitably find the
- needed new version for the removed package in
- ftp://ftp.debian.org/debian/pool/ , retrieve it, and install it manually
- ("dpkg -i foo", where package foo's new version hasn't yet cleared from
- unstable into testing). Mozilla/Galeon is the only problem case I've
- seen, but there may be others.
-
-
- Debian Quick Reference (about 50 pp.) -- excellent general introduction:
- http://qref.sourceforge.net/quick/
-
-
- Main Debian FAQ is here:
- http://www.debian.org/doc/FAQ/
-
-
- Upgrading from Corel Linux OS to Debian:
-
- The discontinued, Debian 2.1/Slink-based Corel Linux OS (CLOS) distribution
- included some carelessly incompatible Qt-based packages, including but
- not limited to their variant form of KDE 1.1. CLOS can be upgraded to
- current Debian via apt-get, but only after removing the Corel-written
- packages.
-
- # dpkg -l | grep corel
-
- Using the package names thus listed, as the root user, remove them using
- apt-get:
-
- # apt-get remove pkg1 pkg2...
-
- Edit /etc/apt/sources.list to comment out (using "#") the Corel package
- sources, and add standard Debian sources, such as (using the "stable"
- development branch):
-
- deb http://security.debian.org stable/updates main contrib non-free
- deb http://http.us.debian.org/debian/ stable main non-free contrib
- deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free
-
- Get lists of available packages:
-
- # apt-get update
-
- Upgrade crucial packages first:
-
- # apt-get install perl libc6 dpkg apt apt-utils debconf
-
- Now, upgrade the rest of the system:
-
- # apt-get dist-upgrade
-
- I would also recommend, for all but the most mission-critical
- server-role machines, going further and upgrading from Debian-stable
- to Debian-testing: Re-edit the sources.list lines to substitute
- "testing" for "stable" on all three lines. Then, repeat all the
- steps listed following those lines, to upgrade from stable to testing.
-
- When done with the upgrades, you can install genuine, current KDE
- packages by either installing the big "kde" metapackage:
-
- # apt-get install kde
-
- ...or installing individual KDE packages the same way, by name.
-
-
-
-
-
- MIXING DEBIAN RELEASES
- ----------------------
-
- Customising /etc/apt/preferences can let you (among other things)
- specify which packages are to be drawn from a specify development branch
- using the new (2002-04) concept of "pinning" packages, e.g. getting the
- "unstable" branch's version of Mozilla when you're otherwise on the
- "testing" branch. See "man 5 apt_preferences". If you have a recent
- version of apt, and you put the following lines into
- /etc/apt/preferences, it will get unstable packages when there is no
- testing version.
-
- --- begin cut here ---
- Package: *
- Pin: release a=unstable
- Pin-Priority: 50
- --- end cut here ---
-
- You'll need a line in /etc/apt/sources.list for "unstable", of course:
- deb http://http.us.debian.org/debian unstable main contrib non-free
-
- Pinning the priority of unstable to 50 makes it so that these packages
- are never automatically selected for upgrade. However, when you do
- specify packages from that source, dependencies are handled correctly.
-
-
-
- Robert McQueen <robot101@debian.org> comments:
-
- Along with the more powerful (and complicated) release-pinning method
- featured in a previous release of DWN, apt in woody and sid also
- supports a simpler method of achieving the same thing, with the poorly
- documented "APT::Default-Release" configuration option. To do this, add
- a line such as:
-
- APT::Default-Release "testing";
-
- to /etc/apt/apt.conf, and add both testing and unstable lines to
- /etc/apt/sources.list. Then when you upgrade, dist-upgrade, or install,
- apt will only consider packages from testing by default. If you then use
- a command like:
-
- apt-get install <package>/unstable
-
- it will install the package version found in unstable, as well as any
- libraries and other dependencies from unstable that are required to
- install it.
-
-
-
- Jens Hoffrichter <joho@hausboot.org> adds:
-
- This can be done even more comfortably by using apt-get's -t switch,
- which will even satisfy dependencies to unstable, which using
- packagename/unstable does not do.
-
- The correct (and frequently used by myself ;)) ) syntax would be:
-
- apt-get -t unstable install <package>
-
- Alternatively, an explicit version can be located and installed using
- "=" syntax:
-
- apt-get install sox=12.17.4-4
-
-
-
- Tutorial about "pinning":
- http://jaqque.sbih.org/kplug/apt-pinning.html
-
-
-
- Christoph Martin <martin@uni-mainz.de> adds:
-
- apt-show-versions is a script which eases maintenance of mixed
- stable/testing or testing/unstable systems. While beeing able to
- update the packages from your *main* distribution with apt-get upgrade
- it is quite difficult to do the same for the *not-main*
- packages. While you can use the pinning feature of apt if these are
- only a few it is quite annoying to put all the package names in
- apt/preferences which should be pinned. Like in one of my installation
- where I have 247 packages from stable and 229 from testing.
-
- Try
-
- apt-show-versions | fgrep /testing | wc
-
- to see how many packages you have from testing or
-
- apt-show-versions -u
-
- to see a list of packages which are upgradeable either to stable or
- testing or unstable or
-
- apt-get install `apt-show-versions -u -b | fgrep unstable`
-
- to upgrade all unstable packages to their newest versions.
-
-
-
-
- Especially on systems that have packages from multiple development
- branches, the apt-show-versions tool may be useful: It shows which
- versions of a package are available from each known package source, and
- optionally which versions are installed.
-
-
-
-
- Peter Jay Salzman points out an elegant way to determine when a package
- on one's system was last upgraded:
-
- Every package upgrade needs to update the changelog file. simply look
- at the modification date for /usr/share/doc/<pkg>/changelog.Debian.gz.
-
-
-
-
- Note that although Debian's apt-get mechanism makes it easy and reliable
- to upgrade to a later branch (stable to testing, testing to unstable,
- slink to woody, woody to sarge), downgrading can also be done with some
- greater degree of difficulty, as described here:
- http://www.debianplanet.org/node.php?id=880
-
-
-
-
- RECOVERING FROM LOST FILESYSTEMS:
- ---------------------------------
-
- 1. I lost /var !
-
- Because any installed Debian package must create a subdirectory under
- /usr/share/doc, this suggests a handy way to accurately rebuild the
- /var/lib/dpkg/status installed-packages database. Note that this method
- re-fetches and reinstalls all packages: I know of no way to avoid that
- drawback:
-
- #!/bin/sh
- # Recovering a Debian system without any backup of /var/lib/dpkg.
- # ref: http://www.linuxworld.com/2003/0113.petreley.html
-
- # ----------------------------------------------------------------------
- # (C) 2003, Karsten M. Self kmself@ix.netcom.com
- # (C) 2003, Osamu Aoki osamu@debian.org (fixup)
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- # USA
- # ----------------------------------------------------------------------
- # Changes:
- #
- # KMself: Sun Dec 7 15:40:44 PST 2003
- # Removed bashisms (again).
- # Added /var//cache/apt/archives/partial
- # ----------------------------------------------------------------------
-
- export PATH=/usr/sbin:/usr/bin:/sbin:/bin
-
- # Let's be verbose....
- set -v
-
- # Test existence of any subdirs in /var. If they exist, exit, otherwise
- # risk destroying an active system. If they don't exist, the remainder
- # of this script is safe.
-
- function create_new_dir () {
- if [ ! -f $1 && ! -d $1 ]
- then mkdir $1
- else
- echo "$1 exists, aborting" 1>&2
- exit 1
- fi
- }
-
- for d in \
- /var/log
- /var/cache/debconf \
- /var/cache/apt/archives \
- /var/cache/apt/archives/partial \
- /var/lib/dpkg/info \
- /var/lib/dpkg/parts \
- /var/lib/dpkg/alternatives \
- /var/lib/dpkg/methods \
- /var/lib/dpkg/updates
- do
- create_new_dir $d
- done
-
- # Create a rudimentary status file
- cat <<-EOF > /var/lib/dpkg/status
- Package: libc6
- Status: install ok installed
- Version: 2.3.1-9
- EOF
-
- # Update package cache
- apt-get update
- apt-get dist-upgrade
-
- # Register as installed crucial packages.
- dpkg --clear-avail
- apt-get update
- apt-get dist-upgrade
- cd /var/cache/apt/archives
- dpkg -i libncurses*
- dpkg -i perl-base*
- dpkg -i libstdc++*
- dpkg -i dselect*
- dpkg -i dpkg*
-
- # Reinstall libc to register it.
- apt-get install --reinstall libc6
-
- # Reinstall base packages.
- apt-get dist-upgrade
-
- # Generate list of installed packages to re-register previously
- # installed packages as installed, using /usr/share/doc as a fallback
- # package registry. ref: dpkg -l $( ls /usr/share/doc | grep -v [A-Z] )
- # >/dev/null
-
- ls /usr/share/doc |
- grep -v [A-Z] |
- grep -v '^texmf$' |
- grep -v '^debian$' |
- awk '{print $1 " install"}' |
- dpkg --set-selections
-
- # Re-register everything.
- apt-get dist-upgrade
-
- # At this point, you should be (mostly) cooking on gas.
-
- # EOF
-
-
- 2. I lost /usr !
-
- While likewise painful, this situation is easier to cure: Working from
- maintenance boot media or single-user mode, make a safety copy of
- /var/lib/dpkg/status and other crucial files/trees (e.g., /etc), then
- leverage the existence of an accurate /var/lib/dpkg/status database to
- generate a one-per-line list of packages to install, parse those lines
- to isolate just the package names, and then feed those names to "apt-get
- --reinstall install":
-
- COLUMNS=300 dpkg -l | awk '/^i/ {print $2}' | xargs apt-get --reinstall install
-
- The "COLUMNS=300" environment-modification is to compensate for long
- package names, and accomodates names up to 70 characters. E.g., if you
- ever just want a list of installed packages without truncation, do:
-
- COLUMNS=150 dpkg -l 'kernel-*' | awk '$1 ~ /ii/ { print $0 }'
-
-
-
-
- WOODY/3.0 INSTALLATION OPTIONS:
- -------------------------------
-
- Current woody/3.0 floppy-images for i386 using 2.4 kernel (includes ext3):
- http://ftp.us.debian.org/debian/dists/woody/main/disks-i386/current/images-1.44/bf2.4/
-
- woody/3.0 unofficial "netinst" images (about 30 MB):
- http://people.debian.org/~ieure/netinst/
-
- netinst includes an "alternate boot image" named bf2.4 to use a 2.4
- kernel (and ext3 support), but your motherboard must support the El
- Torito "Alternate Boot Image" spec for this to work. If the netinst CD
- boots directly to the syslinux screen, without showing a menu of
- boot-image choices, then your motherboard lacks this support. The
- woody/3.0 netinst ISO images provide installation kernels, drivers,
- partitioning utilities, and the debootstrap program, which must be able
- to retrieve the Debian Base and subsequent packages from the network.
-
-
- woody/3.0 unofficial full CD images
-
- o i386 (8 discs):
- http://www.debian.org/CD/http-ftp/#testing (list of mirror sites)
- ftp://ftp.fsn.hu/pub/CDROM-Images/debian-unofficial/woody/
-
- o other architectures (7 discs):
- http://cdimage-unofficial.debian.net/ (information pages)
-
- woody/3.0 unofficial rescue & installation CD i386 images with 2.4.17
- kernel and ReiserFS (Timo Benk):
- http://rescuecd.sourceforge.net/
-
- Experimental Debian-Installer images for unstable branch, i386 and PowerPC:
- http://ftp.egr.msu.edu/debian/dists/unstable/main/
-
- woody/3.0 install floppy images with 2.4.x kernels, and support for XFS
- and ReiserFS filesystems, software RAID, and LVM (Ionut Georgescu):
- http://www.physik.tu-cottbus.de/~george/
-
- woody/3.0 install floppy and netinst-CD images with 2.4.x kernels and
- support for XFS and JFS filesystems (Angelo Ovidi):
- http://xfdeb.sourceforge.net/
-
- woody/3.0 install floppy images with 2.4.x kernels and support for XFS
- filesystems, software RAID, and LVM (Eduard Bloch):
- http://people.debian.org/~blade/XFS-Install/
-
- (After installing onto XFS, you may be best advised to replace your XFS
- driver and support code from CVS checkout, according to this article:
- http://www-106.ibm.com/developerworks/linux/library/l-fs10.html)
-
-
- Utilities to manage IBM's JFS filesystem are available in woody/3.0 or
- sid/unstable, as package "jfsutils". Documentation on JFS is available here:
- http://oss.software.ibm.com/jfs/
-
- This technique that I used for migrating a system to XFS before there
- were such things as XFS-supporting Debian installation floppies could be
- used as a general guide with any target filesystem type, in a pinch:
- http://linuxmafia.com/~rick/linux-info/xfs-conversion
-
-
- Progeny Graphical Installer can be used to do graphical (X11) or console
- installs of woody/3.0 (on i386 and ia64) : http://hackers.progeny.com/pgi/
- Woody/3.0 i386 installation ISO based on PGI is here:
- http://archive.progeny.com/progeny/pgi/
-
- To clarify, PGI can be used, among other things, to construct
- installable woody/3.0 CD images whose installer program is PGI.
- Progeny 1.0 itself used PGI, and is a perfectly fine way to install
- Debian woody/3.0 for i386:
- ftp://ftp.progeny.com/progeny/debian/iso/Progeny1.0/
- (But don't forget to re-point /etc/apt/sources.list at Debian proper,
- since the Progeny Debian-variant distribution is dormant.)
-
-
- Installing Debian from within a chroot jail on an already-running Linux
- system: http://kmself.home.netcom.com/Linux/FAQs/DebianChrootInstall.html
-
-
- Notes on Debian installation for PPC:
- http://fungus.ucdavis.edu/~dylan/
-
-
- FAI (Fully Automated Install) is a tool for stamping out Debian
- machines, e.g., for a cluster:
- http://www.informatik.uni-koeln.de/fai/
-
- The Autoinstall tool creates floppy images that can install Debian
- systems without any user interaction:
- http://packages.debian.org/unstable/admin/autoinstall-i386.html
-
-
-
- The first time you install a 2.4.x kernel on a Debian system that has
- never had one before, you'll see the following sort of caution:
-
- You are attempting to install an initrd kernel image (version 2.4.19-686)
- This will not work unless you have configured your boot loader to use
- initrd. (An initrd image is a kernel image that expects to use an
- INITial Ram Disk to mount a minimal root file system into RAM and use
- that for booting).
- As a reminder, in order to configure lilo, you need to
- add an 'initrd=/initrd.img' to the image=/vmlinuz
- stanza of your /etc/lilo.conf
- I repeat, You need to configure your boot loader. If you have already done
- so, and you wish to get rid of this message, please put
- `do_initrd = Yes'
- in /etc/kernel-img.conf. Note that this is optional, but if you do not,
- you'll continue to see this message whenever you install a kernel
- image using initrd.
- Do you want to stop now? [Y/n]
-
- What this means is that key hardware drivers are in an initial RAMdisk
- that lilo must be made aware that it must provide to the booting kernel,
- otherwise booting will not succeed. You can do this _before_ installing
- such a kernel, if you like. E.g., modify the "vmlinuz" stanza near the
- bottom of /etc/lilo.conf from:
-
- image=/boot/vmlinuz
- label=linux
- read-only
-
- to
-
- image=/boot/vmlinuz
- label=linux
- initrd=/initrd.img
- read-only
-
- After installing the kernel, if you want to ensure that everything is
- OK, then do "/sbin/lilo -v" as the root user, before rebooting. If
- there are no complaints about inability to find files referenced in
- lilo.conf, you should be safe to reboot.
-
-
-
- # apt-cache search <search term>
-
- lists you all available packages that fit somehow the search term
- (search term can be the program name, parts of that name, a description ...)
-
- If you want more info on a package:
-
- # apt-cache show <package name>
-
- (auto-apt and apt-file are also useful for finding what package provides
- a given file.)
-
- after that, you only need to install the usual way:
-
- # apt-get install <package name>
-
-
-
- dpkg-reconfigure packagename will re-do the package's configuration
- step.
-
-
-
- To put a package on hold (without having to use dselect):
- # echo "packagename hold" | dpkg --set-selections
-
-
- Want to try your hand at making .deb archives from plain source
- tarballs? Install the debhelper package. It has tools to guide you
- through the process.
-
-
-
- The deborphan utility returns a list of libs on your system that are no
- longer being used by any packages. The debfoster utility is a somewhat
- more systematic and comprehensive utility, that identifies and removes
- packages no longer needed.
-
-
-
- Need to reconfigure your system? Run "base-config". This re-runs the
- latter part of the installer program.
-
-
-
- CPAN access in Debian: Use the dh-make-perl utility:
- Go to CPAN and figure out what you want. Then, as root, do:
- # "dh-make-perl --cpan <Module> --build --install"
-
-
-
- Writing out your current installed packages:
-
- # dpkg --get-selections >selections.txt
-
- And get their current versions:
-
- # COLUMNS=150 dpkg -l > packages.txt
-
- To reconstruct the system, install the Debian Base System, then:
-
- # dpkg --set-selections <selections.txt
- # apt-get -u dist-upgrade
-
- Relevant to that, quoting from a Slashdot post:
-
- > Then I figured out the painless way to install debian: go through the
- > installation and install the bare minimum that you absolutely need (this
- > means no X!). Then once you've got that running, which is quick and
- > easy, use apt for everything else you use. This has the side benefit
- > that there's no wasted space on your drive.
-
- Yes! That is the way to do it. dselect is not required for anything.
- Bypass it (in favor of apt) and your life will be much easier. If you're
- a current Debian user, it's even better: just run "dpkg --get-selections
- | awk '{ print $1 }' >package.list" to save your current list of
- packages. Then on the new system, "apt-get install $(cat package.list)"
- to have [most] of your previous software installed automatically. (There
- will be some hangups. Use the "--no-act" option and edit your package
- list accordingly. This is no big deal.)
-
-
-
-
- Or just:
- dpkg -get-selections > file; then later
- dpkg --set-selections < file && apt-get dselect-upgrade
-
-
-
- If you're going to build software from source code, make sure you
- install the "build-essential" package.
-
- Then:
-
- # apt-get build-dep package
-
- ...will ensure that you've satisfied the package's build dependencies.
-
- # apt-get source package
-
- ...retrieve the package's source tree, and unpacks it into the current
- directory.
-
- cd into the tree, and make any desired source changes. The ./debian
- directory contains package metadata / build instructions. While in the
- source tree, executing
-
- # dpkg-buildpackage
-
- ...compiles the package, and places a .deb file in the parent directory,
- which you can then install with dkpg -i (using fake root or logged in
- as the root user).
-
- E.g.,
-
- # dpkg-buildpackage -us -uc
- ("-us" means unsigned source. "-uc" means unsigned changes.)
-
- (Alternatively, cd into the source directory, and do "debian/rules
- binary" using fakeroot or logged in as the root user.)
-
-
- The apt-build utility can help this process:
-
- Description: Frontend to apt to build, optimize and install packages
- This is an apt-get front-end for compiling software optimized
- for your architecture by creating a local repository with built packages.
- It can manage system upgrade too.
-
-
- The pentium-builder package will let you set system-wide options so that
- all compiles from source will be optimised for your CPU architecture.
- (Despite the name, it can optimise for Athlon, etc.)
-
-
- The apt-src package is a much cleaner, newer, and more comprehensive
- alternative to dpkg-buildpackage, "for downloading, installing,
- upgrading, and tracking Debian source packages". The manpage gives
- some good examples of usage:
-
- To install the source to pine to /usr/src, build it, and install the
- resulting debs:
-
- apt-src install --location=/usr/src -i pine
-
- To track changes to said installed pine source package, and install
- debs whenever a new version comes out:
-
- apt-src install -i pine
-
- To install a local copy of package foo, which you are going to apply a
- local patch to:
-
- apt-src install foo
- cd foo-version
- patch <~/my-foo-patch
- apt-src build --installdebs foo
-
- To upgrade your local copy of foo, bringing your patch forward, and
- building and installing new debs:
-
- apt-src install -i foo
-
- To import the source tree in /usr/src/linux, which you unpacked from a
- ftp.kernel.org tarball (or from the kernel-source package) into
- apt-src, so it knows about it:
-
- apt-src import kernel --location=/usr/src/linux --version=2.4.18
-
- [...]
-
- Quoting author Joey Hess:
-
- "'apt-src install' source gives you a source-version tree in the [current
- directory]. Modify to suit, and 'apt-src build' source. If a new version
- comes along, 'apt-src upgrade' source to upgrade the tree, patching your
- local changes forward. Pass in --installdebs to any of these commands
- to make it build and install a .deb."
-
-
-
- An example of building from source using OpenLDAP (using debuild instead
- of dpkg-buildpackage, and pointing out that you can make local changes
- to the Debianised source package immediately prior to building the
- binary package):
-
- # apt-get source slapd
- ...
- # cd openldap2-2.1.23
- ...modify debian/rules, debian/changlog, source code...
- # debuild -uc -us -rfakeroot
- # dpkg --install ../slapd_2.1.23-blah.deb
-
-
-
-
-
- To compile kernels and auto-generate .deb packages, install and use the
- kernel-package package (which provides the make-kpkg utility).
-
- $ cd /directory/where/you/unpacked/a/kernel/tarball
- $ make config | make menuconfig | make xconfig | make oldconfig
- $ make-kpkg clean
- $ make-kpkg --initrd --revision=custom.1.0 kernel_image
- # (as root, or using fakeroot) dpkg -i ../kernel-image-X.XXX_1.0_.deb
-
- Kirk Strauser has a more-detailed explanation here:
- http://subwiki.honeypot.net/cgi-bin/view/Main/DebianKernelBuilding
-
-
-
- Details of how to keep /usr mounted read-only and still let apt work
- correctly without manual intervention:
- http://lists.debian.org/debian-devel/2001/debian-devel-200111/msg00212.html
-
-
-
-
- Debian-NetBSD is a port of the Debian architecture to the NetBSD kernel:
- http://www.debian.org/ports/netbsd/
- http://debian-bsd.sourceforge.net/
-
-
- Debian tools for OpenBSD:
- http://lists.debian.org/debian-devel/2002/debian-devel-200204/msg01114.html
- http://non-us.debian.org/~andreas/obsd/
-
-
- Debian GNU/FreeBSD:
- http://lists.debian.org/debian-bsd/2002/debian-bsd-200204/msg00021.html
-
-
- # KDE v. 3.1 .deb packages for i386 will probably gradually appear in
- # official package maintainer's (Chris "calc" Cheney's) pre-release collection.
- deb http://people.debian.org/~ccheney/kde-3.1.1-1/ ./
-
-
- "WhizNDR"(of the #debian-kde IRC channel on irc.openprojects.net) at
- Genius Systems offers what appears to be an almost complete (no KOffice)
- KDE3 set for i386 and PPC, here:
- http://kde3.geniussystems.net/
- Instructions are here:
- http://calc.cx/kde.txt
- Lists of unofficial apt sources:
- http://mypage.bluewin.ch/kde3-debian/
- http://www.doc.ic.ac.uk/~pc99/debian/kde3.html
-
- KOffice 3.x and a number of other KDE3 apps are available in unofficial
- packages (Ben Burton's) for i386 only, here:
- http://people.debian.org/~bab/kde3/
-
- Daniel Stone will eventually offer his here:
- ftp://ftp.cs.umn.edu/pub/debian-misc/daniels/
-
- KDE 3.1 packages from the KDE Project for i386 and PPC are here:
- deb http://download.us.kde.org/pub/kde/stable/latest/Debian/ stable main
-
- KDE 3.1 packages compiled with the old gcc 2.95 (the "Karolina" rendition), i386
- deb http://wh9.tu-dresden.de/kde3/karolina ./
-
- KDE 3.1 packages compiled with the old gcc 2.95 (the "Karolina" rendition), PPC
- deb http://bulmalug.net/~gallir/debian/kde31-powerpc/ ./
-
- KDE 3.1 RC5 for i386:
- deb http://shakti.ath.cx/debian/kde3.1 ./
-
- KDE 3.1 for i386, PPC:
- deb http://ktown.kde.org/~nolden/kde stable main
-
-
-
- XFree86 4.2.x preliminary .deb packages are available here (Branden Robinson
- and others):
- http://people.debian.org/~branden/
- http://people.debian.org/~branden/sid/
- http://people.brainfood.com/~doogie/x4.2/mirror
- deb http://people.debian.org/~blade/woody/i386/ ./
-
- XFree 4.2 packages for PPC and i386 with DRI support:
- deb http://people.debian.org/~daenzer/dri-trunk/ ./
- deb http://people.debian.org/~daenzer/dri-mach64/ ./
-
- XFree86 4.2.1:
- deb http://people.fsn.hu/~pasztor/debian woody xfree
- deb http://people.debian.org/~frankie/debian woody/x421/
-
- XFree86 4.2.99.3 packages for i386:
- deb http://people.debian.org/~acid unstable xfree86
-
- XFree86 4.3 for i386, PPC:
- deb http://xf86-debs.mirror.positive-internet.com/current/sid/$(ARCH) ./
-
- XFree86 4.3 for i386:
- deb http://people.debian.org/~mmagallo/packages/xfree86/i386/ ./
- (Maintainer Daniel Stone pleads with people to not use these packages
- republished by Marcelo Magallon, and use the Experimental branch
- packages instead, if they need early access to 4.3.)
-
- XFree86 4.3.0-0pre1v4 ("experimental" branch) for all architectures:
- deb http://http.us.debian.org/debian/project/experimental main
- ...and this in /etc/apt/preferences:
- Package: *
- Pin: release a=experimental
- Priority: 1001
- (Warning: This may pull in other packages from the "experimental"
- branch, which might have adverse consequences.)
-
- Sane, XSane scanner packages for i386 and hppa:
- deb http://people.debian.org/~aurel32/SANE stable main
-
-
-
- OpenOffice.org .deb packages (unofficial) are here:
- http://www.linux-debian.de/openoffice/
- Use one of these /etc/apt/sources.list lines:
- deb ftp://ftp.vpn-junkies.de/openoffice unstable main contrib
- deb http://www.mx1.ru/~chris/openoffice unstable main contrib
- deb http://apt-proxy.sourceforge.net/openoffice unstable main contrib
- Matching source packages are here:
- deb-src ftp://ftp.vpn-junkies.de/openoffice unstable main contrib
- deb-src http://www.mx1.ru/~chris/openoffice unstable main contrib
- deb-src http://apt-proxy.sourceforge.net/openoffice unstable main contrib
- The package name is "openoffice.org", not "openoffice".
- Note also that the package maintainer reorganises the directory tree
- occasionally, and sometimes omits the Packages[.gz] file that makes
- a directory apt-gettable. (But you can still retrieve the directory's
- .deb files manually and "dpkg -i" install them.) You'll need an
- openoffice.org .deb file and a compatible libstlport4.5 .deb file.
- Mini-HOWTO is here:
- http://lists.debian.org/debian-openoffice/2001/debian-openoffice-200110/msg00014.html
- General instructions are here:
- http://www.linux-debian.de/openoffice/install_build_howto.html
-
- OpenOffice.org, WineX-light, WINE, fonts, Windows CODECs, Window Maker
- themes, Nvidia drivers/kernels, BitTorrent, ffmpeg, nuppel video tools,
- lmsensors, nvrec, xv, YEPP:
- deb http://www.esat.kuleuven.ac.be/~mleeman/debian unstable/
-
-
- PureFTPd for i386:
- deb http://pureftpd.sourceforge.net/debian/woody/ ./
-
- pine, pico, pilot, & pine-tech-notes for i386:
- deb http://src.braincells.com/debian sid/
-
- pine, pico, pilot, & pine-tech-notes, flashplayer-mozilla,
- flashplugin-nonfree, openoffice.org for i386:
- deb http://kambing.vlsm.org/DLL/debian-local/dists/stable/lokal/binary-i386/
-
- Opera Web browser:
- deb http://deb.opera.com/opera stable non-free
- deb http://deb.opera.com/opera testing non-free
- deb http://deb.opera.com/opera unstable non-free
- deb http://deb.opera.com/opera-beta stable non-free
- deb http://deb.opera.com/opera-beta testing non-free
- deb http://deb.opera.com/opera-beta unstable non-free
-
- pine, pico, pilot, & pine-tech-notes
- deb http://src.braincells.com/debian woody/
-
-
- SpamAssassin for i386:
- deb http://people.debian.org/~duncf/debian/ unstable main
-
-
-
-
- Early-release Mozilla and Nautilus packages are sometimes offered by the
- package-maintainer ("Kitame") here: http://people.debian.org/~kitame/mozilla/
-
-
- Mozilla 1.1 "Phoenix" lightweight browser unofficial packages are here:
- deb http://lesbos.esat.kuleuven.ac.be/~mleeman/debian unstable/
- or
- deb http://people.debian.org/~otavio woody mozilla
- or
- deb http://people.debian.org/~eric/debian/i386 ./
-
- Mozilla 1.1 and Galeon backport:
- deb http://people.fsn.hu/~pasztor/debian woody mozilla
-
- Mozilla 1.2.1 for i386:
- deb http://people.debian.org/~frankie/debian/woody/kalem/ ./
-
- Mozilla 1.3 backport to woody
- deb http://debian.relativ.org/ ./
-
-
-
-
- If you get "Dynamic MMap ran out of room", add this to
- /etc/apt/apt.conf: "APT::Cache-Limit 10000000;"
-
-
-
- Mplayer and libaviplay-codecs unofficial packages here:
- http://mplayer.nmeos.net/
- http://www.mplayer.fr.st/
- http://marillat.free.fr
- deb http://marillat.free.fr/ unstable main
-
- Xine and vlc-css unofficial packages for 3.0/woody i386 (and source) are here:
- http://www.samfundet.no/~tfheen/debian/dists/woody/css/
-
- divx4linux, gpg-idea, lame, transcode, xv, win32-codecs, gpsdrive
- deb ftp://ftp.mowgli.ch/pub/debian sid unofficial
- deb ftp://ftp.mowgli.ch/pub/debian sarge unofficial
-
- Macromedia Flash Player 6 for x86 Linux (includes support for
- Flash-format Sorenson video):
- http://sluglug.ucsc.edu/macromedia/site_ucsc.html
- http://ruslug.rutgers.edu/macromedia/site_ru.html
- http://macromedia.mplug.org/site_uh.html
-
- flashplayer-mozilla, acroread-plugin, acroread, xmms plugins, avidemux,
- etc. for i386, sparc, hppa:
- deb http://jeroen.coekaerts.be/debian/ unstable main contrib non-free
-
-
- Filmgimp for i386:
- deb http://www.cse.unsw.edu.au/~alau/debian/ ./
-
- Cinelarra (formerly broadcast2000) for i386, PPC:
- deb http://userpages.umbc.edu/~fu1/debian unstable main
-
- openh323 tools, Sylpheed-claws, ohphone, openmcu for i386:
- deb http://tranq.dorms.spbu.ru/debian-local ./
-
-
-
- Jamie Strandboge's unofficial GNOME2.2 backport to i386 are here:
- deb http://ftp.acc.umu.se/mirror/mirrors.evilgeniuses.org.uk/debian/backports/woody/gnome2.2/ ./
- deb http://mirror.raw.no/gnome2.2/ ./
-
- Instructions for building GNOME 2.2 on Debian:
- http://www.linuxcompatible.org/story.php?id=17145
-
- Gustavo Noronha Silva's unofficial GNOME2 packages for i386 are here:
- deb http://gluck.debian.org/~kov/debian woody gnome2
- (Above is not apt-gettable for lack of a Packages[.gz] file, 2003-01-04.)
- deb http://people.debian.org/~kov/debian woody gnome2
-
- Ross Burton's way of installing GNOME2:
- http://myweb.tiscali.co.uk/burtonini/computing/gnome2-build.html
-
- GNOME2 sylpheed, pan, gthumb, gftp package for i386:
- deb http://www.tu-harburg.de/~vkv/debian ./
-
-
-
- WINE for i386:
- deb http://people.debian.org/~andreas/debian wine main
-
-
- # Blackdown Java J2r1.3
- deb ftp://ftp.tux.org/pub/java/debian testing non-free
- deb ftp://ftp.tux.org/pub/java/debian unstable non-free
-
- # Blackdown Java j2re1.4, j2sdk1.4, j2re1.3, j2sdk1.3, jre1.1, jdk1.1.
- # Packaged for i386, PPC, and SPARC.
- deb ftp://metalab.unc.edu/pub/linux/devel/lang/java/blackdown.org/debian unstable main non-free
-
- # Blackdown Java j2r1.4.1
- deb http://jopa.studentenweb.org/debian ./
-
-
- Debian Java FAQ:
- http://www.au.debian.org/doc/manuals/debian-java-faq/
-
-
-
-
- To find all packages that depend on a given package:
- Read the "Reverse Depends" output from "apt-cache showpkg <packagename>".
-
-
-
-
- APT-GET TROUBLESHOOTING
- -----------------------
-
- # apt-get upgrade -f # continue upgrade even after error
- or
- # apt-get dist-upgrade -f # continue dist-upgrade even after error
-
- ...will fix many problems by running apt-get in "fix" mode.
-
- To configure all not-yet-configured packages:
-
- # dpkg --configure -a
-
- To RE-configure all installed packages
-
- # dpkg-reconfigure --all # reconfigure all packages
-
- To RE-configure specific installed packages:
-
- # dpkg-reconfigure --priority=medium package [...]
-
- This will often fix a problematic dependency:
-
- # apt-get install -f package # override broken dependencies
-
- If apt-get or dpkg is choking on something concerning an already
- installed package (e.g., the new package you want to install would
- replace a file the existing package has already provided), sometimes
- the easiest fix is to edit the installed-packages database,
- /var/lib/dpkg/status , directly. (It's an ASCII file.)
-
- Make a safety copy of the file, then open /var/lib/dpkg/status in a text
- editor. Search forward to find the paragraph concerning the package,
- which will begine with the line "Package: packagename". Delete all
- lines of the section concerning that specific package, and save. Now,
- resume package operations.
-
-
-
- This is an example of an apt-get error caused by a file conflict, and
- how to resolve it:
-
- Unpacking replacement kdebase-libs ...
- dpkg: error processing
- /var/cache/apt/archives/kdebase-libs_4%3a2.2.2-14_i386.deb (--unpack):
- trying to overwrite `/usr/share/applnk/Settings/Sound/arts.desktop',
- which is also in package kdebase
- dpkg-deb: subprocess paste killed by signal (Broken pipe)
- Errors were encountered while processing:
- /var/cache/apt/archives/kdebase-libs_4%3a2.2.2-14_i386.deb
- E: Sub-process /usr/bin/dpkg returned an error code (1)
-
- This happens because somebody made a bonehead packaging error, or a
- graceless transition of including a file in one package rather than the
- other. The fix is as follows:
-
- (1) Note down the names of the two packages that are both trying to
- claim ownership of the same file. In this case, package kdebase-libs
- is trying to update a file previously installed by package kdebase.
-
- (2) Stop and think for a moment about what's probably happening: A
- reasonable guess is that "arts.desktop" has simply been moved to
- kdebase-libs, and your package database is being mulish because it
- doesn't know this is OK.
-
- (3) Do a "--force-overwrite" install of the new package, thus:
-
- # dpkg -i --force-overwrite kdebase-libs_4%3a2.2.2-14_i386.deb
-
- (4) Recall and resubmit your apt-get command that choked, now that
- there's no remaining conflict.
-
-
- On very rare occasions, apt-get might refuse to do anything because
- some particular named package is in some broken state it can't deal with.
- [Need an example error message, but don't have one yet.]
-
- In such cases, you can make good use of the fact that Debian uses a plain
- ASCII file (/var/lib/dpkg/status) for its package database, to excise
- the problem directly: Make a backup copy of /var/lib/dpkg/status,
- first. (I've never needed this, but it seems such an easy precaution,
- why not?) Now, open /var/lib/dpkg/status in your favourite text editor.
- Search for "Package: <packagename>", which will bring up a series of
- non-blank lines comprising the package's status entry. Remove
- everything up to the first blank line. Save.
-
- Now, the package's files, themselves, are still installed, but the
- Debian package records have selective amnesia: The system believes that
- package to be not installed. Therefore, apt-get will cease stumbling on
- the defective package entry: You can now do other apt-get operations,
- and reinstall the problem package (overwriting its installed files) at
- any future occasion, at your leisure.
-
-
- If you wish to fix errors in a package's installation scripts, they're
- in /var/lib/dpkg/info as packagename.postinst, packagename.preinst,
- packagename.prerm, and/or packagename.postrm. Debug the error, edit the
- script, and then re-run dpkg -i packagename. (This approach is greatly
- to be preferred over using --force-something options or editing the
- package database directly.)
-
-
-
-
- Package Signing:
-
- In woody/3.0 or later, install debsig-verify, debsigs, and debian-keyring.
- Thereafter, dpkg (1.9.21 or later) checks if debsig-verify is installed
- and if so checks the signatures of packages you want to install. If a
- package's signature is invalid, the package won't get installed.
-
- See this thread:
- http://lists.debian.org/debian-security/2002/debian-security-200207/msg00130.html
-
- Optionally, one can use Fruhwirth Clemens's secpack to auto-apply
- security updates: http://therapy.endorphin.org/secpack/
- The issue of _meaningful_ package signing is complex, and I've attempted
- to detail it here:
- http://linuxmafia.com/~rick/linux-info/debian-package-signing
-
-
-
-
- Hardware-recognition (and related) packages:
-
- discover
- Hardware identification system (thank you, Progeny Systems, Inc.),
- for various PCI, PCMCIA, and USB devices.
- kudzu, kudzu-vesa
- Hardware-probing tool (thank you, Red Hat Software, Inc.) intended to
- be run at boot time. Requires hwdata package. kudzu-vesa is the
- VBE/DDC stuff for autodetecting monitor characteristics.
- mdetect
- Mouse device autodetection tool. If present, it will be used to aid
- XFree86 configuration tools.
- read-edid
- Hardware information-gathering tool for VESA PnP monitors. If
- present, it will be used to aid XFree86 configuration tools.
- sndconfig
- Sound configuration (thank you, Red Hat Software, Inc.), using isapnp
- detection. Requires kernel with OSS sound modules. Uses kudzu, aumix,
- and sox.
- hotplug
- USB/PCI device hotplugging support, and network autoconfig.
- nictools-nopci
- Diagnostic and setup tools for many non-PCI ethernet cards
- nictools-pci
- Diagnostic and setup tools for many PCI ethernet cards.
- mii-diag
- "A little tool to manipulate network cards" (examines and sets the MII
- registers of network cards).
- printtool
- Autodetection of printers and PPD support, via an enhanced version of
- Red Hat Software's Tk-based printtool. Requires the pconf-detect
- command-line utility for detecting parallel-port, USB, and
- network-connected printers (which can be installed separately as
- package pconf-detect).
-
- Don't forget that lspci and pnpdump will list installed PCI and ISApnp
- devices, respectively.
-
- Excellent article on ALSA sound setup in Debian:
- http://www.linuxorbit.com/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=541
-
- Having problems getting your USB mouse working on Debian? See Ramesh
- Panuganty's Debian tips: http://panuganty.tripod.com/debiantips/ , and
- select "mouse" in upper-right selection menu.
-
-
- Localisation: System-wide, do:
- # dpkg-reconfigure locales
- You'll be asked (1) which locales (country/language combinations) to
- generate, and (2) which of those to set as default.
- If you use mutt as your MUA, you can put lines like this in ~/.muttrc :
- set charset = "iso-8859-15"
- set send_charset = "us-ascii:iso-8859-1:iso-8859-15:utf-8"
-
-
-
- Other things needed:
- - Packages in incoming
- - proposed-updates
- - early access to security updates
- - coherent explanation of /etc/apt/sources.list
- - recovery from apt-get/dpkg problems
- - diversions
- - update-alternatives
- - auto-apt
- - apt-proxy and apt-cacher
- - equivs
- - apt-src
-
-