0

I was automating some packages requirements with ansible and wanted to freeze their version and I found out I am not sure which version is being used by the system.

The debian apt-get commands give a different value than the installed command invoked itself.

$ python -V
Python 2.7.6
$ dpkg -s python | grep Version
Version: 2.7.5-5ubuntu3
$ apt-cache policy python | grep Installed
  Installed: 2.7.5-5ubuntu3
$ which python
/usr/bin/python
$ echo $PATH
/home/<MY_USERNAME>/.gvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

I don't think there's any $PATH issue like getting a different python command from stuff like anaconda (infact that's not installed in the system). The $PATH environment variable seems ok.

I can not get why that 2.7.6 / 2.7.5 mismatch?

My OS/distribution version:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty
TPPZ
  • 101
  • 2

1 Answers1

0

python2.7 executable is actually in python2.7-minimal package, and python just has (or sets) the symlink that points to the executable. python package does not necessarily have the same version as it is built from different source code package (python-defaults).

J.J. Hakala
  • 101
  • 3
  • Sorry I am not getting what's the relationship between packages `python-defaults` and `python`, when you say "packages" you mean `.deb` packages or just a general definition for a "source code package"? Here they use "source package" https://packages.debian.org/source/jessie/python-defaults and I find a bit confusing getting a clear picture of the graph of dependency relationships – TPPZ Jun 06 '17 at 10:44