4
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ubuntu 20.04 に Python 3.8 をインストール(OS標準)

Last updated at Posted at 2020-04-25

はじめに

Ubuntu 20.04にPython 3.8をインストール

LOG

インストール

# cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

# apt update; apt install -y python3
... 略

各種確認

# which python{,2,3}
/usr/bin/python3

# ll /usr/bin/python*
lrwxrwxrwx. 1 root root       9 Mar 13 12:20 /usr/bin/python3 -> python3.8*
-rwxr-xr-x. 1 root root 5457568 Mar 13 10:14 /usr/bin/python3.8*

# python3 -V
Python 3.8.2

# apt show python3
Package: python3
Version: 3.8.2-0ubuntu2
Priority: important
Section: python
Source: python3-defaults
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Matthias Klose <doko@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 194 kB
Provides: python3-profiler
Pre-Depends: python3-minimal (= 3.8.2-0ubuntu2)
Depends: python3.8 (>= 3.8.2-1~), libpython3-stdlib (= 3.8.2-0ubuntu2)
Suggests: python3-doc (>= 3.8.2-0ubuntu2), python3-tk (>= 3.8.2-1~), python3-venv (>= 3.8.2-0ubuntu2)
Replaces: python3-minimal (<< 3.1.2-2)
Homepage: https://www.python.org/
Task: minimal, ubuntu-core
Download-Size: 47.6 kB
APT-Manual-Installed: yes
APT-Sources: http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
Description: interactive high-level object-oriented language (default python3 version)

補足

Ubuntu20.04にPython3.9が出てきそうなので、 apt install -y python3.8 とやるほうが確実かもしれない
ただしその場合 /usr/bin/python3 は作成されないようなので注意。

4
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?