[GH-ISSUE #588] Issue: APT install works on Github but fails in Act #391

Closed
opened 2026-03-01 21:42:58 +03:00 by kerem · 10 comments
Owner

Originally created by @rafaelmotaalves on GitHub (Mar 29, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/588

Act version

act version 0.2.20

Expected behaviour

When using the apt install command to APT install packages, the packages should be installed correctly, as it happens on Github.

Actual behaviour

When using the APT command to install APT packages the following error is returned:

E: Unable to locate package 'package-name'

Workflow and/or repository

https://github.com/rafaelmotaalves/voicemod-bot

workflow
name: CI Python

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.8
      - name: Install apt packages
        run: |
          sudo apt install ffmpeg libsndfile-dev -y
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt
      - name: Test
        run: |
          pytest

Steps to reproduce

Execute act on the root of the project.

act output

Log
[CI Python/build]   ✅  Success - Setup Python
[CI Python/build] ⭐  Run Install apt packages
Reading package lists... Done
Building dependency tree
Reading state information... Done
| E: Unable to locate package ffmpeg
| E: Unable to locate package libsndfile-dev
[CI Python/build]   ❌  Failure - Install apt packages
Error: exit with `FAILURE`: 100
Originally created by @rafaelmotaalves on GitHub (Mar 29, 2021). Original GitHub issue: https://github.com/nektos/act/issues/588 <!-- - Make sure you are able to reproduce it on the [latest version](https://github.com/nektos/act/releases) - Search the existing issues. - Refer to [README](https://github.com/nektos/act/blob/master/README.md). --> ## Act version ```none act version 0.2.20 ``` ## Expected behaviour When using the `apt install` command to APT install packages, the packages should be installed correctly, as it happens on Github. <!-- Describe how whole process should go and finish --> ## Actual behaviour When using the APT command to install APT packages the following error is returned: ```none E: Unable to locate package 'package-name' ``` <!-- Describe what happened --> ## Workflow and/or repository https://github.com/rafaelmotaalves/voicemod-bot <details> <summary>workflow</summary> ```none name: CI Python on: [push, pull_request] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Setup Python uses: actions/setup-python@v2 with: python-version: 3.8 - name: Install apt packages run: | sudo apt install ffmpeg libsndfile-dev -y - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - name: Test run: | pytest ``` </details> ## Steps to reproduce <!-- Make sure to include command you used to run `act` e.g.: 1. Clone example repo (https://github.com/cplee/github-actions-demo) 2. Enter cloned repo directory 3. Run `act -s SUPER_SECRET=im-a-value` --> Execute `act` on the root of the project. ## `act` output <!-- Paste output from your terminal, use `-v` or `--verbose` for richer output --> <details> <summary>Log</summary> ```none [CI Python/build] ✅ Success - Setup Python [CI Python/build] ⭐ Run Install apt packages Reading package lists... Done Building dependency tree Reading state information... Done | E: Unable to locate package ffmpeg | E: Unable to locate package libsndfile-dev [CI Python/build] ❌ Failure - Install apt packages Error: exit with `FAILURE`: 100 ``` </details>
kerem 2026-03-01 21:42:58 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@catthehacker commented on GitHub (Mar 29, 2021):

You need to run apt update before installing anything. You are relying on apt cache on GitHub runners which quite often becomes invalid.
https://github.com/actions/virtual-environments/issues/2924

<!-- gh-comment-id:809479520 --> @catthehacker commented on GitHub (Mar 29, 2021): You need to run `apt update` before installing anything. You are relying on apt cache on GitHub runners which quite often becomes invalid. https://github.com/actions/virtual-environments/issues/2924
Author
Owner

@catthehacker commented on GitHub (Apr 1, 2021):

Solution provided and using apt update or apt-get update has been mentioned very often in GitHub virtual environments.
Keeping apt cache in Docker image has no benefit since it will get outdated and takes space.

<!-- gh-comment-id:812172933 --> @catthehacker commented on GitHub (Apr 1, 2021): Solution provided and using `apt update` or `apt-get update` has been mentioned very often in GitHub virtual environments. Keeping `apt` cache in Docker image has no benefit since it will get outdated and takes space.
Author
Owner

@masroorhussainv commented on GitHub (Feb 23, 2022):

still does not work for me. I'm trying to install chromedriver and it says:

E: Unable to locate package google-chrome

<!-- gh-comment-id:1048552377 --> @masroorhussainv commented on GitHub (Feb 23, 2022): still does not work for me. I'm trying to install chromedriver and it says: > E: Unable to locate package google-chrome
Author
Owner

@catthehacker commented on GitHub (Feb 23, 2022):

still does not work for me. I'm trying to install chromedriver and it says:

E: Unable to locate package google-chrome

there is no google-chrome package in Ubuntu

<!-- gh-comment-id:1048555886 --> @catthehacker commented on GitHub (Feb 23, 2022): > still does not work for me. I'm trying to install chromedriver and it says: > > > E: Unable to locate package google-chrome there is no `google-chrome` package in Ubuntu
Author
Owner

@masroorhussainv commented on GitHub (Feb 23, 2022):

Here is the Github action that I tried to install chromedriver with

- name: Set up Chromedriver for Selenium
  uses: nanasess/setup-chromedriver@v1

This action claims support for

  • ubuntu-latest, ubuntu-20.04, ubuntu-18.04, or ubuntu-16.04
  • macos-latest, macos-10.15
  • windows-latest, windows-2019
<!-- gh-comment-id:1048564812 --> @masroorhussainv commented on GitHub (Feb 23, 2022): [Here](https://github.com/nanasess/setup-chromedriver) is the Github action that I tried to install chromedriver with ```yml - name: Set up Chromedriver for Selenium uses: nanasess/setup-chromedriver@v1 ``` This action claims support for - ubuntu-latest, ubuntu-20.04, ubuntu-18.04, or ubuntu-16.04 - macos-latest, macos-10.15 - windows-latest, windows-2019
Author
Owner

@catthehacker commented on GitHub (Feb 23, 2022):

then that action is broken, in https://github.com/nanasess/setup-chromedriver/pull/16 there is added a check to install google-chrome if it's not installed but our images don't include Google Chrome repos and GitHub removes them after installing google-chrome, so it will break everywhere where repos are not included and chrome is missing

<!-- gh-comment-id:1048572230 --> @catthehacker commented on GitHub (Feb 23, 2022): then that action is broken, in https://github.com/nanasess/setup-chromedriver/pull/16 there is added a check to install `google-chrome` if it's not installed but our images don't include Google Chrome repos and GitHub removes them after installing `google-chrome`, so it will break everywhere where repos are not included and chrome is missing
Author
Owner

@masroorhussainv commented on GitHub (Feb 23, 2022):

Alright, what are my other options to get it installed? The same thing works fine on Github CI, it's only failing on the local machine when running the workflow through act.

<!-- gh-comment-id:1048574603 --> @masroorhussainv commented on GitHub (Feb 23, 2022): Alright, what are my other options to get it installed? The same thing works fine on Github CI, it's only failing on the local machine when running the workflow through act.
Author
Owner

@catthehacker commented on GitHub (Feb 23, 2022):

this should work

wget "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
apt-get install "google-chrome-stable_current_amd64.deb" -f
<!-- gh-comment-id:1048577248 --> @catthehacker commented on GitHub (Feb 23, 2022): this should work ```sh wget "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" apt-get install "google-chrome-stable_current_amd64.deb" -f ```
Author
Owner

@masroorhussainv commented on GitHub (Feb 23, 2022):

Ran this

- name: Set up Chromedriver for Selenium
  run: |
    sudo apt-get update &&
    wget "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" &&
    apt-get install "google-chrome-stable_current_amd64.deb" -f

and it failed with this error

Reading package lists... Done
| --2022-02-23 09:44:15-- https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
| Resolving dl.google.com (dl.google.com)... 216.58.208.238, 2a00:1450:4019:805::200e
| Connecting to dl.google.com (dl.google.com)|216.58.208.238|:443... connected.
| HTTP request sent, awaiting response... 200 OK
| Length: 90840348 (87M) [application/x-debian-package]
| Saving to: 'google-chrome-stable_current_amd64.deb'
|
google-chrome-stabl 100%[===================>] 86.63M 1.16MB/s in 80s
|
| 2022-02-23 09:45:35 (1.09 MB/s) - 'google-chrome-stable_current_amd64.deb' saved [90840348/90840348]
|
Reading package lists... Done
Building dependency tree
Reading state information... Done
| E: Unable to locate package google-chrome-stable_current_amd64.deb
| E: Couldn't find any package by glob 'google-chrome-stable_current_amd64.deb'
| E: Couldn't find any package by regex 'google-chrome-stable_current_amd64.deb'

It also didn't work with

- name: Set up Chromedriver for Selenium
  run: |
    wget "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" &&
    dpkg -i "google-chrome-stable_current_amd64.deb"

Which threw these errors

| --2022-02-23 09:55:50-- https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
| Resolving dl.google.com (dl.google.com)... 216.58.208.238, 2a00:1450:4019:805::200e
| Connecting to dl.google.com (dl.google.com)|216.58.208.238|:443... connected.
| HTTP request sent, awaiting response... 200 OK
| Length: 90840348 (87M) [application/x-debian-package]
| Saving to: 'google-chrome-stable_current_amd64.deb'
|
google-chrome-stabl 100%[===================>] 86.63M 1.10MB/s in 76s
|
| 2022-02-23 09:57:05 (1.15 MB/s) - 'google-chrome-stable_current_amd64.deb' saved [90840348/90840348]
|
| Selecting previously unselected package google-chrome-stable.
(Reading database ... 26225 files and directories currently installed.)
| Preparing to unpack google-chrome-stable_current_amd64.deb ...
| Unpacking google-chrome-stable (98.0.4758.102-1) ...
| dpkg: dependency problems prevent configuration of google-chrome-stable:
| google-chrome-stable depends on fonts-liberation; however:
| Package fonts-liberation is not installed.
| google-chrome-stable depends on libasound2 (>= 1.0.16); however:
| Package libasound2 is not installed.
| google-chrome-stable depends on libatk-bridge2.0-0 (>= 2.5.3); however:
| Package libatk-bridge2.0-0 is not installed.
| google-chrome-stable depends on libatk1.0-0 (>= 2.2.0); however:
| Package libatk1.0-0 is not installed.
| google-chrome-stable depends on libatspi2.0-0 (>= 2.9.90); however:
| Package libatspi2.0-0 is not installed.
| google-chrome-stable depends on libcups2 (>= 1.6.0); however:
| Package libcups2 is not installed.
| google-chrome-stable depends on libdrm2 (>= 2.4.38); however:
| Package libdrm2 is not installed.
| google-chrome-stable depends on libgbm1 (>= 8.10); however:
| Package libgbm1 is not installed.
| google-chrome-stable depends on libgtk-3-0 (>= 3.9.10) | libgtk-4-1; however:
| Package libgtk-3-0 is not installed.
| Package libgtk-4-1 is not installed.
| google-chrome-stable depends on libnspr4 (>= 2:4.9-2
); however:
| Package libnspr4 is not installed.
| google-chrome-stable depends on libnss3 (>= 2:3.26); however:
| Package libnss3 is not installed.
| google-chrome-stable depends on libxcomposite1 (>= 1:0.4.4-1); however:
| Package libxcomposite1 is not installed.
| google-chrome-stable depends on libxdamage1 (>= 1:1.1); however:
| Package libxdamage1 is not installed.
| google-chrome-stable depends on libxfixes3; however:
| Package libxfixes3 is not installed.
| google-chrome-stable depends on libxkbcommon0 (>= 0.4.1); however:
| Package libxkbcommon0 is not installed.
| google-chrome-stable depends on libxrandr2; however:
| Package libxrandr2 is not installed.
| google-chrome-stable depends on xdg-utils (>= 1.0.2); however:
| Package xdg-utils is not installed.
|
| dpkg: error processing package google-chrome-stable (--install):
| dependency problems - leaving unconfigured
| Processing triggers for mime-support (3.64ubuntu1) ...
| Errors were encountered while processing:
| google-chrome-stable

<!-- gh-comment-id:1048622553 --> @masroorhussainv commented on GitHub (Feb 23, 2022): Ran this ```yml - name: Set up Chromedriver for Selenium run: | sudo apt-get update && wget "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" && apt-get install "google-chrome-stable_current_amd64.deb" -f ``` and it failed with this error > Reading package lists... Done | --2022-02-23 09:44:15-- https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | Resolving dl.google.com (dl.google.com)... 216.58.208.238, 2a00:1450:4019:805::200e | Connecting to dl.google.com (dl.google.com)|216.58.208.238|:443... connected. | HTTP request sent, awaiting response... 200 OK | Length: 90840348 (87M) [application/x-debian-package] | Saving to: 'google-chrome-stable_current_amd64.deb' | google-chrome-stabl 100%[===================>] 86.63M 1.16MB/s in 80s | | 2022-02-23 09:45:35 (1.09 MB/s) - 'google-chrome-stable_current_amd64.deb' saved [90840348/90840348] | Reading package lists... Done Building dependency tree Reading state information... Done | E: Unable to locate package google-chrome-stable_current_amd64.deb | E: Couldn't find any package by glob 'google-chrome-stable_current_amd64.deb' | E: Couldn't find any package by regex 'google-chrome-stable_current_amd64.deb' It also didn't work with ```yml - name: Set up Chromedriver for Selenium run: | wget "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" && dpkg -i "google-chrome-stable_current_amd64.deb" ``` Which threw these errors > | --2022-02-23 09:55:50-- https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | Resolving dl.google.com (dl.google.com)... 216.58.208.238, 2a00:1450:4019:805::200e | Connecting to dl.google.com (dl.google.com)|216.58.208.238|:443... connected. | HTTP request sent, awaiting response... 200 OK | Length: 90840348 (87M) [application/x-debian-package] | Saving to: 'google-chrome-stable_current_amd64.deb' | google-chrome-stabl 100%[===================>] 86.63M 1.10MB/s in 76s | | 2022-02-23 09:57:05 (1.15 MB/s) - 'google-chrome-stable_current_amd64.deb' saved [90840348/90840348] | | Selecting previously unselected package google-chrome-stable. (Reading database ... 26225 files and directories currently installed.) | Preparing to unpack google-chrome-stable_current_amd64.deb ... | Unpacking google-chrome-stable (98.0.4758.102-1) ... | dpkg: dependency problems prevent configuration of google-chrome-stable: | google-chrome-stable depends on fonts-liberation; however: | Package fonts-liberation is not installed. | google-chrome-stable depends on libasound2 (>= 1.0.16); however: | Package libasound2 is not installed. | google-chrome-stable depends on libatk-bridge2.0-0 (>= 2.5.3); however: | Package libatk-bridge2.0-0 is not installed. | google-chrome-stable depends on libatk1.0-0 (>= 2.2.0); however: | Package libatk1.0-0 is not installed. | google-chrome-stable depends on libatspi2.0-0 (>= 2.9.90); however: | Package libatspi2.0-0 is not installed. | google-chrome-stable depends on libcups2 (>= 1.6.0); however: | Package libcups2 is not installed. | google-chrome-stable depends on libdrm2 (>= 2.4.38); however: | Package libdrm2 is not installed. | google-chrome-stable depends on libgbm1 (>= 8.1~0); however: | Package libgbm1 is not installed. | google-chrome-stable depends on libgtk-3-0 (>= 3.9.10) | libgtk-4-1; however: | Package libgtk-3-0 is not installed. | Package libgtk-4-1 is not installed. | google-chrome-stable depends on libnspr4 (>= 2:4.9-2~); however: | Package libnspr4 is not installed. | google-chrome-stable depends on libnss3 (>= 2:3.26); however: | Package libnss3 is not installed. | google-chrome-stable depends on libxcomposite1 (>= 1:0.4.4-1); however: | Package libxcomposite1 is not installed. | google-chrome-stable depends on libxdamage1 (>= 1:1.1); however: | Package libxdamage1 is not installed. | google-chrome-stable depends on libxfixes3; however: | Package libxfixes3 is not installed. | google-chrome-stable depends on libxkbcommon0 (>= 0.4.1); however: | Package libxkbcommon0 is not installed. | google-chrome-stable depends on libxrandr2; however: | Package libxrandr2 is not installed. | google-chrome-stable depends on xdg-utils (>= 1.0.2); however: | Package xdg-utils is not installed. | | dpkg: error processing package google-chrome-stable (--install): | dependency problems - leaving unconfigured | Processing triggers for mime-support (3.64ubuntu1) ... | Errors were encountered while processing: | google-chrome-stable
Author
Owner

@mohammedhammoud commented on GitHub (Mar 24, 2022):

@masroorhussainv this should work:

- name: Set up chromedriver
  run: |
    sudo apt-get update &&
    wget "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" -P /tmp &&
    apt-get install -y "/tmp/google-chrome-stable_current_amd64.deb" -f
<!-- gh-comment-id:1078427722 --> @mohammedhammoud commented on GitHub (Mar 24, 2022): @masroorhussainv this should work: ``` - name: Set up chromedriver run: | sudo apt-get update && wget "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" -P /tmp && apt-get install -y "/tmp/google-chrome-stable_current_amd64.deb" -f ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#391
No description provided.