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'm writing a small daemon in c/c++ and I need to get the number of updates available and how many of them are security updates.
So far I know I could use either update-notifier or nagios but just for getting the number of updates these have way to many dependencies that i don't need/want on an headless server.
Is there any way to get this information directly through apt or are there even libs for c/c++ with this functionality?
I have byobu running on my server and it somehow retrieves this information and displays it but I don't know how.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You want /usr/lib/update-notifier/apt-check from the update-notifier-common package. Run /usr/lib/update-notifier/apt-check -h for usage information. It has both human readable and machine readable forms.

share|improve this answer
    
This is how your motd does it. So I believe the package is already installed by default. –  Robie Basak Feb 11 '13 at 11:14
    
OK i just checked and if i install update-notifier-common instead of update-notifier i don't get prompted to install the 160~ dependencies so this works thanks. But if anyone knows of a good c/c++ lib an quick hint would still be appreciated. For now I'll go with this solution. –  K. Hendrik Feb 11 '13 at 11:20
    
The update-motd.d skript and apt-check both are not installed on my server but they are present on my pc so maybe it is a server os thing. –  K. Hendrik Feb 11 '13 at 12:17
add 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.