NOTE: This page is under construction.

List of packages

Factoids from 'dpkg' at freenode

  • To clone a Debian machine using aptitude (or install your favourite packages) use aptitude search--disable-columns -F%p '~i!~M!~v' > package_list; on the reference machine; xargs aptitude --schedule-only install < package_list;aptitude install; on the other machine. This preserves information about "automatically installed" packages that other methods do not. See also , , , .
  • Reinstall: aptitude reinstall '~i' ; or COLUMNS=200 dpkg -l | awk '/^[hi]i/{print $2}' | xargs apt-get -y --reinstall install, or dpkg --get-selections > my_packages.txt , then later, dpkg --set-selections < my_packages.txt && apt-get install
  • Things to backup: Some things you should back up include: /etc /home /root /usr/local /usr/src /opt /srv. Tailor to your own purposes. If you think you don't need /var, make sure you don't forget /var/lib/dpkg /var/backups /var/lib/apt* /var/lib/mysql /var/mail /var/www /var/cache/debconf /var/spool/cron ...
  • Debian clone: One method of cloning Debian installs is to take a current Debian machine that is set up with the packages you want and run the command "dpkg --get-selections > ~/selectionfile". Then, after the base install on other machines use that file and do: "dpkg --set-selections < ~/selectionfile && apt-get dselect-upgrade". Also ask me about , , .
  • apt-clone is a utility to clone/restore the packages on an apt-based system. It will save/restore the packages, sources.list, keyring and automatic-installed states. It can also save/restore no longer downloadable packages using .

Rsync backups

  1. To back up /home to an external USB disk, date;rsync -avhAX /home /media/username/backupmedianame/home;date.

  2. To restore the backup from the external USB disk, date;rsync -avhAX /media/username/backupmedianame/home /home;date.

Replace username and backupmedianame as needed.

The date allows to see when rsync exited. This allows to measure the time it took to complete, or see when it stopped if there was a failure.

Options summary:

  • -a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
    • -r, --recursive recurse into directories
    • -l, --links copy symlinks as symlinks
    • -p, --perms preserve permissions
    • -t, --times preserve modification times
    • -g, --group preserve group
    • -o, --owner preserve owner (super-user only)
    • -D same as --devices --specials
  • -v, --verbose increase verbosity
  • -H, --hard-links preserve hard links
  • -A, --acls preserve ACLs (implies -p)
    • -p, --perms preserve permissions
  • -X, --xattrs preserve extended attributes

If suddenly the external disk is marked as read-only,

  • the target fs may be corrupt - use mount to see the /dev/sdz device name; unmount /dev/sdz and e2fsck /dev/sdz replacing sdz with the name of the device - or
  • it may be a bad cable - try another - or
  • someone interfered with the cable while rsync was running - remove the external drive and plug it back in.

TODO: confirm -H not -h