Laravel Sail build failed on M1 mac - laravel

I'm trying to build the 'laravel.test' docker image on my new macbook pro with the M1 Pro chip, but I'm getting this error:
=> ERROR [ 5/12] RUN apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git sup 21.5s
------
> [ 5/12] RUN apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && mkdir -p ~/.gnupg && chmod 600 ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf && apt-key adv --homedir ~/.gnupg --keyserver hkps://keyserver.ubuntu.com --recv-keys 14AA40EC0831756756D7F66C4F4EA0AAE5267A6C && echo "deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu impish main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php8.1-cli php8.1-dev php8.1-pgsql php8.1-sqlite3 php8.1-gd php8.1-curl php8.1-imap php8.1-mysql php8.1-mbstring php8.1-xml php8.1-zip php8.1-bcmath php8.1-soap php8.1-intl php8.1-readline php8.1-ldap php8.1-msgpack php8.1-igbinary php8.1-redis php8.1-swoole php8.1-memcached php8.1-pcov php8.1-xdebug && php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer && curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs && npm install -g npm && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && echo "deb http://apt.postgresql.org/pub/repos/apt impish-pgdg main" > /etc/apt/sources.list.d/pgdg.list && curl --silent -o - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && apt-get update && apt-get install -y yarn && apt-get install -y mysql-client && apt-get install -y postgresql-client && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*:
#8 10.35 Hit:1 http://ports.ubuntu.com/ubuntu-ports impish InRelease
#8 10.39 Hit:2 http://ports.ubuntu.com/ubuntu-ports impish-updates InRelease
#8 10.45 Hit:3 http://ports.ubuntu.com/ubuntu-ports impish-backports InRelease
#8 10.51 Hit:4 http://ports.ubuntu.com/ubuntu-ports impish-security InRelease
#8 10.56 Reading package lists...
#8 10.89 Reading package lists...
#8 11.20 Building dependency tree...
#8 11.27 Reading state information...
#8 11.35 ca-certificates is already the newest version (20210119ubuntu1).
#8 11.35 curl is already the newest version (7.74.0-1.3ubuntu2).
#8 11.35 gnupg is already the newest version (2.2.20-1ubuntu4).
#8 11.35 libcap2-bin is already the newest version (1:2.44-1build1).
#8 11.35 libpng-dev is already the newest version (1.6.37-3build4).
#8 11.35 sqlite3 is already the newest version (3.35.5-1).
#8 11.35 unzip is already the newest version (6.0-26ubuntu1).
#8 11.35 zip is already the newest version (3.0-12build1).
#8 11.35 gosu is already the newest version (1.12-1build1).
#8 11.35 python2 is already the newest version (2.7.18-3).
#8 11.35 supervisor is already the newest version (4.2.1-1ubuntu1).
#8 11.35 git is already the newest version (1:2.32.0-1ubuntu1.1).
#8 11.35 0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
#8 11.38 Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
#8 11.39 Executing: /tmp/apt-key-gpghome.z6BHPockHd/gpg.1.sh --homedir /root/.gnupg --keyserver hkps://keyserver.ubuntu.com --recv-keys 14AA40EC0831756756D7F66C4F4EA0AAE5267A6C
#8 21.44 gpg: keyserver receive failed: Server indicated a failure
------
failed to solve: executor failed running [/bin/sh -c apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && mkdir -p ~/.gnupg && chmod 600 ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf && apt-key adv --homedir ~/.gnupg --keyserver hkps://keyserver.ubuntu.com --recv-keys 14AA40EC0831756756D7F66C4F4EA0AAE5267A6C && echo "deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu impish main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php8.1-cli php8.1-dev php8.1-pgsql php8.1-sqlite3 php8.1-gd php8.1-curl php8.1-imap php8.1-mysql php8.1-mbstring php8.1-xml php8.1-zip php8.1-bcmath php8.1-soap php8.1-intl php8.1-readline php8.1-ldap php8.1-msgpack php8.1-igbinary php8.1-redis php8.1-swoole php8.1-memcached php8.1-pcov php8.1-xdebug && php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer && curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - && apt-get install -y nodejs && npm install -g npm && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && echo "deb http://apt.postgresql.org/pub/repos/apt impish-pgdg main" > /etc/apt/sources.list.d/pgdg.list && curl --silent -o - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && apt-get update && apt-get install -y yarn && apt-get install -y mysql-client && apt-get install -y postgresql-client && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*]: exit code: 2
ps: the image is running well on my old macbook pro with the intel chip
this happens after I run the following
./vendor/bin/sail up -d
Sail Version: 1.13.9
Laravel Version: 8.83.8
PHP Version: 8.1.4
OS: macOS 12.3.1

I encountered the same issue. It seems like the DNS resolution failed for some reason. I changed the DNS Server IP of my computer to 8.8.8.8 (Google) or 1.1.1.1 (Cloudflare) and it solved the problem.
It only happens when you have to build the Docker Image. Maybe it works on your old computer because you have a previous build on it or a different DNS settings. Try to rebuild it with sail build --no-cache on your old macbook. If you get the same error, maybe it's your DNS cache on your router or something in your DNS lookup chain. If it succeed, look at your DNS settings to compare with your new macbook.

Related

Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Suite' value from 'stable' to 'oldstable'

Some of my GitHub Actions workflows started recently to return this error when installing Chromedriver:
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Reading package lists...
E: Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
E: Repository 'http://deb.debian.org/debian buster InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
E: Repository 'http://deb.debian.org/debian buster-updates InRelease' changed its 'Suite' value from 'stable-updates' to 'oldstable-updates'
Error: Process completed with exit code 100.
Here is my step implementation:
jobs:
build:
runs-on: ubuntu-latest
container:
image: docker://guillaumefalourd/ritchiecli:py-3.8
steps:
- name: Install Chrome Driver
run: |
sudo apt-get update
sudo apt-get install -y unzip xvfb libxi6 libgconf-2-4 gnupg2
sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
sudo echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
sudo apt-get -y update
sudo apt-get -y install google-chrome-stable
wget -N https://chromedriver.storage.googleapis.com/89.0.4389.23/chromedriver_linux64.zip -P ~/
unzip ~/chromedriver_linux64.zip -d ~/
rm ~/chromedriver_linux64.zip
sudo mv -f ~/chromedriver /usr/local/bin/chromedriver
sudo chown root:root /usr/local/bin/chromedriver
sudo chmod 0755 /usr/local/bin/chromedriver
Docker Image Implementation: docker://guillaumefalourd/ritchiecli:py-3.8
What I tried
I read from here and here that adding sudo apt-get --allow-releaseinfo-change update or sudo apt-get dist-upgrade could resolve the problem, but even adding those to my workflow didn't resolve it.
I tried using this action setup-chromedriver but it returned the same error when following the documentation:
steps:
- uses: actions/checkout#v2
- uses: nanasess/setup-chromedriver#master
with:
# Optional: do not specify to match Chrome's version
chromedriver-version: '88.0.4324.96'
- run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
As it seems to be related to Debian 10 (Buster) (?) I also tried to use another Ubuntu runner version as a runner (ubuntu-18.04 instead of ubuntu-latest), but nothing changed, same error.
How can I resolve this issue?
Answer
I observed afterwards that the problem was happening at the first command : sudo apt-get update (and I was adding the other command after...).
Substituting it for sudo apt-get --allow-releaseinfo-change update resolved my problem.
Therefore the answer was not to add the sudo apt-get --allow-releaseinfo-change update to the step executed commands, but substituting the sudo apt-get update command for it.
jobs:
build:
runs-on: ubuntu-latest
container:
image: docker://guillaumefalourd/ritchiecli:py-3.8
steps:
- name: Install Chrome Driver
run: |
sudo apt-get --allow-releaseinfo-change update
sudo apt-get install -y unzip xvfb libxi6 libgconf-2-4 gnupg2
sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
sudo echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
sudo apt-get -y update
sudo apt-get -y install google-chrome-stable
wget -N https://chromedriver.storage.googleapis.com/89.0.4389.23/chromedriver_linux64.zip -P ~/
unzip ~/chromedriver_linux64.zip -d ~/
rm ~/chromedriver_linux64.zip
sudo mv -f ~/chromedriver /usr/local/bin/chromedriver
sudo chown root:root /usr/local/bin/chromedriver
sudo chmod 0755 /usr/local/bin/chromedriver
I know you tried it with
apt-get --allow-releaseinfo-change update
but it worked for me.
This is my command in the dockerfile:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get --allow-releaseinfo-change update \
&& apt-get install -y google-chrome-unstable \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
not required: rm -rf /var/lib/apt/lists/*
FWIW, you may reduce your risk in using this option (--allow-releaseinfo-change) by adding specialist options to limit the fields you permit to bypass apt-secure. From man apt-get:
Specialist options (--allow-releaseinfo-change-field) exist to allow changes only for certain fields like origin, label, codename, suite, version and defaultpin. See also apt_preferences(5).
For example, in the current bugaboo created by the delayed release of bullseye between the Debian and its derivative RPi OS, the specialist option would be suite. This due to the fact that the suite label in buster has been changed from stable to oldstable:
$ sudo apt-get --allow-releaseinfo-change-suite update

Laravel sail failed to start

I am trying to start laravel sail on Mac M1. I was able to resolve mysql version issue. Now when I run .vendor/bin/sail up command it get stuck at [4/12] RUN apt-get update && apt-get install -y gnupg gosu curl. These are last commands before the error apperas
#8 133.9 Fetched 25.3 MB in 10s (2488 kB/s)
#8 134.0 Selecting previously unselected package nodejs.
(Reading database ... 21562 files and directories currently installed.)
#8 134.0 Preparing to unpack .../nodejs_16.3.0-deb-1nodesource1_arm64.deb ...
#8 134.0 Unpacking nodejs (16.3.0-deb-1nodesource1) ...
#8 135.7 Setting up nodejs (16.3.0-deb-1nodesource1) ...
#8 135.7 Processing triggers for man-db (2.9.1-1) ...
#8 135.8 Warning: apt-key output should not be parsed (stdout is not a terminal)
#8 136.8 gpg: no valid OpenPGP data found.
#8 136.8 Segmentation fault
This error is displayed in the end.
executor failed running [/bin/sh -c apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && mkdir -p ~/.gnupg && chmod 600 ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php8.0-cli php8.0-dev php8.0-pgsql php8.0-sqlite3 php8.0-gd php8.0-curl php8.0-memcached php8.0-imap php8.0-mysql php8.0-mbstring php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap php8.0-intl php8.0-readline php8.0-msgpack php8.0-igbinary php8.0-ldap php8.0-redis && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer && curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && apt-get update && apt-get install -y yarn && apt-get install -y mysql-client && apt-get install -y postgresql-client && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*]: exit code: 2
ERROR: Service 'laravel.test' failed to build : Build failed
According to this closed issue on the laravel/sail repo, the fix as of this posting is to downgrade Docker. This fixed the issue for me.
https://github.com/laravel/sail/issues/159#issuecomment-863079097

How to install Java 8 or higher on Debian 8 given the jessie-backports are no more valid?

I had tried the following two ways but no luck
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" > /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" >> /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update && apt-get install oracle-java8-installer -y
I get error saying
Unable to find the oracle8-java-installer package
I tried openjdk-8-jdk too but no luck
FROM debian:jessie
RUN echo deb-src http://security.debian.org/ jessie/updates main > /etc/apt/sources.list.d/extra_debian.list >> /etc/apt/sources.list.d/extra_debian.list
RUN apt-get update && apt-get install -y openjdk-8-jdk
Step 9/9 : RUN apt-get install -y openjdk-8-jdk
---> Running in eaf2278dd79f
Reading package lists...
Building dependency tree...
Reading state information...
Package openjdk-8-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Pdf2Html Installation

I 'm trying to install Pdf2HtmlEx Software on Ubuntu Server 18.04.1 LTS. The repository is not maintained but the sotware is very useful for me.
I installed it on Xubuntu desktop distro and on a docker image but i can't do it on ubuntu server.
It seems that some new versions of pdf2htmlEx library dependencies are not compatible with the last version of the sofware.
Has anyone have de same issue? Could someone tell me how to install it?
I have try with
rajeevkannav solution
Copying this dockerfile
Following Build Installation
The oficial repo is pdf2htmlEX
Thank you for know!
Install m4
wget ftp://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz && tar -xvzf m4-1.4.17.tar.gz
cd m4-1.4.17 && ./configure --prefix=/usr/local/m4 && make && make install
Install poppler dependencies
apt-get update && apt-get install -y --no-install-recommends \
pkg-config libopenjp2-7-dev libopenjp2-7 libgdk-pixbuf2.0-dev libfontconfig1-dev libfontforge-dev poppler-data poppler-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
Install poppler
wget https://poppler.freedesktop.org/poppler-0.63.0.tar.xz --no-check-certificate && tar -xvf poppler-0.63.0.tar.xz
cd poppler-0.63.0/ && cmake -DENABLE_XPDF_HEADERS=ON . && make && make install
Install fontforge dependencies
apt-get update && apt-get install -y --no-install-recommends \
packaging-dev pkg-config python-dev libpango1.0-dev libglib2.0-dev libxml2-dev \
libjpeg-dev libtiff-dev uthash-dev libspiro-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
pkg-config --print-provides --cflags --libs poppler
Install fontforge
git clone --depth 1 https://github.com/fontforge/fontforge.git
cd fontforge/ && ./bootstrap && ./configure && make && make install
Clone and install the pdf2htmlEX git repo
git clone https://github.com/pdf2htmlEX/pdf2htmlEX.git
cd pdf2htmlEX && cmake . && make && make install

Unable to locate package google-chrome-stable ubuntu12 on openstack

I'm running a script on my ubuntu on openstack (env bash) which is trying to install the latest stable chrome browser:
sudo apt-get update
sudo apt-get -y install openjdk-7-jre google-chrome-stable
But I'm getting --> Unable to locate package google-chrome-stable ubuntu
I tried the following additions but they didn't help:
# trying universe repo
sudo apt-get -y install libgconf2-4 libnss3-1d libxss1
sudo apt-get update
# trying something for openstack
sudo apt-get install ubuntu-cloud-keyring
sudo apt-get update
Will be happy to hear more suggestions.
Setup key with:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
Setup repository with:
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
(https://www.ubuntuupdates.org/ppa/google_chrome)
As written in the comment above, The fix is adding:
deb http://dl.google.com/linux/chrome/deb/ stable main to the source file:
sudo sh -c "echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list"
For information chrome is not available on ARM. That is why nothing worked for me here.
First you need to add key:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A040830F7FAC5991
and then you could do:
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google.list
apt-get update && apt-get install -y google-chrome-stable
Without key you are installing unsigned package and because of that you might get problems late.
The existing accepted answer is close but fails to use HTTPS:
Setup key with:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
Setup repository with:
sudo sh -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
(https://www.ubuntuupdates.org/ppa/google_chrome)
If nothing works, try:
$ touch /etc/apt/sources.list

Resources