Command-Line

chromium-browser - 無法從命令行啟動站點

  • April 20, 2022

我有一個靜態 html 網站,位於localhost. 當我打開 Chromium 並手動輸入localhost地址欄時,該網站會出現並且行為正確。

但是,當我從終端鍵入以下內容時…

chromium-browser localhost

… Chromium 打開,localhost出現在地址欄中,但頁面永遠不會載入,我最終得到“你想等待”。

我正在執行樹莓派

lsb_release -a

No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

貓 /proc/版本

Linux version 5.15.32-v8+ (dom@buildbot) (aarch64-linux-gnu-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022

如何從命令行啟動頁面?

ETA:之後我嘗試了以下網址chromium-browser

每個都有相同的結果。

在終端視窗中出現以下錯誤消息(我正在使用我的 google-fu 來查看這些消息是否會引導我找到解決方案):

libEGL warning: DRI2: failed to authenticate
[6181:6181:0420/125426.351921:ERROR:gpu_init.cc(454)] Passthrough is not supported, GL is egl, ANGLE is
[6181:6181:0420/125426.457777:ERROR:viz_main_impl.cc(188)] Exiting GPU process due to errors during initialization
libEGL warning: DRI2: failed to authenticate
[6312:6312:0420/125429.016432:ERROR:gpu_init.cc(454)] Passthrough is not supported, GL is egl, ANGLE is
[6312:6312:0420/125429.154421:ERROR:viz_main_impl.cc(188)] Exiting GPU process due to errors during initialization
[6358:6358:0420/125429.257975:ERROR:egl_util.cc(74)] Failed to load GLES library: /usr/lib/chromium-browser/libGLESv2.so: /usr/lib/chromium-browser/libGLESv2.so: cannot open shared object file: No such file or directory
[6358:6358:0420/125429.298887:ERROR:viz_main_impl.cc(188)] Exiting GPU process due to errors during initialization
[6367:6367:0420/125429.388139:ERROR:gpu_init.cc(454)] Passthrough is not supported, GL is disabled, ANGLE is
[6129:6186:0420/125436.969258:ERROR:chrome_browser_main_extra_parts_metrics.cc(227)] START: ReportBluetoothAvailability(). If you don't see the END: message, this is crbug.com/1216328.
[6129:6186:0420/125436.969526:ERROR:chrome_browser_main_extra_parts_metrics.cc(230)] END: ReportBluetoothAvailability()

我發現這篇文章:https ://forums.raspberrypi.com/viewtopic.php?t=330711#p1990605

我盲目地嘗試了它的建議,即執行以下操作:

echo 'export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --use-gl=egl"' | sudo tee /etc/chromium.d/egl

(也就是說,它創建一個文件/etc/chromium.d/egl,其中包含設置該 envar 的命令)。

有效。有一天,我什至可能會嘗試了解原因。

引用自:https://unix.stackexchange.com/questions/699712