centos에서 freeze를 사용할 일이 생겼는데 2.7버전부터 지원하는 것을 알았다.

centos에는 2.6버전이 설치되어 있고 버전업을 시켜줘보자.


-------------- python 2.7 설치하고 변경하기 ------------------

gcc 설치

# yum install gcc openssl-devel bzip2-devel

# cd /usr/src

# wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz

# tar xzf Python-2.7.14.tgz

# cd Python-2.7.15

# ./configure --enable-optimizations

# make altinstall



버전 확인

# /usr/local/bin/python2.7 -V


Python 2.7.15


pip install

# curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"

# python2.7 get-pip.py


원래는 python 2.6.6


#vi /etc/id.so.conf.d/python.conf에 /usr/local/lib로 내용 추가 ((없어도 되는거 같다))


# mv /usr/bin/python /usr/bin/python_bak

# cp /usr/local/bin/python2.7 /usr/bin/python

python -V로 확인 


-----끝-------


이 아니다

yum 에러가 난다. ㅠㅠ 

기존에 2.6버전으로 연동이 되어 있었던 것 같다. 수정해주자.


# vi /usr/bin/yum

기존 버전은 2.6 이었다.

#!/usr/bin/python -> #!/usr/bin/python2.6

wq!

cp /usr/bin/yum /usr/bin/yum_old

sed -i 's/\/usr\/bin\/python/\/usr\/bin\/python2.6/g' /usr/bin/yum

diff /usr/bin/yum_old /usr/bin/yum

1c1

< #!/usr/bin/python

---

> #!/Sr/bin/python2.6

여기서 왜 자꾸 에러가 나는지 나는 잘 모르겠지만....

그냥 수정..

vi /usr/bin/yum

#!/Sr/bin/python2.6 -> #!/usr/bin/python2.6 으로 수정하니까

# yum이 잘 먹는다.



'Server > centos' 카테고리의 다른 글

/etc/inittab runlevel 수정 확인  (0) 2019.01.20
윈도와 리눅스 nfs 연동하기.  (0) 2018.10.10
centos 설치 시 yum update 안될 때  (0) 2018.07.31

+ Recent posts