Automatic package update nagging with apticron
Posted by JacobAppelbaum on Wed 24 Jan 2007 at 11:21
apticron is a simple shell script that is called from cron once a day.
faustus:~# apt-get install apticron Reading Package Lists... Done Building Dependency Tree... Done The following extra packages will be installed: apt-listchanges python-apt Suggested packages: x-terminal-emulator The following NEW packages will be installed: apt-listchanges apticron python-apt 0 upgraded, 3 newly installed, 0 to remove and 7 not upgraded. Need to get 105kB of archives. After unpacking 389kB of additional disk space will be used. Do you want to continue? [Y/n] Get:1 http://mirrors.kernel.org stable/main python-apt 0.5.10 [41.5kB] Get:2 http://mirrors.kernel.org stable/main apt-listchanges 2.59-0.2 [56.0kB] Get:3 http://mirrors.kernel.org stable/main apticron 1.1.12 [7332B] Fetched 105kB in 26s (3897B/s) Preconfiguring packages ...You'll be prompted to configure apt-listchanges first. You'll be asked how you want display package changes. I selected text as I find it the least intrusive.
Next you'll be prompted to configure apt-listchanges. Enter the email where you wish to receive package update information.
The package will finish installing:
Selecting previously deselected package apt-listchanges. (Reading database ... 57554 files and directories currently installed.) Unpacking apt-listchanges (from .../apt-listchanges_2.59-0.2_all.deb) ... Selecting previously deselected package apticron. Unpacking apticron (from .../apticron_1.1.12_all.deb) ... Setting up apt-listchanges (2.59-0.2) ... Creating config file /etc/apt/listchanges.conf with new version Setting up apticron (1.1.12) ...Now apticron should send emails once a day when there are new packages available. A sample of such an email looks like this:
apticron report [Fri, 19 Jan 2007 18:42:01 -0800] ======================================================================== apticron has detected that some packages need upgrading on: faustus.example.com [ 18.104.22.168 ] The following packages are currently pending an upgrade: xfree86-common 4.3.0.dfsg.1-14sarge3 libice6 4.3.0.dfsg.1-14sarge3 libsm6 4.3.0.dfsg.1-14sarge3 xlibs-data 4.3.0.dfsg.1-14sarge3 libx11-6 4.3.0.dfsg.1-14sarge3 libxext6 4.3.0.dfsg.1-14sarge3 libxpm4 4.3.0.dfsg.1-14sarge3 ======================================================================== Package Details: Reading changelogs... --- Changes for xfree86 (xfree86-common libice6 libsm6 xlibs-data libx11-6 libxext6 libxpm4) --- xfree86 (4.3.0.dfsg.1-14sarge3) stable-security; urgency=high * Non-maintainer update by the Security Team: Fixes several vulnerabilities reported by iDefense (CVE-2006-6101, CVE-2006-6102, CVE-2006-6103) -- Moritz MuehlenhoffTake a look in the following shell scripts if you're interested in seeing how it's executed by cron or how it accomplishes such useful nagging:
Sun, 7 Jan 2007 13:31:35 +0000 ======================================================================== You can perform the upgrade by issuing the command: apt-get dist-upgrade as root on faustus.example.com It is recommended that you simulate the upgrade first to confirm that the actions that would be taken are reasonable. The upgrade may be simulated by issuing the command: apt-get -s dist-upgrade -- apticron
/etc/cron.daily/apticron /usr/sbin/apticronapticron won't give output if there aren't packages to update. If you know you have some needed upgrades, you can easily run apticron as cron would to see if its working as expected:
faustus:~# /etc/cron.daily/apticronOther relevant and related configuration files to explore:
/etc/apticron/apticron.conf /etc/apt/listchanges.conf /etc/apt/apt.conf.d/20listchanges