Upload
truongdan
View
232
Download
0
Embed Size (px)
Citation preview
DebianOsamu Aoki () :
on page 27
CVS, 2007 18 115439 UTC
Debian (http://qref.sourceforge.net/)DebianDebian (http://qref.sourceforge.net/)
http://qref.sourceforge.net/http://qref.sourceforge.net/http://qref.sourceforge.net/
Copyright (c) 20012005 by Osamu Aoki .
This document may be used under the terms of the GNU General Public License version 2 orhigher. (http://www.gnu.org/copyleft/gpl.html)
Permission is granted to make and distribute verbatim copies of this document provided thecopyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this document under theconditions for verbatim copying, provided that the entire resulting derived work is distributedunder the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this document into another lan-guage, under the above conditions for modified versions, except that this permission noticemay be included in translations approved by the Free Software Foundation instead of in theoriginal English.
http://www.gnu.org/copyleft/gpl.html
i
1 1
1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Debian . . . . . . . . . . . . . . . . . . . . . . . . 1
2 stable, testing, unstable 3
2.1 PotatoWoody . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3.1 dselect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Debian 7
3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Debian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2.1 task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2.2 aptitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2.3 dselect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2.4 APT . . . . . . . . . . . . 11
3.2.5 aptitude, apt-get apt-cache . . . . . . . . . . . . . . . . 11
3.3 Debian . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3.1 Debian . . . . . . . . . . . . . . . . . 13
3.3.2 APT . . . . . . . . . . . . . . . . . . . 13
3.3.3 dpkg . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
ii
3.3.4 . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.5 /var . . . . . . . . . . . . . . . . . . . . . 15
3.3.6 . . . . . . . . . . . . 15
3.3.7 dpkg . . . . . . . . . . . . . . . . . . . . 16
3.4 Debian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.4.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.4.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.4.3 APT . . . . . . . . . . . . . . . 18
3.4.4 . . . . . . . . . . . . . . . . . . . . 18
3.4.5 . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.4.6 hold . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.4.7 stable/testing/unstable . . . . . . . . . . . . . . . 20
3.4.8 . . . . . . . . . . . . . . 20
3.4.9 / . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.4.10 stable . . . . . . . . . . . . . . . . . . . . . 20
3.4.11 . . . . . . . . . . . . . . . . . . . . . . . 21
3.4.12 alien . . . . . . . . . . . . 22
3.4.13 . . . . . . . . . . . . . . . . . . . . . . 22
3.4.14 . . . . . . . . . . . . 23
3.5 Debian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.5.1 dpkg-divert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.5.2 equivs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.5.3 Alternative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.5.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.5.5 . . . . . . . . . . . . . . . . . . . . . . . . 25
A 27
A.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
A.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
A.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
1
1
quick referenceKeep it short and simple (KISS)
1.1
Debian bash
Unix bash(1)
GNU TEXINFO info libc
1.2 Debian
Debian 33
stable
testing
unstable Debian
unstable release-critical (RC) 1,2 testing
1. 2
Debian Sarge 2005 6 Debian 3 Woody(stable)Sarge (testing) Sid (unstable) Sarge SargeEtch Sid Etchstable unstable Etch Sid testing ( stable )
Debian [email protected]
stable, testing, unstable on page 3 stable on page 20
3
2
stable, testing, unstable
2.1 PotatoWoody
Potato APT apt_preferences(5)
/etc/apt/sources.list stable stable APT
# apt-get update# apt-get install libc6 perl libdb2 debconf# apt-get install apt apt-utils dselect dpkg
Woody
# apt-get upgrade# apt-get dist-upgrade
2.2
stable
2. stable, testing, unstable 4
# cd /etc/apt# cp -f sources.list sources.list.old# :>sources.list# apt-setup noprobe
testing testing unstable unstable
# cd /etc/apt# grep -e "^deb " sources.list >srcs# :>sources.list# cp -f srcs sources.list# sed -e "s/stable/testing/" srcs >>sources.list# sed -e "s/stable/unstable/" srcs >>sources.list# apt-get update# apt-get install apt apt-utils
/etc/apt/sources.list /etc/apt/preferences Debian on page 8
2.3
/etc/apt/sources.list /etc/apt/preferences
Debian testing unstable testing
Debian on page 7 APT on page 13
2.3.1 dselect
-dev dselect
# dselect update # # dselect select #
dselect Depend, Suggest, Recommends dselect Q dselect
2. stable, testing, unstable 5
# dselect install
dselect installdselect onpage 10
dselect :)
2. stable, testing, unstable 6
7
3
Debian
aptitude APT aptitude
synaptic APT Gtk GUI aptitude Debian Package Tags (http://debtags.alioth.debian.org/)
Debian Debian
APT squid HTTPhttp_proxy/etc/apt/apt.conf http
apt_preferences(5) pin
chroot
Woody Sarge
3.1
Debian testing/unstable :-)
http://debtags.alioth.debian.org/http://debtags.alioth.debian.org/
3. Debian 8
3.1.1
dpkg - Debian apt-get - APT aptitude - APT synaptic - APT Gtk GUI dselect - tasksel -
dselect APT dpkg
APT /var/lib/apt/lists/*dpkg /var/lib/dpkg/available aptitude APT dselect dselect [U]pdate (dselect update)
apt-get Depends Recommends Suggests
aptitude Recommends Suggests
dselect Recommends Suggests
3.1.2
dpkg-reconfigure - (debconf )
dpkg-source - source dpkg-buildpackage - apt-cache -
3.2 Debian
on page 3 sources.list 1
1testing unstable /etc/apt/sources.list /etc/apt/preferences stable testing stable
3. Debian 9
3.2.1 task
Debian task
task tasksel
dselect update
aptitude task task
3.2.2 aptitude
aptitude dselect APT 1 apt-get aptitude(1) /usr/share/doc/aptitude/README
aptitude aptitude
aptitude 1
F10 ? u +
- ()_ purge ()= hold U
g q x Enter C
3. Debian 10
l / \
apt-get aptitude Depends aptitude Recommends Suggests F10-> Options -> Dependency handling
aptitude aptitude aptitude /var/log/aptitude aptitude Obsolete and Locally Created Packages
aptitude muttmutt expressionsyntax /usr/share/doc/aptitude/README SEARCHING, LIMITING, AND EXPRESSIONS
aptitude su
3.2.3 dselect
Potato stable dselect Sargeaptitude
dselect Required, Important, Standard
dselect4 (!)
Q
()R ! D ! dselect U
D Q
expert /etc/dpkg/dselect.cfg
3. Debian 11
dselect () dselect apt-get install
3.2.4 APT
testing unstable testing
unstable testing apt_preferences(5)
examples subdirectory (http://www.debian.org/doc/manuals/debian-reference/examples/) preferences.testing preferences.unstable
stable testing stable unstable testing unstable libc6
preferences.stable stable
package Debian /var/cache/apt/archives/ http://snapshot.debian.net/ dpkg on page 14
Debian
3.2.5 aptitude, apt-get apt-cache
testing
aptitude update ( apt-get update)
http://www.debian.org/doc/manuals/debian-reference/examples/http://www.debian.org/doc/manuals/debian-reference/examples/http://snapshot.debian.net/
3. Debian 12
aptitude upgrade ( apt-get upgrade aptitude dist-upgradeapt-get dist-upgrade)
testing testing 2
apt-get dselect-upgrade
testing dselect
aptitude install package/unstable
unstable packagetesting
aptitude install -t unstable package
unstable Pin-Priority 990 unstable packageunstable
apt-cache policy foo bar ...
foo bar . . .
aptitude show foo bar ... | less ( apt-cache show foo bar ...| less)
foo bar . . .
aptitude install foo=2.2.4-1
foo 2.2.4-1
aptitude install foo bar-
foobar
aptitude remove bar
bar
aptitude purge bar
bar
apt-get -u apt-get aptitude
2upgrade dist-upgrade apt-get(8) aptitude upgrade aptitudedist-upgrade aptitude e
3. Debian 13
$ cat >> /etc/apt/apt.conf
3. Debian 14
# aptitude dist-upgrade
# aptitude -f upgrade # upgrade... # aptitude -f dist-upgrade # dist-upgrade
/var/lib/dpkg/info/packagename.{post,pre}{inst,rm}
# dpkg --configure -a #
/etc/.new () mv
unstable testing
# aptitude -f install package #
equivs /usr/share/doc/equivs/README.Debian
3.3.3 dpkg
APTDebiandpkg /var/cache/apt/archives/
# dpkg -i fetchmail_6.2.5-4_i386.deb
dpkg --ignore-depends,--force-depends, dpkg(8)
3. Debian 15
3.3.4
/var/lib/dpkg/status Debian /var/lib/dpkg/status-old/var/backups/dpkg.status.* /var/lib/dpkg/status
/var/backups/
/var/lib/dpkg/status /usr/share/doc/
# ls /usr/share/doc | \grep -v [A-Z] | \grep -v ^texmf$ | \grep -v ^debian$ | \awk {print $1 " install"} | \dpkg --set-selections
# dselect --expert #
3.3.5 /var
/var /var Debian
Debian /var Debian var.tar.gz(http://people.debian.org/~osamu/pub/) root
# cd /# mv var var-old # # tar xvzf var.tar.gz # Woody # aptitude # dselect
on page 15 ([FIXME]:)
3.3.6
Debian/CD Linux Linux /targetdpkg chroot
http: / /people.debian.org /~osamu /pub /
3. Debian 16
# dpkg --root /target -i packagefile.deb
lilo Debian Linux root /dev/hda12 3 lilo
boot: rescue root=/dev/hda12 3
kernel(kernel)
3.3.7 dpkg
dpkg .deb( 1 links)
$ links http://http.us.debian.org/debian/pool/main/d/dpkg/... dpkg_version_arch.deb
$ supassword: *****# ar x dpkg_version_arch.deb# mv data.tar.gz /data.tar.gz# cd /# tar xzfv data.tar.gz
i386http://packages.debian.org/dpkg URL
3.4 Debian
Debian :)
3.4.1
3. Debian 17
$ dpkg {-S|--search} pattern
Debian
$ wget http://ftp.us.debian.org/debian/dists/sarge/Contents-i386.gz$ zgrep -e pattern Contents-i386.gz
# aptitude install dlocate$ dlocate filename # dpkg -L dpkg -S ...# aptitude install auto-apt # # auto-apt update # autp-apt db $ auto-apt search pattern#
3.4.2
/etc/apt/sources.list APT testing unstable apt-cache policy
# apt-get check # $ apt-cache search pattern # $ apt-cache policy package # priority/dist $ apt-cache show -a package # dists $ apt-cache showsrc package # $ apt-cache showpkg package # # dpkg --audit|-C # $ dpkg {-s|--status} package ... #
$ dpkg -l package ... #
(1)$ dpkg -L package ... #
apt-cache showrcWoody :)
( mc )
/var/lib/apt/lists/*/var/lib/dpkg/available
3. Debian 18
/var/lib/dpkg/status/var/backups/dpkg.status*
3.4.3 APT
/etc/apt/apt.conf
Dpkg::Options {"--force-confold";}
aptitude -y install packagename yes apt.conf(5) dpkg(1)
on page 18
3.4.4
# dpkg-reconfigure --priority=medium package [...]# dpkg-reconfigure --all # # dpkg-reconfigure locales # # dpkg-reconfigure --p=low xserver-xfree86 # X
debconf debconf
3
apt-setup - /etc/apt/sources.list install-mbr - Master Boot Record manager tzconfig - time zonegpmconfig - gpm eximconfig - Exim (MTA) texconfig - teTeX apacheconfig - Apache (httpd) cvsconfig - CVS
3 *config Sarge debconf
3. Debian 19
sndconfig - ...update-alternatives - vim vi update-rc.d - System-V init update-menus - Debian menu ...
3.4.5
# aptitude remove package ...# dpkg --remove package ...
# aptitude purge package ...# dpkg --purge package ...
3.4.6 hold
libc6 libc6-dev dselect aptitude install package hold
# echo -e "libc6 hold\nlibc6-dev hold" | dpkg --set-selections
aptitude install package hold aptitude upgradepackage aptitude dist-upgrade hold /etc/apt/preferences
Package: libc6Pin: release a=stablePin-Priority: 2000
Package: libc6*glibc hold
hold
dpkg --get-selections "*"|grep -e "hold$"
3. Debian 20
3.4.7 stable/testing/unstable
apt-show-versions
$ apt-show-versions | fgrep /testing | wc... testing $ apt-show-versions -u... $ aptitude install apt-show-versions -u -b | fgrep /unstable... unstable
3.4.8
APT /var/cache/apt/archives
# apt-get autoclean # # apt-get clean #
3.4.9 /
# debconf-get-selections > debconfsel.txt# dpkg --get-selections "*" >myselections # \*
*myselections purge
# dselect update# debconf-set-selections < debconfsel.txt# dpkg --set-selections
3. Debian 21
deb-src http://http.us.debian.org/debian testing \main contrib non-free
deb-src http://http.us.debian.org/debian unstable \main contrib non-free
deb-src 2 sources.list 1
$ apt-get update # $ apt-get source package$ dpkg-source -x package.dsc$ cd package-version... (.dsc Build-depends)
"fakeroot"
$ dpkg-buildpackage -rfakeroot
... ()$ dpkg-buildpackage -rfakeroot -us -uc # "debsign"
...$ su -c "dpkg -i packagefile.deb"
-dev 2, 3 debsign devscripts auto-aptfakerootroot
Woody pine
# apt-get build-dep pine# apt-get source -b pine
3.4.11
APT dselect Packages
Debian deb
3. Debian 22
# aptitude install dpkg-dev# cd /usr/local# install -d pool # # install -d dists/unstable/main/binary-i386# ls -1 pool | sed s/_.*$/ priority section/ | uniq > override# editor override # priority section # dpkg-scanpackages pool override /usr/local/ \
> dists/unstable/main/binary-i386/Packages# cat > dists/unstable/main/Release > /etc/apt/sources.list
deb
# aptitude install dpkg-dev# mkdir /usr/local/debian# mv /some/where/package.deb /usr/local/debian# dpkg-scanpackages /usr/local/debian /dev/null | \gzip - > /usr/local/debian/Packages.gz
# echo "deb file:/usr/local/debian ./" >> /etc/apt/sources.list
HTTP FTP /etc/apt/sources.list
3.4.12 alien
alien Red Hat rpmStampede slpSlackware tgz Solaris pkg Debian deb Linux alienalien LSB
3.4.13
auto-apt
3. Debian 23
$ sudo auto-apt update... $ auto-apt -x -y runEntering auto-apt mode: /bin/bashExit the command to leave auto-apt mode.$ less /usr/share/doc/med-bio/copyright #
... ...
3.4.14
debsumsMD5MD5
# cat >>/etc/apt/apt.conf.d/90debsumsDPkg::Post-Install-Pkgs {"xargs /usr/bin/debsums -sg";};^D
Joerg Wendland ()
3.5 Debian
3.5.1 dpkg-divert
Diversions dpkg Diversions Debian (conffiles) dpkg diversion .
# dpkg-divert [--add] filename # "diversion" # dpkg-divert --remove filename # "diversion"
dpkg-divert
3. Debian 24
3.5.2 equivs
debian (.deb) equivs
Package: equivsPriority: extraSection: adminDescription: Debian Debian
3.5.3 Alternative
vi vim update-alternatives
# update-alternatives --display vi...# update-alternatives --config viSelection Command
-----------------------------------------------1 /usr/bin/elvis-tiny2 /usr/bin/vim
*+ 3 /usr/bin/nvi
default[*] Enter selection 2
Debian alternatives /etc/alternatives/
X Window update-alternatives /usr/bin/x-session-manager /usr/bin/x-window-manager
/bin/sh /bin/bash /bin/dash Bashism /bin/bashPOSIX/bin/dash 2.4 Linux kernel/bin/sh /bin/dash
3.5.4
Debian 2 5 Debian 2, 3, 4, 5Debian
3. Debian 25
GNU/Linux X 2 xdm gdm 3
3.5.5
Debian
(Exim, DHCP) ps aux/etc/init.d/* /etc/inetd.conf/etc/hosts.deny ( ) pidof (pidof(8))
Debian X11 TCP/IP SSH X
3. Debian 26
27
A
A.1
Debian Osamu Aoki debian-users Debian Installation Manual Debian Release Notes
Debian Documentation Project (http://www.debian.org/doc/ddp) (DDP) The Debian FAQ Josip Rodin Debian The Debian FAQ
QREF
Osamu Aoki () (leader: all contents)
Esko Araj.rvi (etch) Thomas Hood () Brian Nelson ( X) David Sewell () Jan Michael C Alonzo Daniel Webb
Guillaume Erbs (leader: fr) Renald Casagraude Jean-Pierre Delange Daniel Desages
Davide Di Lazzaro (leader: it)
() Paulo Rogerio Ormenese (leader: pt-br)
http://www.debian.org/doc/ddp
A. 28
Andre Luis Lopes Marcio Roberto Teixeira Rildo Taveira de Oliveira Raphael Bittencourt Simoes Costa Gustavo Noronha Silva (coordinator)
Walter Echarri (leader: es) Jose Carreiro
Jens Seidel (leader: de) Willi Dyck Stefan Schroeder Agon S. Buchholz
PDDP (http://debian.linux.org.pl): Marcin Andruszkiewicz Mariusz Centka Bartosz Fenski (leader: pl) Radosaw Grzanka Bartosz Xebord Janowski Jacek Lachowicz Rafa Michaluk Leonard Milcin, Jr. Tomasz Z. Napieraa Oskar Ostafin Tomasz Piekos Jacek Politowski Mateusz Prichacz Marcin Rogowski Pawe Rzanski Mariusz Strzelecki Krzysztof Scierski Przemysaw Adam Smiejek Krzysztof Szynter Mateusz Tryka Cezary Uchto Krzysztof Witkowski Bartosz Zapaowski
() Hao Lyoo LIU Ming Hua Xiao Sheng Wen (leader: zh-cn) Haifeng Chen Xie Yanbo easthero
() Asho Yeh (leader: zh-tw)
http://debian.linux.org.pl
A. 29
Tang Wei Ching (ex-leader: zh-tw)
Shinichi Tsunoda () (leader: ja) Osamu Aoki ()
Esko Araj.rvi (leader: fi)
A.2
Debian Linux
A.3
debian-reference Debian BTS system (http://bugs.debian.org/) reportbug bug report (Osamu Aoki (http://people.debian.org/~osamu/))
http://bugs.debian.org/http://people.debian.org/~osamu/http://people.debian.org/~osamu/
Debian
stable, testing, unstable Potato Woody dselect
Debian
Debian task aptitudedselectAPT aptitude, apt-get apt-cache
Debian Debian APT dpkg =1sp /var dpkg
Debian APT hold stable/testing/unstable /stable alien
Debian dpkg-divert equivs Alternative