Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: APT install works on Github but fails in Act #588

Closed
rafaelmotaalves opened this issue Mar 29, 2021 · 10 comments
Closed

Issue: APT install works on Github but fails in Act #588

rafaelmotaalves opened this issue Mar 29, 2021 · 10 comments
Labels
kind/bug Something isn't working

Comments

@rafaelmotaalves
Copy link

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
@rafaelmotaalves rafaelmotaalves added the kind/bug Something isn't working label Mar 29, 2021
@catthehacker
Copy link
Member

catthehacker commented 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.
actions/runner-images#2924

@catthehacker
Copy link
Member

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.

@masroorhussainv
Copy link

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

E: Unable to locate package google-chrome

@catthehacker
Copy link
Member

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

@masroorhussainv
Copy link

masroorhussainv commented 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

@catthehacker
Copy link
Member

catthehacker commented Feb 23, 2022

then that action is broken, in nanasess/setup-chromedriver#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

@masroorhussainv
Copy link

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.

@catthehacker
Copy link
Member

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

@masroorhussainv
Copy link

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

@mohammedhammoud
Copy link

@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

kabbeck added a commit to ZeitOnline/zeit.nightwatch that referenced this issue Sep 28, 2022
kabbeck added a commit to ZeitOnline/zeit.nightwatch that referenced this issue Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants