3

I want to see a list of "New in repository" packages every time they appear after cache update. How can I achieve this?

Related questions:

How exactly does Synaptic keep track of "New in repository" packages?

Is there an RSS feed that alerts subscribers of new/updated packages in the official repositories?

int_ua
  • 8,574

3 Answers3

3

Set up an MTA on your system if you haven't already, so that emails sent from the command line will work.

Install the bsd-mailx package to give you a standard command mail to send emails to the MTA from the command line.

Write a script as follows:

#!/bin/sh

mkdir -p ~/new-package-detector
cd ~/new-package-detector
apt-cache search .|awk '{print $1}'|sort|uniq > new-package-list
if [ -f old-package-list ]; then
    comm -23 new-package-list old-package-list > new-in-repository
    if [ -s new-in-repository ]; then
        mail -s 'New packages available' int_ua@example.com < new-in-repository
    fi
fi
mv new-package-list old-package-list

Then set up a cron job to run your script regularly. You might need to add an apt-get update to the start of the script, too, in order to make sure that it happens before the check.

Robie Basak
  • 15,670
  • Isn't that info part of package info in cache? Does synaptic have its' own cache? – int_ua Feb 11 '13 at 08:49
  • I'm fairly sure (but not certain) that synaptic uses the system cache. But if you will rely on automation, then you won't always run synaptic directly, right? – Robie Basak Feb 11 '13 at 09:08
  • The point is I don't want to have another package cache if that info is already a part of apt/dpkg system. – int_ua Feb 11 '13 at 09:10
  • You won't. My script uses the system cache. The apt/dpkg system does not track "new" packages as such, just the archive package lists. So old-package-list has to be kept. But that file is not exactly big or any kind of burden, surely? – Robie Basak Feb 11 '13 at 09:19
  • creating a new file is not using a system cache. I consider it big as long as it's duplicating the info. But I'm still not sure if it is. That's another question, I'll add a link soon :) I've found the RSS. I'll award bounty to you, I appreciate your help, but I'll add my own answer to mark it correct. – int_ua Feb 11 '13 at 09:49
0

I think synaptic package manager already shows this information.

BHS
  • 135
0

I was just asking a wrong question. All I need is these RSS feeds:

Is there an RSS feed that alerts subscribers of new/updated packages in the official repositories?

int_ua
  • 8,574