Skip to content
Search Fedora

    Browse this documentation

    Fedora toolchain and multiple versions

    Fedora moves fast, and so does its toolchain: needing several language versions on one machine is normal. This page covers organisation only — what travels with the system and what must go into an isolated environment. For hands-on steps see Isolated development with Toolbox and Fedora containers and rootless.

    The system Python constraint: follow the official Python chapter

    Section titled “The system Python constraint: follow the official Python chapter”

    Fedora’s Python packaging and version policy is set by the Python chapter of the official Packaging Guidelines: the constraints on the system Python, packaging and naming rules, and how multiple versions coexist all follow that chapter — which is itself part of the rpm packaging specification.

    The constraint does not mean “you cannot upgrade Python”; it means first work out which Python you intend to touch:

    • The system Python is part of the distribution and system tools depend on it; changing it brings no benefit to your project and all the risk.
    • The project runtime is what you actually control: put it in an isolated environment and leave the system copy alone.
    • The basis is not a blog: naming, dependencies and module paths are all specified in that official chapter; organise multiple versions the way it describes and maintainability follows.

    Package management and repositories: the foundation of the toolchain

    Section titled “Package management and repositories: the foundation of the toolchain”

    The official Quick Docs provide package management and repository docs under Adding and managing software: from everyday dnf usage to adding and removing Fedora repositories, they are the prerequisite knowledge for any toolchain work.

    Before installing a toolchain, separate three things:

    The same “install a new version” need has three levels, with isolation strength and cost rising in order:

    ApproachScope of isolationCost
    The language’s own virtual environmentdependencies onlyshares the interpreter and system libraries with the host
    Toolbx containera complete command-line environmentstill integrated with the host
    General containerthe image is the environmentyou carry builds and data management yourself
    • Only dependencies need isolating: when a per-project virtual environment (Python venv, a Node version manager and so on) is enough, do not bring in anything heavier.
    • A whole toolchain needs isolating: Isolated development with Toolbox gives you an environment with common tools and documentation in a few commands.
    • Reproducibility and distribution: Fedora containers and rootless writes the environment into an image, at the cost of managing builds and volumes yourself.

    Habits from other distributions: alternatives and SCL

    Section titled “Habits from other distributions: alternatives and SCL”

    People coming from the EL family often switch system defaults with alternatives, or use SCL-style parallel software collections. In Fedora terms, do two things before deciding whether to use them:

    1. Find the mapping: what your need is called in the official docs and which chapter specifies it — for Python, the Packaging Guidelines chapter from the previous section.
    2. Work out the blast radius: alternatives changes the system-level default target, so every user and every service follows. Unless that is deliberate and you have a rollback ready, do not use it to satisfy “my project needs another version”.

    This page does not assume alternatives or SCL is the road you should take on Fedora. The only principle is: what can be solved by isolation should not be solved by system-level replacement — that is a judgement method, not an endorsement of any particular option.

    The value of an isolated environment is that it can be thrown away and rebuilt. For that sentence to hold, the environment must first be described:

    • Write it into the project: interpreter and dependency versions and required system libraries all go into version control (lock file or environment definition).
    • Name the environment: name containers or toolboxes by project; do not let a pile of default names accumulate — nobody dares delete them six months later.
    • One command to enter: after cloning the repository, a newcomer should be one command away from a usable toolchain.
    • Rebuild regularly: rebuild an environment when it goes stale; do not patch it by hand inside isolation — that is just replaying the host’s mess somewhere else.
    • “One global version in the system is simplest”: it saves time today and costs you the entanglement between system tools and project dependencies.
    • “A virtual environment is isolation”: it only isolates dependencies; the interpreter and system libraries stay shared with the host.
    • “Untrusted scripts are fine inside an isolated environment”: the official positioning of Toolbx carries an explicit warning; see Isolated development with Toolbox.
    • “Copying a tutorial from another distribution is fine”: packaging rules are written per distribution; copying across distributions usually trips on naming and path rules.

    Three levels in practice (measured on F45)

    Section titled “Three levels in practice (measured on F45)”

    The same “I need another version” has three implementations. First see what the system has:

    Terminal window
    python3 --version
    rpm -q python3
    dnf repoquery --whatprovides 'python3.*' | head -3

    Level one: the language’s own virtual environment (dependencies only)

    Terminal window
    python3 -m venv ~/venvs/web
    source ~/venvs/web/bin/activate
    pip install -r requirements.txt
    deactivate

    Level two: a Toolbx container (the whole toolchain)

    Terminal window
    sudo dnf install toolbox
    toolbox create --container proj --assumeyes
    toolbox run --container proj python3 --version
    Fedora release 45 (Forty Five)

    Level three: the image is the environment

    Terminal window
    podman run --rm -v $PWD:/src:Z -w /src registry.fedoraproject.org/fedora-minimal:45 \
    sh -c 'dnf -y install python3-pip >/dev/null && python3 --version'

    In one line: missing dependencies → venv; missing a whole toolchain → Toolbx; delivering to others → an image.

    Do not solve versions with system-level replacement

    Section titled “Do not solve versions with system-level replacement”
    Terminal window
    sudo dnf install <another version>

    On Fedora that usually means replacing a system package: swap python3 and every system tool depending on it changes too. Unless you are deliberately migrating, that is not “installing a new version” but “replacing part of the system”.

    Test it with rpm -q --whatrequires python3 | wc -l — the bigger the number, the less you should touch it.