从python 3.4.1源手动安装是否会正确覆盖Ubuntu现有的python 3.4安装?

时间:2014-08-30 19:36:46

标签: python-3.x apt-get

我在Ubuntu上安装了带有“apt-get install”的python3.4。从源代码手动安装python 3.4.1会正确覆盖python 3.3的apt-get安装吗?

例如,Ubuntu安装在/usr/lib/python3.4中有文件,而https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tar.xz中的安装程序在其他几个地方存放文件。

如何正确删除apt-get安装?或者源安装是否会正确覆盖旧目录?

1 个答案:

答案 0 :(得分:0)

使用apt-get remove (package)删除。 hello的示例:

# sudo apt-get remove hello

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  hello
0 upgraded, 0 newly installed, 1 to remove and 245 not upgraded.
After this operation, 111 kB disk space will be freed.
Do you want to continue [Y/n]? 
(Reading database ... 211551 files and directories currently installed.)
Removing hello ...
Processing triggers for man-db ...
Processing triggers for install-info ...

获取具有正确路径的源代码 - 它已被Debianized(对于Ubuntu也是)

$ apt-get source hello

进入源代码并为其构建二进制包

$ cd hello*
$ fakeroot debian/rules binary

然后安装新制作的二进制包:

$ sudo dpkg -i ../hello*deb

Selecting previously unselected package hello.
(Reading database ... 211546 files and directories currently installed.)
Unpacking hello (from ../hello_2.8-4_amd64.deb) ...
Setting up hello (2.8-4) ...
Processing triggers for install-info ...
Processing triggers for man-db ...

或者,从这里安装Ubuntu(Debian)Python 3.4.1二进制包:https://packages.debian.org/search?keywords=python3