A. No you don't have to write a shell script. You need to use apticron command / script for notification. apticron is mainly intended for automatic notification of pending security updates but can also be used in many other situations where timely updates are neccessary.
Install apticron
Type the following command at a shell prompt:# apt-get update
# apt-get install apticron
Configure apticron to send email notifications
The default coniguration file is located at /etc/apticron/apticron.conf. Open file using text editor:# vi /etc/apticron/apticron.conf
You need to set email address to email the notification as follows:EMAIL="vivek@nixcraft.in"
My sample configuration file:
# apticron.conf
#
# set EMAIL to a list of addresses which will be notified of impending updates
#
EMAIL="admin@myhost.com"
#
# Set LISTCHANGES_PROFILE if you would like apticron to invoke apt-listchanges
# with the --profile option. You should add a corresponding profile to
# /etc/apt/listchanges.conf
#
# LISTCHANGES_PROFILE="apticron"
#
# Set SYSTEM if you would like apticron to use something other than the output
# of "hostname -f" for the system name in the mails it generates
#
# SYSTEM="foobar.example.com"
#
# Set IPADDRESSNUM if you would like to configure the maximal number of IP
# addresses apticron displays. The default is to display 1 address of each
# family type (inet, inet6), if available.
#
# IPADDRESSNUM="1"
#
# Set IPADDRESSES to a whitespace seperated list of reachable addresses for
# this system. By default, apticron will try to work these out using the
# "ip" command
#
# IPADDRESSES="192.0.2.1 2001:db8:1:2:3::1"
Save and close the file. /etc/cron.daily/apticron is the cron script for executing apticron daily and it will send you notfication when updates available.
Sample apticron email
Here is a sample email:
apticron report [Sun, 06 Jul 2008 07:07:23 +0000]
========================================================================
apticron has detected that some packages need upgrading on:
vip.clicklinux.org
[ 72.51.34.244 ::72.51.34.244 ]
The following packages are currently pending an upgrade:
libpcre3 6.7+7.4-4
========================================================================
Package Details:
Reading changelogs...
--- Changes for pcre3 (libpcre3) ---
pcre3 (6.7+7.4-4) stable-security; urgency=high
* Non-maintainer upload by the security team.
* Apply patch from Tavis Ormandy to fix a heap overflow in the compiler,
triggered by patterns which contain options and multiple branches
(CVE-2008-2371).
-- Florian WeimerFri, 04 Jul 2008 21:15:19 +0200
========================================================================
You can perform the upgrade by issuing the command:
aptitude dist-upgrade
as root on vip.clicklinux.org
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:
aptitude -s -y dist-upgrade
-- apticron
You will get an email when security updates released by Debian / Ubuntu security team. I also suggest subscribing to Debian email security update notification and Ubuntu Linux security notification via RSS or email.
Source:- http://www.cyberciti.biz/faq/apt-get-apticron-send-email-upgrades-available/
- http://www.debian-administration.org/articles/491
0 comments:
Post a Comment