Getting update notifications although up-to-date via aptitude

Bug #918656 reported by Stephan Springer on 2012-01-19
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Committed
update-notifier (Ubuntu)

Bug Description

I'm getting notifications that my system and/or the package list is not up-to-date every few days via the Gnome panel, although I'm running aptitude regularly to update the package list *and* the system.

After looking around a bit, I guess the culprit is the file /etc/apt/apt.conf.d/15update-stamp, which touches /var/lib/apt/periodic/update-success-stamp, while /etc/cron.daily/apt checks the age of the file /var/lib/apt/periodic/update-stamp (without "success-").

This makes this cron script wrongly think that an update is needed.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: update-notifier-common 0.117ubuntu3.1
ProcVersionSignature: Ubuntu 3.0.0-14.23-server 3.0.9
Uname: Linux 3.0.0-14-server x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Thu Jan 19 13:26:24 2012
PackageArchitecture: all
SourcePackage: update-notifier
UpgradeStatus: No upgrade log present (probably fresh install)
 APT::Periodic::Download-Upgradeable-Packages "0";
 APT::Periodic::Unattended-Upgrade "0";
 APT::Periodic::Update-Package-Lists "7";
mtime.conffile..etc.apt.apt.conf.d.10periodic: 2012-01-19T12:25:51.616232

Stephan Springer (geryon) wrote :

The attachment "Suggested fix" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Stephan Springer (geryon) wrote :

I have noticed another issue: These settings in /etc/apt/apt.conf.d/15update-stamp aren't triggered at all here (regardless whether they are correct or not, I'm not sure any more).

I am only using aptitude, and running «aptitude -u» or pressing «u» inside aptitude doesn't touch the stamp as it should. But if I run «apt-get update» once, this will touch the stamp and keep the notification silent for the next few days.

Changed in aptitude:
status: Unknown → New
Changed in aptitude:
status: New → Fix Committed
Dominique Brazziel (dbrazziel) wrote :

I've noticed the 'update-success-stamp' time being updated at two times during the day:

1) After '/etc/cron.daily/apt' runs (between 4:30 and 5pm on my system). At this time the timestamp matches that of '/var/lib/apt/periodic/update-stamp.
2) Early in the morning, about 12 hours later, and it seems to be triggered by packagekit, which is configured to check for updates once a day and to only install security updates (see 'gpk-prefs'). I will check to see if turning off the packagekit updates stops the additional update checks from running. Evidence of past update-notifier/apt/packagekit activity is in the output of 'lastcomm | grep apt-check' (also, look for packagekitd finishing after the apt-check'). Another way to see what is happening in rael time is to add the '--debug updates' and '--debug inotify' flags to update-notifier

 The methodology of update-notifier (and packagekit) regarding the security updates seems to be to try and run when the system is 'idle', and there are a lot of notations in the update-notifiier source. The cause of getting notifications even though the system is up to date is due to the 'update-success-stamp' being more than 7 days old. See u-n/src/update.c function 'outdated_nag', which is called from function 'update_check()':

static gboolean
outdated_nag(TrayApplet *ta)
   struct stat buf;
   if ((stat("/var/lib/apt/periodic/update-success-stamp", &buf) == 0) &&
       (time(NULL) - buf.st_mtime > OUTDATED_NAG_AGE) ) {
      gtk_status_icon_set_visible (ta->tray_icon, TRUE);
      ta->name = "gtk-dialog-warning-panel";
      GdkPixbuf *src = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(),
                                                ta->name, 48,
      gtk_status_icon_set_from_pixbuf(ta->tray_icon, src);
                                  _("The update information is outdated. "
                                    "This may be caused by network "
                                    "problems or by a repository that "
                                    "is no longer available. "
                                    "Please update manually "
                                    "by clicking on this icon and then "
                                    "selecting 'Check for updates' and "
                                    "check if some of the listed "
                                    "repositories fail."
   return FALSE;

I think if '/var/lib/apt/periodic/update-success-stamp' is touched to bring it up to date (i.e. less than 7 days old) the nag message goes away.
If '/etc/cron.daily/15update-stamp' is changed to not reference '/var/lib/apt/update-success-stamp' that would break some checks in update-notifier/
See the aforementioned 'update-c' and 'update-notifier.c'.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.