FreeBSD - メンテナンス・トラブルシュート - Python - python3.7 → python3.8

 クラウディア
1. 概要
2. /etc/make.conf 編集
3. アップグレード

1. 概要

 2021年5月3日のことです。

$ pkg version -vl "<"
python-3.7_3,2                     <   needs updating (index has 3.8_3,2)
 てなことになっておる。  アップグレードしますが・・・。

2. /etc/make.conf 編集


vi /etc/make.conf

DEFAULT_VERSIONS+=python=3.7 python3=3.7
 を書き換えます。

DEFAULT_VERSIONS+=python=3.8 python3=3.8

3. アップグレード


portupgrade -f python37 -o lang/python38
pkg set -o lang/python37:lang/python38
 2つ目のコマンドは

Change origin from lang/python37 to lang/python38 for python37-3.7.10? [y/N]:
 ときいてきますので、y Enter で応えます。

portupgrade -rR python
 オプションをきいてきますが、デフォルトのまま進めました。  これがまた

====> Compressing man pages (compress-man)
===>  Installing for python3-3_3
===>  Checking if python3 is already installed
===>   python3-3_3 is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of python3
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/python3
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/python
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20210503-99066-1rrnpr3 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=python-3.7_3,2 UPGRADE_PORT_VER=3.7_3,2 make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! lang/python (python-3.7_3,2)  (unknown build error)
 てなことになります。  これは前回で経験済。

vi /etc/make.conf
 で、いったん

DEFAULT_VERSIONS+=python=3.7 pythonr3=3.7
 をコメントアウトして

cd /usr/ports/lang/python3
make deinstall clean

vi /etc/make.conf
 コメントアウトしたものを復活させて

cd /usr/ports/lang/python38
make deinstall clean
make
make install
 もう一回。

portupgrade -rR python
 確認します。

$ pkg version -v | grep python
py37-dnspython-1.16.0              ?   orphaned: dns/py-dnspython
py37-python-docs-theme-2018.2      ?   orphaned: textproc/py-python-docs-theme
python-3.8_3,2                     =   up-to-date with index
python27-2.7.18_1                  =   up-to-date with index
python3-3_3                        =   up-to-date with index
python36-3.6.13                    =   up-to-date with index
python38-3.8.9                     =   up-to-date with index
 う~む。  「?」がついているものや、「python36」は、「make deinstall clean」した方がいいんかな・・・。  「?」がついているものは、「pkg delete」で十分なようです。  後は、他のパッケージのアップグレードの際、競合や衝突が発生する都度、対処していくしかないかな。
ハイスピードプランマイニングベース