Solved Where can I find the current default python version before installing FreeBSD?

Hello,

I'd like to know where I can reliably find this information without needing an already installed FreeBSD. I'd like to check the "default" python version for any current FreeBSD version (e.g. 13.4 or 14.3).
So far, it seems to be 3.11, because several posts mention this on this forum, but looking for that information on the forum does not look like a good way to find it, not sure it is up to date, for instance.

I have also checked fresh ports: https://www.freshports.org/lang/python3/ Can I rely on the version number provided in "Runtime dependencies:"?

Is there a way to see the contents of /usr/ports/UPDATING from a web site, for instance? I think it contains exactly the information I am looking for.

Thanks!
 
I'd like to check the "default" python version for any current FreeBSD version (e.g. 13.4 or 14.3).
All versions of FreeBSD use the one and same ports tree. Thus they'll have the same versions of third party software (ports/packages) available to them. Only a small fraction of ports require a specified minimal version of FreeBSD, graphics/drm-66-kmod is a prime example of this.

The best 'source' to look for specific defaults (like Python, Perl, PHP, etc) is ${ports_tree}/Mk/bsd.default-versions.mk.

And there are various sources you can view the ports tree on, with a web interface.

You can also git clone the ports tree and browse it locally, even on Windows.
 
Thank you for your valuable answers!

I have another question yet, because I have noticed there is lang/python port, which seems to point to 3.9 version. Does it mean that, if I install python, I get 3.9, but if I install python3, I get the 3.11?
As far as I understood, lang/python does depend on lang/python3 and lang/python3 would install python 3.11 because it is the default version. lang/python is a meta-port to install a binary named directly python for convenience whereas lang/python3 would install a binary called python3.
 
As far as I understood, lang/python does depend on lang/python3 and lang/python3 would install python 3.11 because it is the default version. lang/python is a meta-port to install a binary named directly python for convenience whereas lang/python3 would install a binary called python3.
OK, this is more what could be expected. I see that lang/python depends on lang/python3, but lang/python3.9 is also mentioned, this is a bit disturbing. I suppose there must be a reason.
 
OK, this is more what could be expected. I see that lang/python depends on lang/python3, but lang/python3.9 is also mentioned, this is a bit disturbing. I suppose there must be a reason.
Because the ports tree currently supports versions 3.9, 3.10, 3.11, and 3.12. The meta-port/package is default to depend and build with 3.11. But as a ports user, you can change the default to be any of those versions. Nothing disturbing about choices.
 
Thank you for your valuable answers!

I have another question yet, because I have noticed there is lang/python port, which seems to point to 3.9 version. Does it mean that, if I install python, I get 3.9, [...]?
No.

On my 14.3R using latest and installing lang/python, I get version 3.11.13:
Rich (BB code):
[1-0] % doas pkg ins lang/python
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        python: 3.11_3,2 [FreeBSD]
        python3: 3_4 [FreeBSD]

Number of packages to be installed: 2

Proceed with this action? [y/N]: y
[1/2] Installing python3-3_4...
[1/2] Extracting python3-3_4: 100%
[2/2] Installing python-3.11_3,2...
[2/2] Extracting python-3.11_3,2: 100%
[2-0] % python --version
Python 3.11.13

However, the mentioned listing "3.9_3,2" in lang/python - Freshports is a bit of a mystery.
Because the ports tree currently supports versions 3.9, 3.10, 3.11, and 3.12.
For local ports builds, you can override default [...]
Given Mk/bsd.default-versions.mk - L139-L140:
Code:
# Possible values: 3.9, 3.10, 3.11, 3.12
PYTHON_DEFAULT?=	3.11
and lang/python/Makefile - L1-L5:
Rich (BB code):
PORTNAME=	python
PORTVERSION=	${PYTHON_DEFAULT}
PORTREVISION=	3
PORTEPOCH=	2
CATEGORIES=	lang python
it doesn't explain in my view why the Freshports' listing gets to "3.9_3,2"; I'm expecting something like 3.11_3,2 instead.

Or, what aspect of these make files do I not correctly interpret?

EDIT: The only thing that comes to mind is that Freshports runs for a large part on Python, and perhaps it runs on version 3.9. If that is the case Freshport might not have taken into consideration that it should extract the correct value pertaining to the fetched data from the FreeBSD remote server when it gets its package information data and perhaps, incorrectly extracts this value "sourced" in a shell statement that refers to the Freshport's runnning version of Python.
 
No.

On my 14.3R using latest and installing lang/python, I get version 3.11.13:
Rich (BB code):
[1-0] % doas pkg ins lang/python
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        python: 3.11_3,2 [FreeBSD]
        python3: 3_4 [FreeBSD]

Number of packages to be installed: 2

Proceed with this action? [y/N]: y
[1/2] Installing python3-3_4...
[1/2] Extracting python3-3_4: 100%
[2/2] Installing python-3.11_3,2...
[2/2] Extracting python-3.11_3,2: 100%
[2-0] % python --version
Python 3.11.13

However, the mentioned listing "3.9_3,2" in lang/python - Freshports is a bit of a mystery.


Given Mk/bsd.default-versions.mk - L139-L140:
Code:
# Possible values: 3.9, 3.10, 3.11, 3.12
PYTHON_DEFAULT?=    3.11
and lang/python/Makefile - L1-L5:
Rich (BB code):
PORTNAME=    python
PORTVERSION=    ${PYTHON_DEFAULT}
PORTREVISION=    3
PORTEPOCH=    2
CATEGORIES=    lang python
it doesn't explain in my view why the Freshports' listing gets to "3.9_3,2"; I'm expecting something like 3.11_3,2 instead.

Or, what aspect of these make files do I not correctly interpret?

EDIT: The only thing that comes to mind is that Freshports runs for a large part on Python, and perhaps it runs on version 3.9. If that is the case Freshport might not have taken into consideration that it should extract the correct value pertaining to the fetched data from the FreeBSD remote server when it gets its package information data and perhaps, incorrectly extracts this value "sourced" in a shell statement that refers to the Freshport's runnning version of Python.
Setting PYTHON_DEFAULT by users and/or each ports are discouraged and encouraged to use DEFAULT_VERSION+= syntax instead.
As seen in line 20 through 33 in Mk/bsd.default-versions.mk, each *_DEFAULT is intended to be set by Mk/bsd.default-versions.mk. Thus, the error message in line 25 exists.
 
I think Dan may have set DEFAULT_VERSIONS+= python=3.9 on his site, which is why it's showing the 3.9 version on lang/python. If you look at the package versions, those are all 3.11 except for the armv6 and powerpc architectures.

Code:
ABI	aarch64	amd64	armv6	armv7	i386	powerpc	powerpc64	powerpc64le
FreeBSD:13:latest	3.11_3,2	3.11_3,2	3.7_3,2	3.11_3,2	3.11_3,2	-	3.7_3,2	-
FreeBSD:13:quarterly	3.11_3,2	3.11_3,2	3.9_3,2	3.11_3,2	3.11_3,2	3.9_3,2	3.9_3,2	3.9_3,2
FreeBSD:14:latest	3.11_3,2	3.11_3,2	3.9_3,2	3.11_3,2	3.11_3,2	3.9_3,2	-	3.9_3,2
FreeBSD:14:quarterly	3.11_3,2	3.11_3,2	-	3.11_3,2	3.11_3,2	3.9_3,2	3.9_3,2	3.9_3,2
FreeBSD:15:latest	3.11_3,2	3.11_3,2	n/a	3.11_3,2	n/a	3.9_3,2	3.9_3,2	3.9_3,2
 
I don't use the latest versions,
cat make.conf
DEFAULT_VERSIONS+=ssl=openssl35
DEFAULT_VERSIONS+=pgsql=17
DEFAULT_VERSIONS+=php=8.3
DEFAULT_VERSIONS+=python=3.11
 
However, the mentioned listing "3.9_3,2" in lang/python - Freshports is a bit of a mystery.
Freshports is using latest quarterly branch. That's why it shows version 3.9

1753886650007.png
 
I think Dan may have set DEFAULT_VERSIONS+= python=3.9 on his site, which is why it's showing the 3.9 version on lang/python. If you look at the package versions, those are all 3.11 except for the armv6 and powerpc architectures.
I think what you are seeing is related to https://github.com/FreshPorts/freshports/issues/509 and https://github.com/FreshPorts/freshports/issues/47

The last commit to lang/python was in 2022. The version you see at https://www.freshports.org/lang/python/ is related to that. The issue explains why it's hard to do.
 
The simple way and answer:

Hello,

I'd like to know where I can reliably find this information without needing an already installed FreeBSD. I'd like to check the "default" python version for any current FreeBSD version (e.g. 13.4 or 14.3).
So far, it seems to be 3.11, because several posts mention this on this forum, but looking for that information on the forum does not look like a good way to find it, not sure it is up to date, for instance.

I have also checked fresh ports: https://www.freshports.org/lang/python3/ Can I rely on the version number provided in "Runtime dependencies:"?

Is there a way to see the contents of /usr/ports/UPDATING from a web site, for instance? I think it contains exactly the information I am looking for.

Thanks!
I reckon this is how I'd find that out, from a fresh copy of the ports tree. That

Code:
[20:55 mydev dvl /usr/ports/lang/python] % make -V PORTVERSION
3.11

But as mentioned above, I reckon looking at Mk/bsd.default-versions.mk may be less work for most people not running a ports tree.
 
The simple way and answer:


I reckon this is how I'd find that out, from a fresh copy of the ports tree. That

Code:
[20:55 mydev dvl /usr/ports/lang/python] % make -V PORTVERSION
3.11

But as mentioned above, I reckon looking at Mk/bsd.default-versions.mk may be less work for most people not running a ports tree.
That's interesting to know, but I needed this information because I had only an old FreeBSD running and needed to know before a major upgrade, which default python that would be after the upgrade, so without any console tools yet. Otherwise, this command looks very useful!
 
Freshports is using latest quarterly branch. That's why it shows version 3.9

View attachment 23253
FreshPorts runs in a jail and within that jails runs another jail. In the second jail is where we pull data from Makefiles - there are no packages installed in that jail.

Here's the main ingress jails:

Code:
[17:16 pro05 dvl ~] % ssh aws-1-ingress01
Last login: Wed Aug  6 21:15:40 2025 from aws-freshports1-ingress01
[21:16 aws-1-ingress01 dvl ~] % pkg info -x python
python-3.11_3,2
python3-3_4
python311-3.11.12_1
[21:16 aws-1-ingress01 dvl ~] % ps auwwx        
USER         PID %CPU %MEM   VSZ  RSS TT  STAT STARTED     TIME COMMAND
root        1950  0.0  0.0 13904 1480  -  SsJ   4Jul25  0:57.88 /usr/sbin/syslogd -s
root        2112  0.0  0.0 23864 1928  -  SsJ   4Jul25  0:06.66 sshd: /usr/sbin/sshd [listener] 0 of 10-100 startups (sshd)
root        2118  0.0  0.0 13944  576  -  SsJ   4Jul25  0:14.34 /usr/sbin/cron -s
nagios      2145  0.0  0.0 19596 1432  -  IsJ   4Jul25  0:26.66 /usr/local/sbin/nrpe -c /usr/local/etc/nrpe.cfg -d
ingress     3028  0.0  0.0 13856  528  -  IsJ   4Jul25  0:02.88 daemon: ingress[3029] (daemon)
ingress     3029  0.0  0.0 14408  464  -  SJ    4Jul25  1:35.29 /bin/sh /usr/local/libexec/freshports-service/ingress.sh
freshports  3063  0.0  0.0 13856  528  -  IsJ   4Jul25  0:01.26 daemon: freshports[3064] (daemon)
freshports  3064  0.0  0.0 14408 1100  -  SJ    4Jul25 10:00.51 /bin/sh /usr/local/libexec/freshports-service/freshports.sh
root       68777  0.0  0.1 24052 9648  -  SsJ  21:16    0:00.02 sshd: dvl [priv] (sshd)
dvl        68779  0.0  0.1 24052 9952  -  SJ   21:16    0:00.01 sshd: dvl@pts/0 (sshd)
ingress    68793  0.0  0.0 13740 1780  -  SCJ  21:16    0:00.00 sleep 3
freshports 68794  0.0  0.0 13740 1780  -  SCJ  21:16    0:00.00 sleep 3
dvl        68781  0.0  0.1 16104 5208  0  SsJ  21:16    0:00.03 -zsh (zsh)
dvl        68799  0.0  0.0 14480 2632  0  R+J  21:16    0:00.00 ps auwwx
[21:16 aws-1-ingress01 dvl ~] %

Well, pkg is installed, but that's it.

Code:
[21:18 aws-1-ingress01 dvl ~] % jls
   JID  IP Address      Hostname                      Path
     2  127.163.0.10    freshports                    /jails/freshports
[21:18 aws-1-ingress01 dvl ~] % sudo pkg -j freshports info
pkg-1.21.3                     Package manager
[21:18 aws-1-ingress01 dvl ~] %

All the data is pulled using scripts in the jail. See the make-* files below.

Code:
[21:18 aws-1-ingress01 dvl ~] % ls /jails/freshports
COPYRIGHT                      list-current-distfiles.sh      make-showconfig.sh             sbin/
bin/                           make-category-comment.sh       media/                         sys
boot/                          make-flavors-package-names.sh  mnt/                           tmp/
cat-descr.sh                   make-generate-plist.sh         net/                           usr/
dev/                           make-master-port-test.sh       proc/                          var/
etc/                           make-master-sites-all.sh       realpath.sh                    vars.sh
lib/                           make-pkg-message-in.sh         rescue/                        vars.sh.sample
libexec/                       make-port.sh                   root/

Those scripts are invoked via jexec so as to make the data obtained independent from the packages running on FreshPorts.

The FreshPorts blog has way more boring stuff to read about this. That blog serves mostly as documentation.[/CMD]
 
Back
Top