redhat 搭建本地yum倉庫並安裝python3
阿新 • • 發佈:2018-12-14
1.掛載光碟
[[email protected] yum.repos.d]# mount /dev/sr0 /mnt
mount: /dev/sr0 is write-protected, mounting read-only
2.配置本地原始檔
[[email protected] ~]# cd /etc/yum.repos.d [[email protected] yum.repos.d]# vim base.repo [base] #源標識 name=base #源名稱 baseurl=file:///mnt #路徑 enable=1 #啟用 gpgcheck=0 #不校驗
3.安裝與解除安裝軟體
yum install 包名 -y 安裝 yum remove 包名 -y 解除安裝
4.安裝python3所需的依賴環境
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel gcc gcc-c++ zlib*
5.下載所需的python包
[[email protected] ~]# wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
6.解壓並安裝
[ [email protected] ~]# tar -xvf Python-3.6.0.tgz
[[email protected] ~]# mkdir /usr/local/python3
[[email protected] ~]# cd Python-3.6.0/
[[email protected] Python-3.6.0]# ./configure --prefix=/usr/local/python3
[[email protected] Python-3.6.0]# make
[[email protected] Python-3.6.0]# make install
[ [email protected] ~]# ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3
[[email protected] bin]# ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
7.檢視
[[email protected] bin]# python3
Python 3.6.0 (default, Aug 15 2018, 02:31:32)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>>
>>>