OS환경 : Ubuntu Linux 20.04 (64bit)
에러 : E: Package 'python' has no installation candidate
apt-get install 명령으로 패키지 설치 시 발생하는 에러
1 2 3 4 5 6 7 8 9 10 11 | # apt-get install python Reading package lists... Done Building dependency tree Reading state information... Done Package python is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: python-is-python3 E: Package 'python' has no installation candidate |
해결 방법 : apt sources.list 파일 수정
설정 파일 백업
1 | # mv /etc/apt/sources.list /etc/apt/sources.list_bak |
설정 파일 수정
sources.list 파일에 아래 내용 삽입
1 2 3 4 | # vi /etc/apt/sources.list deb http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse |
또는
카카오 서버로 변경
1 2 3 4 | # vi /etc/apt/sources.list deb http://mirror.kakao.com/ubuntu focal-security main restricted deb http://mirror.kakao.com/ubuntu focal-security universe deb http://mirror.kakao.com/ubuntu focal-security multiverse |
수정 내용 반영(업데이트)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # apt-get update Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB] Get:2 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:4 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1019 kB] Get:5 http://archive.ubuntu.com/ubuntu bionic/main Translation-en [516 kB] Get:6 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [9184 B] Get:7 http://archive.ubuntu.com/ubuntu bionic/restricted Translation-en [3584 B] Get:8 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [8570 kB] Get:9 http://archive.ubuntu.com/ubuntu bionic/universe Translation-en [4941 kB] Get:10 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [151 kB] Get:11 http://archive.ubuntu.com/ubuntu bionic/multiverse Translation-en [108 kB] Get:12 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages [727 kB] Get:13 http://archive.ubuntu.com/ubuntu bionic-security/main Translation-en [230 kB] Get:14 http://archive.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [45.7 kB] Get:15 http://archive.ubuntu.com/ubuntu bionic-security/restricted Translation-en [11.4 kB] Get:16 http://archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [669 kB] Get:17 http://archive.ubuntu.com/ubuntu bionic-security/universe Translation-en [222 kB] Get:18 http://archive.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [7596 B] Get:19 http://archive.ubuntu.com/ubuntu bionic-security/multiverse Translation-en [2824 B] Get:20 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [951 kB] Get:21 http://archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [324 kB] Get:22 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [55.3 kB] Get:23 http://archive.ubuntu.com/ubuntu bionic-updates/restricted Translation-en [13.8 kB] Get:24 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1077 kB] Get:25 http://archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [335 kB] Get:26 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [15.7 kB] Get:27 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse Translation-en [6384 B] Fetched 20.4 MB in 8s (2713 kB/s) Reading package lists... Done |
apt-get install 명령 재실행
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | # apt-get install python Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libffi6 libncursesw5 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libreadline7 libtinfo5 python-minimal python2.7 python2.7-minimal Suggested packages: python-doc python-tk python2.7-doc binutils binfmt-support The following NEW packages will be installed: libffi6 libncursesw5 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libreadline7 libtinfo5 python python-minimal python2.7 python2.7-minimal 0 upgraded, 11 newly installed, 0 to remove and 4 not upgraded. Need to get 4307 kB of archives. After this operation, 18.2 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 libpython2.7-minimal amd64 2.7.17-1~18.04ubuntu1 [335 kB] Get:2 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 python2.7-minimal amd64 2.7.17-1~18.04ubuntu1 [1294 kB] Get:3 http://archive.ubuntu.com/ubuntu bionic/main amd64 python-minimal amd64 2.7.15~rc1-1 [28.1 kB] Get:4 http://archive.ubuntu.com/ubuntu bionic/main amd64 libffi6 amd64 3.2.1-8 [17.9 kB] Get:5 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libtinfo5 amd64 6.1-1ubuntu1.18.04 [80.3 kB] Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libncursesw5 amd64 6.1-1ubuntu1.18.04 [117 kB] Get:7 http://archive.ubuntu.com/ubuntu bionic/main amd64 libreadline7 amd64 7.0-3 [124 kB] Get:8 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 libpython2.7-stdlib amd64 2.7.17-1~18.04ubuntu1 [1915 kB] Get:9 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 python2.7 amd64 2.7.17-1~18.04ubuntu1 [248 kB] Get:10 http://archive.ubuntu.com/ubuntu bionic/main amd64 libpython-stdlib amd64 2.7.15~rc1-1 [7620 B] Get:11 http://archive.ubuntu.com/ubuntu bionic/main amd64 python amd64 2.7.15~rc1-1 [140 kB] Fetched 4307 kB in 24s (178 kB/s) Selecting previously unselected package libpython2.7-minimal:amd64. (Reading database ... 31836 files and directories currently installed.) Preparing to unpack .../0-libpython2.7-minimal_2.7.17-1~18.04ubuntu1_amd64.deb ... Unpacking libpython2.7-minimal:amd64 (2.7.17-1~18.04ubuntu1) ... Selecting previously unselected package python2.7-minimal. Preparing to unpack .../1-python2.7-minimal_2.7.17-1~18.04ubuntu1_amd64.deb ... Unpacking python2.7-minimal (2.7.17-1~18.04ubuntu1) ... Selecting previously unselected package python-minimal. Preparing to unpack .../2-python-minimal_2.7.15~rc1-1_amd64.deb ... Unpacking python-minimal (2.7.15~rc1-1) ... Selecting previously unselected package libffi6:amd64. Preparing to unpack .../3-libffi6_3.2.1-8_amd64.deb ... Unpacking libffi6:amd64 (3.2.1-8) ... Selecting previously unselected package libtinfo5:amd64. Preparing to unpack .../4-libtinfo5_6.1-1ubuntu1.18.04_amd64.deb ... Unpacking libtinfo5:amd64 (6.1-1ubuntu1.18.04) ... Selecting previously unselected package libncursesw5:amd64. Preparing to unpack .../5-libncursesw5_6.1-1ubuntu1.18.04_amd64.deb ... Unpacking libncursesw5:amd64 (6.1-1ubuntu1.18.04) ... Selecting previously unselected package libreadline7:amd64. Preparing to unpack .../6-libreadline7_7.0-3_amd64.deb ... Unpacking libreadline7:amd64 (7.0-3) ... Selecting previously unselected package libpython2.7-stdlib:amd64. Preparing to unpack .../7-libpython2.7-stdlib_2.7.17-1~18.04ubuntu1_amd64.deb ... Unpacking libpython2.7-stdlib:amd64 (2.7.17-1~18.04ubuntu1) ... Selecting previously unselected package python2.7. Preparing to unpack .../8-python2.7_2.7.17-1~18.04ubuntu1_amd64.deb ... Unpacking python2.7 (2.7.17-1~18.04ubuntu1) ... Selecting previously unselected package libpython-stdlib:amd64. Preparing to unpack .../9-libpython-stdlib_2.7.15~rc1-1_amd64.deb ... Unpacking libpython-stdlib:amd64 (2.7.15~rc1-1) ... Setting up libpython2.7-minimal:amd64 (2.7.17-1~18.04ubuntu1) ... Setting up python2.7-minimal (2.7.17-1~18.04ubuntu1) ... Linking and byte-compiling packages for runtime python2.7... Setting up python-minimal (2.7.15~rc1-1) ... Selecting previously unselected package python. (Reading database ... 32620 files and directories currently installed.) Preparing to unpack .../python_2.7.15~rc1-1_amd64.deb ... Unpacking python (2.7.15~rc1-1) ... Setting up libffi6:amd64 (3.2.1-8) ... Setting up libtinfo5:amd64 (6.1-1ubuntu1.18.04) ... Setting up libreadline7:amd64 (7.0-3) ... Setting up libncursesw5:amd64 (6.1-1ubuntu1.18.04) ... Setting up libpython2.7-stdlib:amd64 (2.7.17-1~18.04ubuntu1) ... Setting up libpython-stdlib:amd64 (2.7.15~rc1-1) ... Setting up python2.7 (2.7.17-1~18.04ubuntu1) ... Setting up python (2.7.15~rc1-1) ... Processing triggers for libc-bin (2.31-0ubuntu9) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for mime-support (3.64ubuntu1) ... |
정상적으로 설치됨
원인 : apt source 문제
apt 패키지를 다운받아오는 저장소 문제
참조 : https://idchowto.com/?p=46187