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?

3
  • why not use Synaptic manager for the purpose :)
    – atenz
    Commented Aug 8, 2012 at 6:42
  • New as in updated? Brand new?
    – ish
    Commented Aug 8, 2012 at 6:50
  • I usually use apt-get update and I currenly see them only in Synaptic. But I want an automatic notification, not to check them manually.
    – int_ua
    Commented Aug 8, 2012 at 18:26

3 Answers 3

3
+50

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' [email protected] < 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.

5
  • Isn't that info part of package info in cache? Does synaptic have its' own cache?
    – int_ua
    Commented Feb 11, 2013 at 8: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? Commented Feb 11, 2013 at 9: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
    Commented Feb 11, 2013 at 9: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? Commented Feb 11, 2013 at 9: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
    Commented Feb 11, 2013 at 9:49
0

I think synaptic package manager already shows this information.

2
  • yes, but I don't run it very often. And it does not notify, just passively has them under one section.
    – int_ua
    Commented Feb 11, 2013 at 8:48
  • @int_ua yes :) This is now solved.
    – user45853
    Commented Feb 11, 2013 at 10:16
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?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .