===== sarge is Debian 3.1 woody is Debian 3.0 potato is Debian 2.2 slink is Debian 2.1 hamm is Debian 2.0 bo is Debian 1.3 rex is Debian 1.2 buzz is Debian 1.1 ===== apt-setup apt-get update apt-get dselect-upgrade apt-get install console-apt apt-get install --target-release testing razor apt-get -s install someappl simulated install apt-get remove gdm remove package apt-cache show iproute apt-spy Parses a list of mirrors, create /etc/apt/sources.list --------------------------------- console-apt / or the sections to find your app, + to tag things for installs, c to check your selections, c to commit to them When done, capture all the software selections you made ============================================== apt-file search in which package a file is included apt-move Move cache of Debian packages into a mirror hierarchy apt-proxy apt-show-source apt-zip aptconf aptitude Console based apt frontend synaptic GUI apt frontend ============================================== dpkg-reconfigure locales ------------ /ect/profile; used by apt-get and wget PROXY=192.168.0.1:8080 export http_proxy=http://${PROXY}/ export ftp_proxy=$http_proxy netselect netselect ftp.debian.org http.us.debian.org ftp.at.debian.org --------------------------------- dpkg --get-selections > /root/installed-selections --------------------------------- on another system dpkg --set-selections < /root/installed-selections ---------------------------------------------- dpkg -i-force-something dpkg -i install packages -l list information about the package -L Package contents -c list all files in the package -r remove the package -I print information about the package including the section of the Debian system, the version number and any package dependencies that exist -S Finding which package contains... ---------------------------------------------- dpkg-reconfigure -plow drupal dpkg-reconfigure /var/cache/apt/archives/xserver-xorg ---------------------------------------------- dpkg -l courier\* ii courier-authda 0.37.3-2.3 Courier Mail Server authentication daemon ii courier-authmy 0.37.3-2.3 MySQL Authentication for Courier Mail Server un courier-authpo (no description available) ---------------------------------------------- apt-get install task-gnome-desktop task-gnome-apps task-gnome-games task-gnome-net gnome-apt ---------------------------------------------- dpkg -S 'doc/*sql' | cut -f1 -d: | sort -u ============================================== http://people.debian.org/~psg/ddg/node135.html make-kpkg build Will build a kernel. make-kpkg binary Will make all the kernel packages. make-kpkg kernel-image Will make only the kernel-image package pentium-builder ============================================== error: Dynamic MMap ran out of room echo 'APT::Cache-Limit "12582912";' >> /etc/apt/atp.conf echo 'APT::Cache-Limit "25165824";' >> /etc/apt/atp.conf ============================================== modconf manipulate modules dlocate view debian package information upgrade-system keep a Debian system up-to-date, free from accumulated obsolete libs xdebconfigurator debsigs debsums ============================================== install with Knoppix http://www.inittab.de/manuals/debootstrap.html DISK=/dev/hda MPOINT=/mnt/hda1 fdisk $DISK mkfs.ext3 ${DISK}1 for i in 1 2 5 6 7; do echo "=====> ${DISK}$i";mke2fs -m 2 -j ${DISK}$i;done for i in 1 2 5 6 7; do echo "=====> ${DISK}$i";fsck ${DISK}$i; done mount ${DISK}1 $MPOINT mkdir ${MPOINT}/usr mkdir ${MPOINT}/var mkdir ${MPOINT}/tmp mkdir ${MPOINT}/home mount ${DISK}2 ${MPOINT}/usr mount ${DISK}5 ${MPOINT}/var mount ${DISK}6 ${MPOINT}/tmp mount ${DISK}7 ${MPOINT}/home df # optional mkdir ${MPOINT}/home/var.cache.apt cd ${MPOINT}/var/cache mv apt/* ../../home/var.cache.apt rmdir /var/cache/apt ln -s ../../home/var.cache.apt apt cd / [ ! -d ${MPOINT}/etc/apt ] && mkdir -p ${MPOINT}/etc/apt [ ! -e ${MPOINT}/etc/resolv.conf ] && cp /etc/resolv.conf ${MPOINT}/etc cat << EOM > ${MPOINT}/etc/apt/sources.list deb http://ftp.us.debian.org/debian/ stable main non-free contrib deb-src http://ftp.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 deb-src http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free deb http://security.debian.org/ stable/updates main contrib non-free #deb http://pkg-kde.alioth.debian.org/kde-3.4.0/ ./ #deb http://www.morphix.org/debian ./ #deb http://ftp.us.debian.org/debian/ testing main #deb-src http://ftp.us.debian.org/debian/ testing main EOM # export DEBOOTSTRAP_DIR=/tmp/debootstrap/ debootstrap sarge $MPOINT http://ftp.us.debian.org/debian # I: Base system installed successfully. #-------------- chroot chroot $MPOINT DISK=/dev/hda mount /proc /proc -t proc apt-get update apt-get upgrade apt-get install grub grub-install $DISK cat << EOM > /etc/lilo.conf #LILO boot loader configuration. boot=$DISK root=$DISK}1 compact install=/boot/boot.b map=/boot/map vga=ask delay=20 image=/boot/vmlinuz root=$DISK}1 label=Linux initrd=/initrd.img read-only EOM [ ! -d ${MPOINT}/boot/grub ] && mkdir -p ${MPOINT}/boot/grub cat << EOM > ${MPOINT}/boot/grub/menu.lst # Boot automatically after 30 secs. timeout 30 color light-green/brown # By default, boot the first entry. default 1 # Fallback to the second entry. fallback 2 # For booting GNU/Linux title hda root (hd0,0) kernel /boot/vmlinuz root=${DISK}1 #initrd /initrd.img EOM install the package mkinitrd-tools and modify /etc/mkinitrd/mkinitrd.conf so $ROOT points to your new root partition (autodetection will fail in chroot). These steps are only required if you want to use one of the Debian kernel-images. apt-get install initrd-tools ============================ check /etc/mkinitrd/mkinitrd.conf (SCSI) MODULES=most DELAY=0 ROOT=/dev/sda1 # This controls the permission of the resulting initrd image. UMASK=022 # generate the initrd image. MKIMAGE='mkcramfs %s %s > /dev/null' ---------------------------- chroot# mount /proc /proc -t proc apt-get install kernel-image-2.4.18-686 apt-get install kernel-image-2.6.8-2-686 add the initrd to lilo.conf and run lilo again before leaving the chroot. chroot# exit umount $MPOINT/proc umount $MPOINT reboot ============================================== bash aliases cat <> /root/.bashrc alias agi='apt-get install ' alias agu='apt-get update ' alias agg='apt-get upgrade ' alias agr='apt-get remove' alias acse='apt-cache search ' alias acsh='apt-cache show ' alias agd='apt-get dist-upgrade' alias asv='apt-show-versions -p' EOM . /root/.bashrc apt-get install screen ============================================== debian recovery cd /var/cache/apt/archives dpkg -i libc6* libdb2* perl* dpkg -i apt* dpkg* debconf* dpkg -i * ---------------------------- dpkg -i /var/cache/apt/archives/packagefile.deb For a broken dependency, fix it or use: dpkg --ignore-depends=package1,... -i packagefile.deb dpkg --force-depends -i packagefile.deb dpkg --force-depends --purge package dpkg --force-confmiss -i packagefile.deb # Install missing conffile Rescue system after crashing /var Obtain the skeleton content of the /var directory from a minimum working Debian system based on the same or older Debian version, for example var.tar.gz, and place it in the root directory of the broken system. Then # cd / # mv var var-old # if any useful contents are left # tar xvzf var.tar.gz # use Woody skeleton file # aptitude # or dselect ---------------------------- ===== store packages info dpkg --get-selections > packs_$(hostname)-$(date '+%F') ---------------------------- restore to previous level (same day!) dpkg --set-selections < packs_$(hostname)-$(date '+%F') apt-get -u dist-upgrade ----- clone ubuntu system sudo dpkg --get-selections | grep '[[:space:]]install$='| awk '{print $1}' > packs_$(hostname)-$(date '+%F') cat packs_$(hostname)-$(date '+%F') | xargs sudo aptitude install ===== prevent a package from being updated in Debian ----- put a package on hold echo "apache2 hold" | dpkg --set-selections aptitude hold apache2 ----- remove the hold echo "apache2 install" | dpkg --set-selections aptitude unhold apache2 ----- status of your packages dpkg --set-selections ----- dselect, enter the [S]elect screen find the package you wish to hold in its present state press = key or H changes will become effective immediately after you exit the [S]elect screen. ===== stable/unstable mix ---------- /etc/apt/sources.list deb http://security.debian.org/ testing/updates main contrib non-free deb http://security.debian.org/ stable/updates main contrib non-free deb ftp://ftp.us.debian.org/debian/ testing main contrib non-free deb ftp://ftp.us.debian.org/debian/ unstable main non-free contrib ------------ /etc/apt/preferences Package: * Pin: release a=unstable Pin-Priority: 50 set the pin-priority for "Unstable" packages to sub-normal (normal=100), they're never fetched by default but only when "apt-get -t unstable install [packagename]" debfoster Install only wanted Debian packages =============================== update-inetd --remove daytime update-inetd --remove telnet update-inetd --remove time update-inetd --remove finger update-inetd --remove talk update-inetd --remove ntalk update-inetd --remove ftp update-inetd --remove discard /etc/init.d/inetd reload =============================== Apache + PHP http://www.howtoforge.com/perfect_setup_debian_sarge_p5 apt-get install apache2 apache2-doc apt-get install libapache2-mod-php4 libapache2-mod-perl2 php4 php4-cli php4-comm on php4-curl php4-dev php4-domxml php4-gd php4-imap php4-ldap php4-mcal php4-mha sh php4-mysql php4-odbc php4-pear php4-xslt curl libwww-perl imagemagick cd /etc/apache2/mods-enabled ln -s /etc/apache2/mods-available/ssl.conf ssl.conf ln -s /etc/apache2/mods-available/ssl.load ssl.load ln -s /etc/apache2/mods-available/rewrite.load rewrite.load ln -s /etc/apache2/mods-available/suexec.load suexec.load ln -s /etc/apache2/mods-available/include.load include.load ===== accept keys for software source gpg --keyserver pgpkeys.mit.edu --recv-key 8F374FEF gpg -a --export 8F374FEF | sudo apt-key add -