Description
When using install-dependencies: true on a self-hosted runner (Ubuntu 24.04), the action fails with sudo: apt-get: command not found during the dependency installation step, even though apt-get works fine in other workflow steps.
Environment
- Runner: Self-hosted Ubuntu 24.04
- Action version: v2.1.1 (commit
4f8e94349a351df0f048634f25fec36c3c91eded)
- Chrome version: stable
Steps to Reproduce
- Use a self-hosted runner with Ubuntu 24.04
- Configure the action with
install-dependencies: true
- Run the workflow
Observed Behaviour
The action's internal apt-get update succeeds, but the subsequent apt-get install call fails:
[command]/usr/bin/sudo apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease
...
[command]/usr/bin/sudo apt-get install --yes --no-install-recommends libasound2t64 ...
sudo: apt-get: command not found
Note that a direct sudo apt-get install xvfb -yqq step earlier in the same job succeeds without issue.
Expected Behaviour
The action should successfully install dependencies, or at minimum use the full path /usr/bin/apt-get to avoid PATH resolution issues under sudo.
Workaround
Set install-dependencies: false and manually install the required packages in a prior step:
- name: Install Chrome dependencies
run: sudo apt-get install -yqq libasound2t64 libatk-bridge2.0-0t64 libatk1.0-0t64 libcairo2 libcups2t64 libdbus-1-3 libexpat1 libgbm1 libglib2.0-0t64 libnss3 libpango-1.0-0 libxcomposite1 libxdamage1 libxfixes3 libxkbcommon0 libxrandr2
- uses: browser-actions/setup-chrome@v2
with:
install-chromedriver: true
install-dependencies: false
Analysis
The issue appears to be that sudo on the self-hosted runner has a secure_path that differs from the user's PATH. When the action invokes apt-get without a full path, sudo cannot resolve it. Direct workflow steps appear to handle this differently (possibly using /usr/bin/apt-get implicitly).
Description
When using
install-dependencies: trueon a self-hosted runner (Ubuntu 24.04), the action fails withsudo: apt-get: command not foundduring the dependency installation step, even thoughapt-getworks fine in other workflow steps.Environment
4f8e94349a351df0f048634f25fec36c3c91eded)Steps to Reproduce
install-dependencies: trueObserved Behaviour
The action's internal
apt-get updatesucceeds, but the subsequentapt-get installcall fails:Note that a direct
sudo apt-get install xvfb -yqqstep earlier in the same job succeeds without issue.Expected Behaviour
The action should successfully install dependencies, or at minimum use the full path
/usr/bin/apt-getto avoid PATH resolution issues under sudo.Workaround
Set
install-dependencies: falseand manually install the required packages in a prior step:Analysis
The issue appears to be that
sudoon the self-hosted runner has asecure_paththat differs from the user's PATH. When the action invokesapt-getwithout a full path, sudo cannot resolve it. Direct workflow steps appear to handle this differently (possibly using/usr/bin/apt-getimplicitly).