ubuntu: ubuntu14 LTS 安装python3.6.8

13 篇文章 0 订阅

目录

步骤:

1.配置好一个Ubuntu14 的服务器或虚拟机,这里选择的是VMware 虚拟机一枚

2.配置网络,配置IP基本信息,配置DNS

2.1 配置IP如下:

 2.2 配置域名解析

3.配置Ubuntu 源

3.1 原始的source.list 内容,当然也可以是其它的镜像源,自己替换

4.下载python 3.6.8源码,解压源码包进行编译

4.1 下载源码包

4.2 解压 tar -zxvf  Python-3.6.8.tgz

4.3 编译源码

5.配置虚拟环境

6.将python3.6.8环境做成一个离线环境,即插即用


步骤:

1.配置好一个Ubuntu14 的服务器或虚拟机,这里选择的是VMware 虚拟机一枚

2.配置网络,配置IP基本信息,配置DNS

2.1 配置IP如下:

root@ubuntu:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
	address 172.18.xx.xx
	netmask 255.255.0.0
	network 172.18.0.0
	broadcast 172.18.255.255
	gateway 172.18.0.1
    dns-servernames 114.114.114.114

 2.2 配置域名解析

root@ubuntu:~# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 114.114.114.114

3.配置Ubuntu 源

3.1 原始的source.list 内容,当然也可以是其它的镜像源,自己替换

root@ubuntu:~# cat /etc/apt/sources.list
# 

# deb cdrom:[Ubuntu-Server 14.04 LTS _Trusty Tahr_ - Release amd64 (20140416.2)]/ trusty main restricted

#deb cdrom:[Ubuntu-Server 14.04 LTS _Trusty Tahr_ - Release amd64 (20140416.2)]/ trusty main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://hk.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://hk.archive.ubuntu.com/ubuntu/ trusty main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://hk.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://hk.archive.ubuntu.com/ubuntu/ trusty-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://hk.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://hk.archive.ubuntu.com/ubuntu/ trusty universe
deb http://hk.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://hk.archive.ubuntu.com/ubuntu/ trusty-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://hk.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://hk.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://hk.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://hk.archive.ubuntu.com/ubuntu/ trusty-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://hk.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://hk.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu trusty partner
# deb-src http://archive.canonical.com/ubuntu trusty partner

## Uncomment the following two lines to add software from Ubuntu's
## 'extras' repository.
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
# deb http://extras.ubuntu.com/ubuntu trusty main
# deb-src http://extras.ubuntu.com/ubuntu trusty main

4.下载python 3.6.8源码,解压源码包进行编译

https://www.python.org/downloads/release/python-368/

4.1 下载源码包

4.2 解压 tar -zxvf  Python-3.6.8.tgz

4.3 编译源码
 

cd  Python-3.6.8
./configure --prefix=/usr/local/python368
make && make install

如果

如果 configure 错误

请安装 gcc  或者更新gcc

apt-get update
apt-get build-dep gcc

5.配置虚拟环境

 这个看个人情况

6.将python3.6.8环境做成一个离线环境,即插即用

将 /usr/local/python368 打成 tgz 然后导出来放到一个离线的ubuntu上,解压就可以直接使用了

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

千码君2016

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值