FreeBSD の日毎セキュリティーレポートに、Python2.7 系のサポートが 2020/12/31 で終了すると記述されて届くにようになりました。(まだ約1年ありますが)
Checking for packages with security vulnerabilities: Database fetched: Sun Jan 12 03:20:51 JST 2020 python27-2.7.17_1: Tag: expiration_date Value: 2020-12-31 python27-2.7.17_1: Tag: deprecated Value: EOLed upstream
何かのパッケージとの依存関係でインストールされているものと思いますが、Pythonなんて何使っているのか分かりません。リストを取ってみると、、、、
# pkg info|grep py py36-ply-3.11 Python Lex-Yacc py36-setuptools-41.4.0_1 Python packages installer py37-ply-3.11 Python Lex-Yacc py37-setuptools-41.4.0_1 Python packages installer python27-2.7.17_1 Interpreted object-oriented programming language python3-3_3 The "meta-port" for version 3 of the Python interpreter python36-3.6.9_3 Interpreted object-oriented programming language python37-3.7.6 Interpreted object-oriented programming language
python だらけ。2.7, 3.6, 3.7 が入っています。全部依存関係でしょう。
UPDATING を検索してみると、
20191216:
AFFECTS: users of python
AUTHOR: antoine@FreeBSD.org
Default version of python3 and python was switched to 3.7.
とありました。じゃあ、2.7なんてもう要りませんね。
じゃあ、消しましょう。と、pkg delete python27 と実行。
# pkg delete python27
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 2 packages (of 0 packages in the universe):
Installed packages to be REMOVED:
python27-2.7.17_1
llvm60-6.0.1_7
Number of packages to be removed: 2
The operation will free 705 MiB.
Proceed with deinstalling packages? [y/N]:
ここで、LLVMとの依存関係でインストールされていたと判明。llvm も依存関係で勝手に入るパッケージなので、消してしまいます。しかし、llvm自体も pkg upgrade で勝手に入るパッケージなので、また python2.7 を入れられてしまうかも知れませんが。
そして、python 3.6 系もついでに消しちゃいましょう。
# pkg delete python36 Checking integrity... done (0 conflicting) Deinstallation has been requested for the following 3 packages (of 0 packages in the universe): Installed packages to be REMOVED: python36-3.6.9_3 py36-setuptools-41.4.0_1 py36-ply-3.11 Number of packages to be removed: 3 The operation will free 106 MiB. Proceed with deinstalling packages? [y/N]: y [1/3] Deinstalling py36-ply-3.11... [1/3] Deleting files for py36-ply-3.11: 100% [2/3] Deinstalling py36-setuptools-41.4.0_1... [2/3] Deleting files for py36-setuptools-41.4.0_1: 100% [3/3] Deinstalling python36-3.6.9_3... [3/3] Deleting files for python36-3.6.9_3: 100%
こちらは python以外との依存関係もなく無事に消去完了。
こういうメンテナンスは、あとからサーバーの動作に影響が出る場合があるので、ちょっと心配。モニターしておきましょう。