browser-tools-orb icon indicating copy to clipboard operation
browser-tools-orb copied to clipboard

Fix script for installing specific Chrome version with APT

Open Baplar opened this issue 2 years ago • 3 comments

Description

Fix script for installing specific Chrome version with APT

Checklist

  • [N/A] All new jobs, commands, executors, parameters have descriptions
  • [N/A] Examples have been added for any significant new features
  • [N/A] README has been updated, if necessary

Motivation, issues

When installing a specific version of Chrome on a Debian-based distro, the APT repositories were not refreshed by running apt-get update beforehand, leading to the install process failing due to unresolvable dependencies:

Google Chrome is not currently installed; installing it
Preparing Chrome installation for Debian-based systems
2023-08-30 11:21:36 URL:https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_116.0.5845.96-1_amd64.deb [96765132/96765132] -> "/tmp/chrome.deb" [1]
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'google-chrome-stable' instead of '/tmp/chrome.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 google-chrome-stable : Depends: fonts-liberation but it is not installable
                        Depends: libasound2 (>= 1.0.17) but it is not installable
                        Depends: libatk-bridge2.0-0 (>= 2.5.3) but it is not installable
                        Depends: libatk1.0-0 (>= 2.2.0) but it is not installable
                        Depends: libatspi2.0-0 (>= 2.9.90) but it is not installable
                        Depends: libcairo2 (>= 1.6.0) but it is not installable
                        Depends: libcups2 (>= 1.6.0) but it is not installable
                        Depends: libdrm2 (>= 2.4.75) but it is not installable
                        Depends: libgbm1 (>= 17.1.0~rc2) but it is not installable
                        Depends: libgtk-3-0 (>= 3.9.10) but it is not installable or
                                 libgtk-4-1 but it is not installable
                        Depends: libnspr4 (>= 2:4.9-2~) but it is not installable
                        Depends: libnss3 (>= 2:3.35) but it is not installable
                        Depends: libpango-1.0-0 (>= 1.14.0) but it is not installable
                        Depends: libu2f-udev but it is not installable
                        Depends: libvulkan1 but it is not installable
                        Depends: libxcomposite1 (>= 1:0.4.4-1) but it is not installable
                        Depends: libxdamage1 (>= 1:1.1) but it is not installable
                        Depends: libxfixes3 but it is not installable
                        Depends: libxkbcommon0 (>= 0.5.0) but it is not installable
                        Depends: libxrandr2 but it is not installable
                        Depends: xdg-utils (>= 1.0.2) but it is not installable
E: Unable to correct problems, you have held broken packages.
/bin/bash: line 129: google-chrome-stable: command not found
Google Chrome v116.0.5845.96 (stable) failed to install.

Exited with code exit status 1

Adding this update command before the install command fixes the issue.

Workaround

On an affected job, adding a step to run apt-get update before the install-chrome step fixes the resolution issue, as we manually perform the repository update before the script is run.

In other words, in the current version, this fails:

steps:
  - browser-tools/install-chrome:
      chrome-version: 116.0.5845.96

But this works:

steps:
  - run: sudo apt-get update
  - browser-tools/install-chrome:
      chrome-version: 116.0.5845.96

Baplar avatar Aug 30 '23 11:08 Baplar

Apparently I just re-discovered an already known workaround mentioned in an existing issue: https://github.com/CircleCI-Public/browser-tools-orb/issues/90#issuecomment-1698052540

Baplar avatar Aug 30 '23 12:08 Baplar

Had to switch to chrome v118 because of a bug found in v119 (released yesterday) and got

Google Chrome is not currently installed; installing it
Preparing Chrome installation for Debian-based systems
2023-11-01 19:25:09 URL:https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_118.0.5993.117-1_amd64.deb [104057764/104057764] -> "/tmp/chrome.deb" [1]
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'google-chrome-stable' instead of '/tmp/chrome.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 google-chrome-stable : Depends: libu2f-udev but it is not installable
E: Unable to correct problems, you have held broken packages.
/bin/bash: line 129: google-chrome-stable: command not found
Google Chrome v118.0.5993.117 (stable) failed to install.

Exited with code exit status 1

Workaround helped.

bondar avatar Nov 02 '23 08:11 bondar

Had to switch to chrome v118 because of a bug found in v119 (released yesterday) and got

@bondar is the bug you found in Chrome 119 documented somewhere? We are also having issues with it - see #99

FGoessler avatar Nov 06 '23 13:11 FGoessler