python 3.7 에서 mariadb를 설치하려고 하면 apt_pkg 에러가 발생된다
Shell
1 2 3 4 5 6 |
Traceback (most recent call last): File "/usr/bin/add-apt-repository", line 12, in <module> from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 28, in <module> import apt_pkg ModuleNotFoundError: No module named 'apt_pkg' |
원인은 기본 python 버전이 3.6인데 이것을 3.7로 변경하면서 에러가 발생한것이다
다시 원래되로 python3 버전을 o/s 기본 환경이 3.6에 맞게 수동으로 변경
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 |
jsh@jsh:~$ sudo update-alternatives --config python3 There are 2 choices for the alternative python3 (providing /usr/bin/python3). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/python3.7 2 auto mode 1 /usr/bin/python3.6 1 manual mode 2 /usr/bin/python3.7 2 manual mode Press <enter> to keep the current choice[*], or type selection number: 1 update-alternatives: using /usr/bin/python3.6 to provide /usr/bin/python3 (python3) in manual mode jsh@jsh:~$ python3 -V Python 3.6.9 |
이제 mariadb를 다시 설치 진행 정상 진행
Shell
1 2 3 4 5 6 7 8 9 10 11 12 |
jsh@jsh:~$ sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://ams2.mirrors.digitalocean.com/mariadb/repo/10.4/ubuntu focal main' Get:1 http://ams2.mirrors.digitalocean.com/mariadb/repo/10.4/ubuntu focal InRelease [6,264 B] Hit:2 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease Get:4 http://ams2.mirrors.digitalocean.com/mariadb/repo/10.4/ubuntu focal/main ppc64el Packages [15.8 kB] Hit:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease Get:6 http://ams2.mirrors.digitalocean.com/mariadb/repo/10.4/ubuntu focal/main amd64 Packages [16.3 kB] Get:7 http://ams2.mirrors.digitalocean.com/mariadb/repo/10.4/ubuntu focal/main arm64 Packages [15.8 kB] Hit:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease Hit:9 http://archive.ubuntu.com/ubuntu bionic-security InRelease Fetched 54.1 kB in 2s (32.0 kB/s) Reading package lists... Done |