Getting correct версия of the package python-django

I have python-django package installed on Ubuntu 14.04. However the версия numbers I get with dpkg -s and django-admin --version does not матч.

$ dpkg -s python-django | grep Version
Version: 1.6.1-2ubuntu0.11

$ django-admin --version
1.9

$ lsb_release -d
Description:    Ubuntu 14.04.3 LTS

I want to understand why that's the вступил в брак. Because I have another Ubuntu and it also ты существуешь python-django package on it and версия numbers матч.

$ dpkg -s python-django | grep Version
Version: 1.7.6-1ubuntu2.3

$ django-admin --version
1.7.6

$ lsb_release -d
Description:    Ubuntu 15.04

In в nutshell, my question is:

Нормальный Is is to have different outputs for dpkg -s and django-admin --version , which one is the correct версия?

And, if it is not нормальный, how хан I fix it?

Edit: output of command -v django-admin on Trusty machine

$ command -v django-admin
/usr/local/bin/django-admin

Edit: output of /usr/bin/django-admin --version on Trusty machine

$ /usr/bin/django-admin --version
1.9

Edit: output of apt-cache policy python-django on Trusty machine

$ apt-cache policy python-django
python-django:
  Installed: 1.6.1-2ubuntu0.11
  Candidate: 1.6.1-2ubuntu0.11
  Version table:
 *** 1.6.1-2ubuntu0.11 0
        500 http://tr.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1.6.1-2 0
        500 http://tr.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
1
задан 31 December 2015 в 14:39

1 ответ

Да, нормально при установке дополнительной версии без диспетчера пакетов как в случае.

путь /usr/local/bin имеет более высокий приоритет как путь /usr/bin. По этой причине команда

django-admin --version

показывает другую версию, чем

dpkg -s python-django | grep Version

Для принуждения использования версии 1.6, необходимо использовать полный путь

/usr/bin/django-admin --version

и потому что я не знаю то, что еще Вы адаптировали

sudo apt-get install --reinstall python-django
0
ответ дан 29 September 2019 в 17:40

Другие вопросы по тегам:

Похожие вопросы: