Score:0

Failing to install Google Chrome stable using a docker script

gq flag

Im using a Dockerfile to run an Ubuntu container with Chrome and some other apps, this is how it looks:

FROM ubuntu:23.04
ENV USER=root
ENV PASSWORD=password1
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN=true
RUN apt-get update && \
    echo "tzdata tzdata/Areas select America" > ~/tx.txt && \
    echo "tzdata tzdata/Zones/America select New York" >> ~/tx.txt && \
    debconf-set-selections ~/tx.txt && \
    apt-get install -y abiword gnupg apt-transport-https wget software-properties-common ratpoison novnc websockify libxv1 libglu1-mesa xauth x11-utils xorg tightvncserver && \
    wget https://kumisystems.dl.sourceforge.net/project/virtualgl/2.6.5/virtualgl_2.6.5_amd64.deb && \
    wget https://kumisystems.dl.sourceforge.net/project/turbovnc/2.2.7/turbovnc_2.2.7_amd64.deb && \
    wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
    apt install -y ./google-chrome-stable_current_amd64.deb && \
    dpkg -i virtualgl_*.deb && \
    dpkg -i turbovnc_*.deb && \
    mkdir ~/.vnc/ && \
    mkdir ~/.dosbox && \
    echo $PASSWORD | vncpasswd -f > ~/.vnc/passwd && \
    chmod 0600 ~/.vnc/passwd && \
    echo "set border 1" > ~/.ratpoisonrc  && \
    echo "exec google-chrome --no-sandbox">> ~/.ratpoisonrc && \
    openssl req -x509 -nodes -newkey rsa:2048 -keyout ~/novnc.pem -out ~/novnc.pem -days 3650 -subj "/C=US/ST=NY/L=NY/O=NY/OU=NY/CN=NY [email protected]"
EXPOSE 80
CMD /opt/TurboVNC/bin/vncserver && websockify -D --web=/usr/share/novnc/ --cert=~/novnc.pem 80 localhost:5901 && tail -f /dev/null

The relevant lines are:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt install -y ./google-chrome-stable_current_amd64.deb

I'm getting this error:

#5 73.69 Some packages could not be installed. This may mean that you have
#5 73.69 requested an impossible situation or if you are using the unstable
#5 73.69 distribution that some required packages have not yet been created
#5 73.69 or been moved out of Incoming.
#5 73.69 The following information may help to resolve the situation:
#5 73.69 
#5 73.69 The following packages have unmet dependencies:
#5 73.75  google-chrome-stable:amd64 : Depends: libasound2:amd64 (>= 1.0.17) but it is not installable
#5 73.75                               Depends: libatk-bridge2.0-0:amd64 (>= 2.5.3) but it is not installable
.
.
.
many others

I don't get why those dependencies cannot be installed. Following a suggestion I changed the apt install -y ./google-chrome-stable_current_amd64.deb with dpkg -i ./google-chrome-stable_current_amd64.deb under the logics that dpkg should resolve the dependencies issues, rerun the script getting this new error:

#5 105.4 dpkg: error processing archive ./google-chrome-stable_current_amd64.deb (--install):
#5 105.4  package architecture (amd64) does not match system (arm64)
#5 105.4 Errors were encountered while processing:
#5 105.4  ./google-chrome-stable_current_amd64.deb

Wich I understand even less since I did not see where arm64 is set in the script, maybe is a default option? (Im running Docker in a macOS with a M2 chip)

David avatar
cn flag
So your Docker is running on an ARM machine.
Score:1
vn flag

It seems your architecture is arm64, while the script is set to install packages for amd64.

Under normal circumstances, this should be pretty straightforward with a basic search and replace: Replace all instances of amd64 with arm64 in the Dockerfile.

However, I did the homework for you, and it seems none of the packages you want to download (virtualgl, turbovnc or google-chrome-stable) has an arm64 package available (at least from those download locations).

You have then requested an impossible situation, by running an arm64 architecture, but requiring packages only available for amd64.

So you have to either:

  1. Switch to amd64 architecture
  2. Compile the packages for arm64 architecture
  3. Find alternative packages to achieve what you want
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.