-
Ubuntu22.04 에 Python 구 버전(ex.3.8) 을 기본 버전으로 설정Today_I_Learned/Linux 2023. 6. 3. 19:01
Python
Linux에서 Defautl python version 을 바꿀 때
https://linux.how2shout.com/install-python-3-9-or-3-8-on-ubuntu-22-04-lts-jammy-jellyfish/
1. 원하는 version의 python 설치
1) Add PPA for Python old versions
- sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
2) Check Python Versions you want
- sudo apt-cache policy python(version)
3) Install Python
- sudo apt install python(version)
2. 원하는 Python version을 Default 로 설정
1) Python 설치 경로 확인
ls /usr/bin/python*
2) Symbolic Link 추가
sudo update-alternatives --install /usr/bin/python python3 /usr/bin/python3.8 3
Default 경로 명령어 타겟 경로 priority( 숫자가 클수록 우선순위 높음)
sudo update-alternatives --config →Default로 설정하고 싶은 Selection 번호 입력
3) 확인
python3 -V
'Today_I_Learned > Linux' 카테고리의 다른 글
[vi/vim] 드래그 Drag, 복사, 붙여 넣기, 삽입 (0) 2023.04.20 Ubuntu_server_20.04LTS 설치 시 Partition 나누기 (0) 2021.09.09 ubuntu-cloud.img 를 qemu로 실행하는 명령어 (0) 2021.08.19 qemu-img 사용법 (0) 2021.08.18 cloud-init으로 virtualbox vm password 초기화 (0) 2021.08.12 - sudo apt install software-properties-common