Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Say I have python-twisted installed.

sudo apt-get -V check python-twisted

does not show the version number, just

Reading package lists... Done
Building dependency tree       
Reading state information... Done

How do I get apt-get to print the currently installed version number for an application?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

apt-get is the wrong tool for that.

dpkg -l python-twisted shows the version number as part of a human-friendly listing with possibly truncated columns. For parseable output, use dpkg-query -W python-twisted, or dpkg-query -W -f '${version}\n' python-twisted to get just the version number.

apt-cache policy python-twisted shows what version of the package is installed as well as any version that is available for installation.

These are all about deb package versions, not python library module versions. The package version often follows the library module version, but it's not an obligation.

share|improve this answer
add comment

I figured out you can get the version number of a python package (not anything) by just saying

python
>>> import twisted
>>> print twisted.version
[twisted, version 10.0.0]

small problem solved. general problem forgotten

share|improve this answer
    
Then you asked the wrong question. This topic might still be interesting for others; try to accept a solution for your original question if someone posts it. –  Daniel Beck Dec 14 '10 at 18:15
    
For numpy, you need print numpy.version.version. –  daviewales May 29 at 7:15
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.