[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

check if a newer version of a package is available



1) How do I check if a newer version of a package is available from a
perl script?

If it is an interactive session, I can do, "sudo apt-get -sV install
PACKAGE" and from there I can figure out if apt found a newer version
of the package.

But here I am interested in doing this via a perl script.

2) Generalizing the previous question, is there any way to get the
version number of the package to which it will be upgraded to had I
run "sudo apt-get install PACKAGE"?

As an example, currently I have xterm 303-1 package installed. I can
get this information by

% dpkg -l xterm | grep ^ii | awk '{print $3}'
303-1

Looking at the output of
% sudo apt-get -sV install xterm
I know apt would like to upgrade it to 312-1.

In this particular example, the answers to questions (1) and (2) would
be TRUE and 312-1 respectively.

thanks
raju
-- 
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/


Reply to: