https://linuxtut.com/en/592483c7625e881d771f/
Repository registration
# yum install -y centos-release-scl
Installation
# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
# yum install -y rh-python38 which
# scl enable rh-python38 bash
+ 폐쇄망에서 사용방법
+ 소스파일로 설치하기
How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 34/33 – TecAdmin
폐쇄망에서는 사전 rpm 패키지를 다운받아서 옮겨서 설치한다.
1. 사전 패키지 다운로드
## gcc-c++ 추가
yumdownloader --resolve --destdir=. gcc gcc-c++ openssl-devel bzip2-devel libffi-devel zlib-devel
## 의존성까지 강제로 다운받기 ( 위와같이 하면 서버에 설치되어 있는것은 받지 않는다.)
PACKAGE=glibc-common
yum deplist $PACKAGE | grep provider | awk '{print $2}' | sort | uniq | grep -v $PACKAGE | sed ':a;N;$!ba;s/\n/ /g' | xargs yumdownloader
2. rpm 설치
다운받은 파일 위치에서 rpm 패키지 모두 설치
sudo rpm -Uvh *.rpm
3. python 3.9.12 다운로드
wget https://www.python.org/ftp/python/3.9.12/Python-3.9.12.tgz
4. 압축해제 후, configure, make
tar xzf Python-3.9.12.tgz
sudo ./configure --enable-optimizations
sudo make altinstall
5. /usr/local/bin 에 모두 설치된다!