"conda: command not found" on ubuntu-latest (Ubuntu 26.04): the image has no Miniconda, and $CONDA is empty
GitHub's Ubuntu 26.04 runner image does not include Miniconda. The announcement of the image lists it as "removed from the Ubuntu 26.04 image due to maintenance reasons" (runner-images #14226), and the image's documentation still lists the CONDA environment variable, with no value (Ubuntu2604-Readme.md, image 20261026.180.1). On ubuntu-24.04, Miniconda 26.9.4 is in /usr/share/miniconda and CONDA points there. So a job that ubuntu-latest moves from 24.04 to 26.04 finds no conda where $CONDA used to lead.
What it looks like
In GitHub Actions, the step after the one that put $CONDA/bin on the PATH:
Run conda env update --file environment.yml --name base /home/runner/work/_temp/....sh: line 1: conda: command not found Error: Process completed with exit code 127.
In Azure Pipelines (truera/trulens #2979):
line 1: conda: command not found ##[error]Bash exited with code '127'.
A step that calls $CONDA/bin/conda directly, or sources $CONDA/etc/profile.d/conda.sh, fails with line 1: /bin/conda: No such file or directory or line 1: /etc/profile.d/conda.sh: No such file or directory: with CONDA empty, the path starts at /.
Who it hits
- GitHub's starter workflow "Python Package using Anaconda" (
ci/python-package-conda.ymlin actions/starter-workflows). It runs onubuntu-latestand adds conda to the PATH withecho $CONDA/bin >> $GITHUB_PATH. WithCONDAempty that adds/bin, which is on the PATH already, and the next step finds no conda. - Microsoft's "Run pipelines with Anaconda environments" for Azure Pipelines. Its Ubuntu tab adds conda with
echo "##vso[task.prependpath]$CONDA/bin". The announcement lists Azure DevOps as affected too: in trulens #2979, a conda job withvmImage: ubuntu-latestpassed on ubuntu-24.04 20261012.334.1 on October 20 and failed on ubuntu-26.04 20261018.168.1 the next day, while the pipeline's other jobs passed. - Any step that uses
$CONDA/bin/conda,$CONDA/bin/pythonor$CONDA/etc/profile.d/conda.sh. - Not
conda-incubator/setup-miniconda: with no installer input it uses the image's Miniconda throughCONDA, and whenCONDAis empty it downloads the latest Miniconda installer instead (its code, v4.1.0). The setup takes longer, but it does not depend on the image's copy.
Fix in GitHub Actions: let setup-miniconda install it
setup-miniconda sets CONDA and adds conda to the PATH for the steps after it (its code, v4.1.0), so the rest of the starter workflow can stay as it is:
- uses: conda-incubator/setup-miniconda@v4
with:
miniforge-version: latest
activate-environment: ""
- name: Add conda to system path
run: |
echo $CONDA/bin >> $GITHUB_PATH
miniforge-version: latest installs Miniforge, whose default channel is conda-forge. Leave it out to get the latest Miniconda, with Anaconda's defaults channel; an organization that Anaconda contacted about the licensing of Miniconda on its build agents asked the image maintainers to switch to Miniforge (runner-images #13433). activate-environment: "" skips the test environment that the action otherwise creates.
Fix in Azure Pipelines: install Miniforge in a step
- bash: |
curl -fsSLo "$(Agent.TempDirectory)/miniforge.sh" https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash "$(Agent.TempDirectory)/miniforge.sh" -b -p "$(Agent.TempDirectory)/miniforge3"
echo "##vso[task.prependpath]$(Agent.TempDirectory)/miniforge3/bin"
displayName: Install Miniforge
-b runs the installer without questions, and -p sets where it goes. Later steps that name $CONDA need this path instead. The same steps work in GitHub Actions with $RUNNER_TEMP and $GITHUB_PATH; there, echo "CONDA=$RUNNER_TEMP/miniforge3" >> "$GITHUB_ENV" also lets the steps that use $CONDA run unchanged.
Or stay on 24.04 for now
runs-on: ubuntu-24.04, or vmImage: ubuntu-24.04 in Azure Pipelines, keeps Miniconda 26.9.4 and CONDA=/usr/share/miniconda. It puts the change off until you move the job to 26.04.
Other tools the 26.04 image no longer has
The same table in the announcement removes more tools that 24.04 has:
- Julia (1.13.2 on 24.04): set it up with
julia-actions/setup-julia@v2. - fastlane (2.241.1 on 24.04): install it with Bundler from your
Gemfile, or withgem install fastlane. - The globally installed npm modules grunt, gulp, parcel, typescript, newman, webpack, webpack-cli and lerna: add them to
devDependenciesand run them withnpx, ornpm install -gthem in the job.
Telling it apart
echo "CONDA=[$CONDA]"printsCONDA=[].- The Set up job step (Initialize job in Azure Pipelines) shows the image
ubuntu-26.04. ls /usr/share/minicondafails, where onubuntu-24.04it lists the install.- The same workflow passes with
runs-on: ubuntu-24.04.
Other 26.04 failures
- setup-python's "The version ... with architecture 'x64' was not found": setup-python has no builds of Python 3.8 or 3.9 for 26.04, and only the newest patch releases of the others; ask for the minor version, or keep the old versions on
ubuntu-24.04. - "cannot enable executable stack" on Ubuntu 26.04: glibc 2.43 refuses to
dlopena library that asks for an executable stack, so Julia 1.10.0 to 1.10.8, conda-forge TensorFlow 2.19 and some MEX files fail with "Invalid argument"; clear the flag withpatchelf --clear-execstack. - PyCQA/bandit-action on Ubuntu 26.04: the action sets up Python 3.8 (3.9 on v1.0.1) with no input to change it, and setup-python has builds for 26.04 only from 3.10; run Bandit in your own steps.
- "Access to the path '/home/vsts' is denied" in Azure Pipelines: on 26.04 the agent's user is
runner, so paths written as/home/vstsfail; build them from$(Pipeline.Workspace)or$HOME. - apt on Ubuntu 26.04: renamed and removed packages.
See failed jobs from IntelliJ IDEA
Pipeline Inbox for GitHub Actions Workflows, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the runs of all your repositories in an IDE tool window, with their jobs and steps, so the workflows that went red when ubuntu-latest moved stand out, and your current branch's runs are in the status bar. Reading is free; re-running failed jobs, cancelling, running workflows and reviewing deployments are Pro (US$1.50 a month, with a 30-day trial).
Get it on JetBrains Marketplace
GitHub and GitHub Actions are trademarks of GitHub, Inc.; Ubuntu is a trademark of Canonical Ltd.; Anaconda and Miniconda are trademarks of Anaconda, Inc.; Azure DevOps is a trademark of Microsoft Corporation; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with, sponsored or endorsed by GitHub, Inc., Canonical, Anaconda, Inc., Microsoft or JetBrains.
More: "The ubuntu-latest label will migrate to Ubuntu 26" · setup-python's "was not found" error · GitHub Actions plugins for IntelliJ IDEA compared · 日本語