Python 3.6を削除できません。

Python 3.6を削除できません。

AzureでUbuntuを実行する仮想マシンを設定しました。

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:    16.04
Codename:   xenial

次に、Pythonのバイナリとバージョンを確認します。

$ which python
/usr/bin/python
$ python --version
Python 2.7.12
$ which python3
/usr/bin/python3
$ python3 --version
Python 3.5.2

Python 3.6をインストールしました

$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt-get update
$ sudo apt-get install python3.6

それから私は削除しました

$ sudo apt-get remove python3.6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libpython3.6-minimal libpython3.6-stdlib python3.6-minimal
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  python3.6
0 upgraded, 0 newly installed, 1 to remove and 6 not upgraded.
After this operation, 334 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 85368 files and directories currently installed.)
Removing python3.6 (3.6.8-1+xenial1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...

しかし、それでもインストールされます。

$ python3 --version
Python 3.5.2
$ python3.6 --version
Python 3.6.8

apt-getまだインストールされていないため、削除することはできません。

$ sudo apt-get remove python3.6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'python3.6' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  libpython3.6-minimal libpython3.6-stdlib python3.6-minimal
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.

どうすれば削除できますか?

ベストアンサー1

同じことを試したり他の人が試したい場合は、UbuntuからPython3をこのように削除しないでください。 Ubuntuデスクトップ全体が削除されることがあります。問題がある場合:

sudo apt-get install python3-all
sudo apt-get install gnome-terminal
sudo apt-get install ubuntu-desktop

端末を開くことができない場合は、Ctrl++Altを押してF1シェルをインポートして同じコマンドを実行してください。

おすすめ記事