Help with scripting APT / dpkg in Debian 4


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with scripting APT / dpkg in Debian 4
# 1  
Old 10-20-2008
Help with scripting APT / dpkg in Debian 4

Hello,

I am attempting to write a (bash) shell script that will do some basic reporting based on the APT utilities and dpkg.

I need the following in the report:
Packages installed
(COLUMNS=200 dpkg -l | grep '/^ii/' > packages_installed)

Packages not installed

I suppose that I can do
COLUMNS=200 dpkg -l > packages_available
and then use cmp or diff to print a list of the differences which should just be the packages not installed

Packages with security updates
I'm drawing a blank on this one, maybe restricting sources to
deb Debian -- Security Information stable/updates main
and printing the output

Packages with updates
I think it's just
apt-get -u upgrade > packages_updates

Packages with new versions (including the distro)
apt-cache show?

The script should then print out in a legible form the different categories from the files created. I realize that there are some GUI's out there that do basically the same thing but this will run on servers. Ideally it should be dependent on the "standard" apt utilities.

Thanks for any input!
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. Ubuntu

Problem creating Desktop shortcuts through Debian dpkg installer scripts

Hi, I am creating a debian package (*.deb) for my application using the command I am using debian pre/post installer scripts to do certain tasks before/after installation/uninstallation. One such task is to create a shortcut on the user's desktop to launch my application. I am trying to do this... (0 Replies)
Discussion started by: royalibrahim
0 Replies

2. Linux

GPG error on Debian 4 using apt-get

Hello, I wish to update a debian 4.0 server we have but cannot get past the following error message. my keys are as follows: Any help would be good. (0 Replies)
Discussion started by: pobman
0 Replies

3. UNIX for Advanced & Expert Users

Debian aptitude - apt-get problem

I've got a strange one. As root, in aptitude, I'll do an update successfully. Then I do an upgrade, the files download, the progress bar will not show total progress, just progress per file, then reset to 0% for the next file. When the files complete downloading, I hit a carrige return to go to... (1 Reply)
Discussion started by: mikek147
1 Replies
Login or Register to Ask a Question
DPKG-GENBUILDDEPS(1)					      General Commands Manual					      DPKG-GENBUILDDEPS(1)

NAME
dpkg-genbuilddeps - generate a list of packages used to build this package SYNOPSIS
dpkg-genbuilddeps [arg ...] DESCRIPTION
This program is a wrapper around dpkg-depcheck(1). It should be run from the top of a Debian build tree. It calls dpkg-buildpackage with any arguments given on the command line, and by tracing the execution of this, it determines which non-essential packages were used during the package building. This can be useful in determining what the Build-Depends control fields should contain. It does not determine which packages were used for the arch independent parts of the build and which for the arch dependent parts, not does it attempt to determine which versions of packages are required. It should be able to run under fakeroot rather than being run as root, as fakeroot dpkg-genbuild- deps, or dpkg-genbuilddeps -rfakeroot. This program requires the build-essential package to be installed. If it is not, please use dpkg-depcheck directly, with a command such as dpkg-depcheck --all dpkg-buildpackage -us -uc -b -rfakeroot ... All this program itself does is essentially to run the command: dpkg-depcheck -b dpkg-buildpackage -us -uc -b -rfakeroot [arg ...] SEE ALSO
The Debian Policy Manual, sections on Build-Depends etc., dpkg-depcheck(1) and fakeroot(1). AUTHOR
The original dpkg-genbuilddeps was written by Ben Collins <bcollins@debian.org>. The current version is a simple wrapper around dpkg- depcheck written by Bill Allombert <ballombe@debian.org>. This manual page was written by Julian Gilbey <jdg@debian.org>. DEBIAN
Debian Utilities DPKG-GENBUILDDEPS(1)