본문 바로가기

IT/unix_unixlike

cent os 7.9 python 3.9 설치하기

반응형

https://linuxtut.com/en/592483c7625e881d771f/

 

Install Python 3.8 on CentOS 7 (SCL)

Python, centos7, scl

linuxtut.com

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

+ 폐쇄망에서 사용방법

https://finai.tistory.com/2

 

폐쇄망에서의 redhat(RHEL) 혹은 CentOS rpm /yum 패키지 설치 방법

 Linux에서 과거 패키지 설치는 소스코드를 받아서 직접 gcc/g++로 컴파일하는 형태로 많이 설치하였다. 그러다가 rpm(redhat package manager)이 등장해서 조금더 편하게 설치하게 된 것이 yum이나 apt같은

finai.tistory.com

 

+ 소스파일로 설치하기

 

How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 34/33 – TecAdmin

 

How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 34/33

Recently, the Python development team released the latest stable version of Python 3.9. You can download it from its official pages. The new version comes with multiple new features and security updates. This tutorial will help you to install Python 3.9 on

tecadmin.net

폐쇄망에서는 사전 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 에 모두 설치된다!

반응형