centos下源碼安裝python3wget --no-check-certificate https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgzpython3的環境依賴安裝yum -y install xz tar gcc make tk- ...
centos下源碼安裝python3
wget --no-check-certificate https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz
python3的環境依賴安裝
yum -y install xz tar gcc make tk-devel wget sqlite-devel zlib-devel readline-devel openssl-devel curl-devel tk-devel gdbm-devel xz-devel bzip2-devel
編譯
./configure --prefix=/usr/local/python3
make make install
修改環境變數
echo 'export PATH=/usr/local/python3/bin:$PATH' >> /etc/profile
source /etc/profile
或者建立軟連接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
下載pip3
wget --no-check-certificate https://github.com/pypa/pip/archive/9.0.1.tar.gz
解壓
tar -zvxf 9.0.1.tar.gz
cd pip-9.0.1/
python3 setup.py install
建立軟連接
ln -s /usr/local/python3/bin/pip /usr/bin/pip3
mysql安裝
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum -y install mysql mysql-server mysql-devel
mongodb安裝
創建yum源文件:
vi /etc/yum.repos.d/mongodb-org.repo
添加如下配置
[mongodb-org]
name=MongoDB Repository
baseurl=http://mirrors.aliyun.com/mongodb/yum/redhat/7Server/mongodb-org/3.2/x86_64/
gpgcheck=0
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
安裝之前先更新所有包 :yum update (可選操作)
安裝命令:
yum -y install mongodb-org
卸載MongoDB
sudo yum erase $(rpm -qa | grep mongodb-org) #卸載MongoDB
sudo rm -r /var/log/mongodb #刪除日誌文件
sudo rm -r /var/lib/mongo #刪除數據文件
docker 安裝
卸載老版本
sudo yum remove docker \
docker-common \
docker-selinux \
docker-engine
設定數據倉庫配置
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
安裝命令
sudo yum install docker-ce
開啟服務
sudo systemctl start docker
sudo docker run hello-world
需要阿裡雲賬號,沒有請先註冊
配置阿裡雲鏡像加速
{
"registry-mirrors": ["https://xxxxx.mirror.aliyuncs.com"]
}