[root@ea364aad1bb8 ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
指定安装目录场景
系统盘 ssd raid 1 lvm 512G
数据盘 sas raid 5 lvm 12TB
软件位置 /software
配置环境变量方便查询软件当前使用 .bashrc [根据个人需要设置环境变量]
vim ~/.bashrc
export softwarebin=/software/usr/bin
export softwaresbin=/software/usr/sbin
export softwarelocalbin=/software/usr/local/bin
export softwarelocalsbin=/software/usr/local/sbin
export PATH=$PATH:$softwarebin:$softwaresbin:$softwarelocalbin:$softwarelocalsbin;
- cat ~/.bashrc
[root@ea364aad1bb8 ~]# cat ~/.bashrc
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export softwarebin=/software/usr/bin
export softwaresbin=/software/usr/sbin
export softwarelocalbin=/software/usr/local/bin
export softwarelocalsbin=/software/usr/local/sbin
export PATH=$PATH:$softwarebin:$softwaresbin:$softwarelocalbin:$softwarelocalsbin;
- 生产环境不建议使用二进制安装。当前只演示 yum 、 rpm 包安装方式
yum update -y
yum clean all
yum -c /etc/yum.conf clean all
- yum 安装python3 指定安装位置 /software
yum -c /etc/yum.conf --installroot=/software --releasever=/ install python3
- 如提示缺少 libpython3.6m.so.1.0
cp /software/usr/lib64/libpython3.6m.so.1.0 /usr/lib64/
- 如没有pip3
python3 -m pip install whatever
- 添加快捷方式
which python3
which pip3
ln -s /software/usr/bin/python3 /usr/bin/python3
ln -s /software/bin/pip3 /usr/bin/pip3
yum 安装rpm 包当前以 iftop为例 iftop.rpm 包
下载
curl -k http://rpmfind.net/linux/epel/7/x86_64/Packages/i/iftop-1.0-0.21.pre4.el7.x86_64.rpm -o iftop-1.0-0.21.pre4.el7.x86_64.rpm
- 使用yum 安装
yum -c /etc/yum.conf --installroot=/software --releasever=/ localinstall ./iftop-1.0-0.21.pre4.el7.x86_64.rpm -y
- 添加快捷方式
which iftop
ln -s /software/usr/sbin/iftop /usr/sbin/