[英]apt-get installing older version of packages (Ubuntu)
I'm trying to install pip
and virtualenv
on a server (running Ubuntu 12.04.4 LTS) on which I have access, but I can only do it with sudo apt-get install
(school politics). 我正在尝试在具有访问权限的服务器(运行Ubuntu 12.04.4 LTS)上安装
pip
和virtualenv
,但是我只能使用sudo apt-get install
(学校政策) sudo apt-get install
。 The problem is that althought I have run the sudo apt-get update
command to update the packages list, I think it keeps installing old ones. 问题是,尽管我已经运行
sudo apt-get update
命令来更新软件包列表,但我认为它一直在安装旧软件包。 After doing sudo apt-get install python-pip python-virtualenv
, I do pip --version
on which I get the 1.0
, and virtualenv --version
on which I get 1.7.1.2
. 在执行
sudo apt-get install python-pip python-virtualenv
,我执行pip --version
获得1.0
,以及virtualenv --version
获得1.7.1.2
。 These two version are quite old ( pip
is already in 1.5.5
and virtualenv
in 1.11.5
). 这两个版本相当老(
pip
在1.5.5
已经存在, virtualenv
在1.11.5
已经1.11.5
)。 I read that the problem is that the packages list is not up-to-date, but the command sudo apt-get update
should solve this, but I guess no. 我读到的问题是软件包列表不是最新的,但是命令
sudo apt-get update
应该可以解决此问题,但我想没有。 How can I solve this? 我该如何解决? Thanks a lot!
非常感谢!
apt-get update
updates packages from Ubuntu package catalog, which has nothing to do with mainstream versions. apt-get update
从Ubuntu软件包目录中更新软件包,与主流版本无关。
LTS
in Ubuntu stands for Long Term Support. Ubuntu中的
LTS
表示长期支持。 Which means that after a certain period in time they will only release security-related bugfixes to the packages. 这意味着在一段时间后,他们将只向软件包发布与安全相关的错误修正。 In general, major version of packages will not change inside of a major Ubuntu release, to make sure backwards-compatibility is kept.
通常,软件包的主要版本在Ubuntu的主要发行版本中不会更改,以确保保持向后兼容。
So if then only thing you can do is apt-get update
, you have 2 options: 因此,如果您只能做
apt-get update
,那么您有2个选择:
.deb
format and install. .deb
格式下载并安装。 If you really need to use the latest stable versions of Python packages, then do not use apt-get
for installing Python packages and use pip instead. 如果您确实需要使用Python软件包的最新稳定版本,请不要使用
apt-get
来安装Python软件包,而应使用pip。 If you would use apt-get
and later install the same packages by means of pip
or (better not) easy_install
or setup.py
, you are likely to run into version conflicts wondering, why your python based commands are of unexpected versions, or even worse, why they do not work at all. 如果要使用
apt-get
并稍后通过pip
或(最好不要使用) easy_install
或setup.py
安装相同的软件包,您可能会遇到版本冲突,想知道为什么您的基于python的命令具有意外版本,甚至更糟糕的是,为什么它们根本不起作用。
I try to follow this pattern: 我尝试遵循以下模式:
Using instructions from here: http://pip.readthedocs.org/en/latest/installing.html find get-pip.py
script, download it and run as python script. 使用此处的说明: http :
get-pip.py
查找get-pip.py
脚本,下载该脚本并以python脚本运行。
$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python get-pip.py
$ rm get-pip.py
virtualenv
system wide virtualenv
this shall be as easy as: 这应该很简单:
$ sudo pip install virtualenv
$ sudo pip install virtualenvwrapper
and follow instructions for configuring it. 并按照说明进行配置。
This shall prevent conflicts between various versions of packages. 这将防止不同版本的软件包之间发生冲突。
You are free to update particular virtualenvs as you need one by one independently. 您可以自由地独立更新一个特定的虚拟环境。
There are method how to speed up repeated installation of packages, what comes handy if you get used using virtualenv often. 有一些方法可以加快重复安装软件包的速度,如果您经常使用virtualenv会很方便。 For details see my answer: https://stackoverflow.com/a/18520729/346478
有关详细信息,请参阅我的答案: https : //stackoverflow.com/a/18520729/346478
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.