【问题标题】:Will a manual installation from python 3.4.1 source properly overwrite Ubuntu's existing python 3.4 install?从 python 3.4.1 源手动安装会正确覆盖 Ubuntu 现有的 python 3.4 安装吗?
【发布时间】:2014-08-31 07:01:35
【问题描述】:

我在 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 安装?或者源安装会正确覆盖旧目录?

【问题讨论】:

    标签: python-3.x apt-get


    【解决方案1】:

    使用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 ...
    

    获取具有正确路径的源代码——它已被 Debian 化(也适用于 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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-13
      • 2018-08-30
      • 1970-01-01
      • 2015-07-12
      • 2017-05-09
      相关资源
      最近更新 更多