Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have set up aptitude update as cronjob for root and sending the mail to my normal user account.

What I want to have now, is that all the output of aptitude is ommited and instead only a summarization of all packages that are new or could be updgraded. Also in case of errors, there should be a list of errorous repos/ppa and the corresponding errormessage.

Is there a way to do such a cronjob, and where can I find informations about scripting such thing?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I could think of the following commands:

sudo aptitude update >/dev/null 2>update-errors
aptitude search ~U >upgradable-packages
aptitude search ~N >new-packages
sudo aptitude forget-new

then in the files update-errors, upgradable-packages and new-packages you could find the information you're looking for. Unfortunately the forget-new command, needed to not show again as new the same packages, do not seem to work very well.

For information about the search pattern of aptitude, install the package aptitude-doc-en (or that in your language, if available), then show the page Search term reference (here an online version)

The setup of the cronjob, given you already have one, is up to you.

share|improve this answer
    
I cant find documentation about the ~U flag, but I assume it finds only the upgradable packages, not the packages that are "new" in the repos. What is the flag for new packages? If I had this information I think I would be able to setup the rest. –  NobbZ Jan 2 '12 at 18:39
    
@NobbZ: see updated answer. –  enzotib Jan 2 '12 at 18:50
    
Thank you, I will try to get it running as soon as I have some time left that is not consumed by my wife... –  NobbZ Jan 2 '12 at 18:55
    
Sorry, but that does not work: zsh: no such user or named directory: U –  NobbZ Jan 4 '12 at 20:37
    
@NobbZ: Put them between quotes: '~U'. –  enzotib Jan 4 '12 at 20:54
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.