debian:apt-xtras
Table of Contents
Packaging Extras
APT Sources
Lenny
deb http://ftp.debian.org/debian lenny main contrib non-free deb http://backports.debian.org/debian-backports lenny-backports main contrib non-free deb http://backports.debian.org/debian-backports lenny-backports-sloppy main contrib non-free deb http://security.debian.org lenny/updates main contrib non-free
Squeeze
deb http://ftp.debian.org/debian squeeze main contrib non-free deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free deb http://security.debian.org squeeze/updates main contrib non-free
Package Control
Update a package only if installed
apt-get install --only-upgrade PACKAGENAME
Reinstall all configs for package
If you need to get all configs back to original state make a copy of the directory needing to be replaced and delete all contents of the original then execute the following:
apt-get -o Dpkg::Options::="--force-confniss" install --reinstall PKGNAME
Force package uninstall
dpkg --force-all -r PACKAGENAME
/etc keeper
This helps in versionizing your /etc directory.
- apt-get install etckeeper
- /etc/apt/apt.conf.d/05etckeeper:
DPkg::Pre-Invoke { "if [ -x /usr/sbin/etckeeper ]; then etckeeper pre-install; fi"; };
DPkg::Post-Invoke { "if [ -x /usr/sbin/etckeeper ]; then etckeeper post-install; fi"; };
RPM::Pre-Invoke { "if [ -x /usr/sbin/etckeeper ]; then etckeeper pre-install; fi"; };
RPM::Post-Invoke { "if [ -x /usr/sbin/etckeeper ]; then etckeeper post-install; fi"; };
apt Listbugs
This lists critical bugs prior to updates
- apt-get install apt-listbugs
- /etc/apt/apt.conf.d/10apt-listbugs
// Check all packages whether they has critical bugs before they are installed.
// If you don't like it, comment it out.
DPkg::Pre-Install-Pkgs {"/usr/sbin/apt-listbugs apt || exit 10"};
DPkg::Tools::Options::/usr/sbin/apt-listbugs "";
DPkg::Tools::Options::/usr/sbin/apt-listbugs::Version "2";
apt List Changes
package change history notification tool
- apt-get install apt-listchanges
- /etc/apt/apt.conf.d/20listchanges
DPkg::Pre-Install-Pkgs { "/usr/bin/apt-listchanges --apt || test $? -ne 10"; };
DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";
RootKit Hunter
update rkhunter when updating packages
- apt-get install rkhunter
- /etc/apt/apt.conf.d/90rkhunter
// Makes sure that rkhunter file properties database is updated after each remove or install only if hashes test is enabled
DPkg::Post-Invoke { "if [ -x /usr/bin/rkhunter ] && ( ! grep -q -E '^DISABLE_TESTS=.*(hashes.*attributes|attributes.*hashes|properties)' /etc/rkhunter.conf || grep -q -E '^ENABLE_TESTS=.*(hashes|attributes|properties)' /etc/rkhunter.conf); then /usr/bin/rkhunter --propupd --nolog; fi" }
IWatch
Disable IWatch when updating packages
- apt-get install iwatch
- /etc/apt/apt.conf.d/02iwatch
DPkg::Pre-Invoke { "if [ -x /usr/bin/iwatch ] ; then service iwatch stop; fi" }
DPkg::Post-Invoke { "if [ -x /usr/bin/iwatch ] ; then service iwatch start; fi" }
Package Listing
Used to generate a list of installed packages for use in reinstalling the system to the current state
Build the command “dpkg –get-selections installed.txt” into a apt.conf.d hook.
- /etc/apt/apt.conf.d/80pkglist
DPkg::Post-Invoke { "echo -n 'Updating /etc/apt/installed-pkgs.txt... ' && /usr/bin/dpkg --get-selections > /etc/apt/installed-pkgs.txt && echo 'Done'" }
To reinstall use the following:
apt-get install dselect dpkg --set-selections </etc/apt/installed-pkgs.txt
debian/apt-xtras.txt · Last modified: by 127.0.0.1
