homestead icon indicating copy to clipboard operation
homestead copied to clipboard

Need add `--no-tty` to `apt-key` option

Open mouyong opened this issue 2 years ago • 5 comments

https://github.com/laravel/homestead/blob/35620748af486b9ae387df0da94e3677934f62ef/scripts/features/webdriver.sh#L23

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add --no-tty -

mouyong avatar Mar 01 '22 07:03 mouyong

I don't think so, applying the change doesn't work:

==> homestead: Running provisioner: Installing webdriver (shell)...
    homestead: Running: script: Installing webdriver
    homestead: Warning: apt-key output should not be parsed (stdout is not a terminal)
    homestead: gpg: can't open '–-no-tty': No such file or directory
    homestead: deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
    homestead: Get:1 http://dl.google.com/linux/chrome/deb stable InRelease [1,811 B]
    homestead: Hit:2 https://deb.nodesource.com/node_14.x focal InRelease
    homestead: Get:3 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease [86.6 kB]
    homestead: Get:4 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]
    homestead: Err:1 http://dl.google.com/linux/chrome/deb stable InRelease
    homestead:   The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 78BD65473CB3BD13
    homestead: Hit:5 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu focal InRelease
    homestead: Hit:6 http://ports.ubuntu.com/ubuntu-ports focal InRelease
    homestead: Get:7 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB]
    homestead: Get:8 http://apt.postgresql.org/pub/repos/apt focal-pgdg/main arm64 Packages [225 kB]
    homestead: Get:9 https://download.docker.com/linux/ubuntu focal/stable arm64 Packages [12.9 kB]
    homestead: Get:10 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease [23.9 kB]
    homestead: Get:11 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [108 kB]
    homestead: Get:12 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main arm64 Packages [101 kB]
    homestead: Get:13 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [114 kB]
    homestead: Get:14 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 Packages [1,119 kB]
    homestead: Get:15 http://ports.ubuntu.com/ubuntu-ports focal-updates/main Translation-en [308 kB]
    homestead: Get:16 http://ports.ubuntu.com/ubuntu-ports focal-updates/restricted Translation-en [118 kB]
    homestead: Get:17 http://ports.ubuntu.com/ubuntu-ports focal-updates/universe arm64 Packages [855 kB]
    homestead: Get:18 http://ports.ubuntu.com/ubuntu-ports focal-updates/universe Translation-en [201 kB]
    homestead: Get:19 http://ports.ubuntu.com/ubuntu-ports focal-backports/main arm64 Packages [42.2 kB]
    homestead: Get:20 http://ports.ubuntu.com/ubuntu-ports focal-backports/main Translation-en [10.1 kB]
    homestead: Get:21 http://ports.ubuntu.com/ubuntu-ports focal-backports/universe arm64 Packages [22.7 kB]
    homestead: Get:22 http://ports.ubuntu.com/ubuntu-ports focal-backports/universe Translation-en [15.4 kB]
    homestead: Get:23 http://ports.ubuntu.com/ubuntu-ports focal-security/main arm64 Packages [832 kB]
    homestead: Get:24 http://ports.ubuntu.com/ubuntu-ports focal-security/main Translation-en [224 kB]
    homestead: Get:25 http://ports.ubuntu.com/ubuntu-ports focal-security/restricted Translation-en [110 kB]
    homestead: Get:26 http://ports.ubuntu.com/ubuntu-ports focal-security/universe arm64 Packages [630 kB]
    homestead: Get:27 http://ports.ubuntu.com/ubuntu-ports focal-security/universe Translation-en [117 kB]
    homestead: Reading package lists...
    homestead: W: GPG error: http://dl.google.com/linux/chrome/deb stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 78BD65473CB3BD13
    homestead: E: The repository 'http://dl.google.com/linux/chrome/deb stable InRelease' is not signed.
    homestead: Reading package lists...
    homestead: Building dependency tree...
    homestead: Reading state information...
    homestead: E: Unable to locate package google-chrome-stable
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
vagrant up: 00:55

┌─(~/Code/homestead)(master M:2 S:4)
└─(1)─ vagrant ssh
Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-100-generic aarch64)


vagrant@homestead:~$ sudo su
root@homestead:/home/vagrant# wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add –-no-tty -
gpg: can't open '–-no-tty': No such file or directory
root@homestead:/home/vagrant# wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
OK

svpernova09 avatar Mar 04 '22 16:03 svpernova09

sorry. it maybe typo with --. already edited comment.

image

mouyong avatar Mar 05 '22 06:03 mouyong

Still not able to reproduce? Here's a gist of manually running the script: https://gist.github.com/svpernova09/0a58097b9dbc8f1b9bbe99ab0f589915

svpernova09 avatar Mar 17 '22 00:03 svpernova09

When --no-tty is missing. It is always waiting for the user to interact.

Image

mouyong avatar Mar 17 '22 01:03 mouyong

Looks completely broken at the moment on 20.04

    homestead: Fetched 2,903 B in 1s (4,437 B/s)
    homestead: Reading package lists...
    homestead: Reading package lists...
    homestead: Building dependency tree...
    homestead: Reading state information...
    homestead: E: Unable to locate package google-chrome-stable
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
vagrant up: 01:23

┌─(~/Code/homestead)(14x S:3)
└─(1)─ vagrant ssh
Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-122-generic aarch64)


vagrant@homestead:~$ sudo su
root@homestead:/home/vagrant# apt update
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 https://download.docker.com/linux/ubuntu focal InRelease
Hit:3 https://deb.nodesource.com/node_14.x focal InRelease
Hit:4 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu focal InRelease
Hit:5 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Hit:6 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
Hit:7 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
Hit:8 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease
Hit:9 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
Hit:10 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
339 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@homestead:/home/vagrant# apt list | grep chrome

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

chrome-gnome-shell/focal 10.1-5 all
chromium-chromedriver/focal-updates 1:85.0.4183.83-0ubuntu0.20.04.2 arm64
chromium-lwn4chrome/focal 1.0-3 all
google-chrome-beta/stable 107.0.5304.18-1 amd64
google-chrome-stable/stable 106.0.5249.91-1 amd64
google-chrome-unstable/stable 108.0.5327.0-1 amd64
mkchromecast-alsa/focal 0.3.8.1-1 all
mkchromecast-gstreamer/focal 0.3.8.1-1 all
mkchromecast-pulseaudio/focal 0.3.8.1-1 all
mkchromecast/focal 0.3.8.1-1 all
node-chrome-trace-event/focal 1.0.2-1 all
python3-pychromecast/focal 4.1.0-1 all
ruby-chromedriver-helper/focal 2.1.0-7 all
root@homestead:/home/vagrant# apt-get -y install libxpm4 libxrender1 libgtk2.0-0 libnss3 libgconf-2-4 chromium-browser xvfb gtk2-engines-pixbuf \
> xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable imagemagick x11-apps google-chrome-stable
Reading package lists... Done
Building dependency tree... 50%
Building dependency tree
Reading state information... Done
E: Unable to locate package google-chrome-stable
root@homestead:/home/vagrant#
root@homestead:/home/vagrant# apt install -y google-chrome-stable/stable
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package google-chrome-stable
root@homestead:/home/vagrant# 

svpernova09 avatar Oct 02 '22 19:10 svpernova09