From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Chromium and the translation is 79% complete.
Outdated translations are marked like this.
Other languages:

Chromium 是Google Chrome 网络浏览器的开源版本。 它具有最小的用户界面、强大的网络开发工具和内置的任务管理器。 Chromium 项目处于实施新 Web 标准的最前沿。

Because Chromium is open source it is legally unable to include several features that the proprietary Google Chrome browser includes by default. Namely automatic updates. A complete list of the differences can be found in the chromium repository.


USE 标记

USE flags for www-client/chromium Open-source version of Google Chrome web browser

X Add support for X11
component-build Split build into more shared libraries to speed up linking. Mostly intended for debugging and development, NOT RECOMMENDED for general use.
cups Add support for CUPS (Common Unix Printing System)
custom-cflags Build with user-specified CFLAGS (unsupported)
debug Enable DCHECK feature with severity configurable at runtime. Mostly intended for debugging and development, NOT RECOMMENDED for general use.
gtk4 Build with GTK4 headers.
hangouts Enable support for Google Hangouts features such as screen sharing
headless Build Ozone only with headless backend, NOT RECOMMENDED for general use.
js-type-check Enable JavaScript type-checking for Chrome's web technology-based UI. Requires Java.
kerberos Add kerberos support
libcxx Use bundled libc++ instead of libstdc++ for building.
lto Build with Link Time Optimizations (via clang's ThinLTO)
official Enable Official build instead of Developer build.
pgo Build with Profile Guided Optimizations (2-stage compilation)
pic Disable optimized assembly code that is not PIC friendly
proprietary-codecs Enable codecs for patent-encumbered audio and video formats.
pulseaudio Add support for PulseAudio sound server
qt5 Add support for the Qt 5 application and UI framework
screencast Enable support for remote desktop and screen cast using PipeWire
selinux !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
suid Build the SUID sandbox, which is only needed on CONFIG_USER_NS=n kernels
system-av1 Use system libaom and dav1d instead of the bundled one.
system-ffmpeg Use system ffmpeg instead of the bundled one
system-harfbuzz Use system harfbuzz instead of the bundled one.
system-icu Use system icu instead of the bundled one
system-png Use system libpng instead of the bundled one.
vaapi Enable Video Acceleration API for hardware decoding
wayland Enable dev-libs/wayland backend
widevine Unsupported closed-source DRM capability (required by Netflix VOD)


为了避免与 dev-libs/libxml2 的安装版本发生冲突,从而阻止 Chromium 的安装,必须在 /etc/portage/make.conf 中设置 icu USE 标志。如果 icu 是新设置的,在安装 Chromium 之前需要更新系统,执行:

root #emerge --ask --update --deep --newuse @world

l10n (语言)

Chromium 中的 USE_EXPAND 有许多可用的语言。事实上,它们多到维基无法显示所有。要获得完整的语言列表,请运行:

user $equery u www-client/chromium | grep l10n
equery 工具是 app-portage/gentoolkit 软件包的一部分。需要安装它才能使用上述命令。

有关本地化的更多信息,请参阅 本地化文章


请注意,编译 Chromium 会占用大量时间、CPU 时间和系统内存。每个 make 线程允许 2Gb 的 RAM(由 MAKEOPTS 定义,请参阅 这篇文章)。在系统负载较重的情况下构建 Chromium 可能不是一个好主意。

根据需要设置 USE 标志后,使用以下命令 emerge Chromium:

root #emerge --ask www-client/chromium



To build Chromium with Clang, first see Clang#Clang_environments.

For Chromium specifically, the following env settings are needed:

FILE /etc/portage/env/clang-chromium
# Optionally, add these to EXTRA_GN:
# - thin_lto_enable_optimizations=true 
# - use_thin_lto=true
# - is_cfi=true 
EXTRA_GN="use_lld=true is_clang=true clang_use_chrome_plugins=false" 
# Needed with GCC 11

Then enable it (note that we take the base Clang config from the other article, then add the settings we just defined):

FILE /etc/portage/package.env
# compiler-clang: build with a general Clang environment (see Clang article)
# clang-chromium: build with tweaks specifically for Chromium
www-client/chromium compiler-clang clang-chromium


Chromium 的视觉输出通常不与 Desktop environment 的 DPI 缩放关联。可以使用 --force-device-scale-factor 命令行选项指示它以缩放模式启动。此选项可以传递一个整数或十进制值。标准缩放从 1.0 开始。例如,要将 Chromium 的 UI 放大 1.5 倍:

user $chromium --force-device-scale-factor=1.5

可以在 此处 找到命令行开关的完整列表。

本地 Wayland 支持

从版本 87 开始,可以通过传递以下 选项 来启用 Chromium 中的原生 Wayland 支持:

user $chromium --enable-features=UseOzonePlatform --ozone-platform=wayland

要将 Chromium 设置为每次使用 Wayland 后端启动,请在用户的 Chromium 配置文件中附加以下几行:

FILE ~/.config/chromium-flags.conf


从版本 91.0.4472.77 开始,不再可能在 Chrome 标志中禁用标签悬停卡。 Google 也似乎没有优先考虑重新添加此功能。为了禁用它们,你可以将此补丁添加到 Portage:

FILE /etc/portage/patches/www-client/chromium/hover-card.patch
diff --git a/chrome/browser/ui/views/tabs/ b/chrome/browser/ui/views/tabs/
index 59e2d1e1fc..d94947109c 100644
--- a/chrome/browser/ui/views/tabs/
+++ b/chrome/browser/ui/views/tabs/
@@ -2119,6 +2119,7 @@ void TabStrip::OnMouseEventInTab(views::View* source,
 void TabStrip::UpdateHoverCard(Tab* tab, HoverCardUpdateType update_type) {
+  return;
   // We don't want to show a hover card while the tabstrip is animating.
   if (bounds_animator_.IsAnimating()) {
     // Once we're animating the hover card should already be hidden.

另请参阅 添加标签悬停卡的设置


Chrome 网址

与 Firefox 非常相似,Chromium 有许多内部 Chrome 网址(特殊页面),用于额外配置、故障排除、任务管理等。可以通过导航到以下位置访问特殊页面的详尽列表:chrome://about/


  • chrome://components/ - Shows enabled components and provides a button to check for updates for each of them. It is sometimes necessary to manually update the PPAPI Adobe flash module via this interfaces when using Chrome.
  • chrome://chrome/ - Displays the About page which includes version information.
  • chrome://extensions/ - A page to manage extensions.
  • chrome://flags/ - Enable/disable experimental features.
  • chrome://flash/ - Displays special information about the Adobe Flash Player (if it is accessible by Chromium).
  • chrome://gpu/ - Displays information about use of graphics acceleration.
  • chrome://history/ - Displays web history. Also accessible through the sandwich menu or by pressing Ctrl+h.
  • chrome://memory-redirect/ - Measure the memory usage of the browser and per-tab usage.
  • chrome://net-internals/ - Lots of information on network connections.
  • chrome://plugins/ - Shows a list of plugins. Enable/disable them from this interface. (Deprecated in Chrome version 57[1].)
  • chrome://version/ - Displays more version information than the chrome page.



Chromium 中的标签页偶尔会崩溃。这可能由很多原因引起,但最常见的原因之一是系统内存不足。在 Gentoo 上,如果系统正在编译更新 www-client/chromium同时运行 Chromium,这种情况大概率会发生。

free 命令可用于查看系统上有多少可用内存:

user $free -h
              total        used        free      shared  buff/cache   available
Mem:            15G         11G        735M        789M        3.4G        3.1G



  • Firefox — Mozilla's web browser.
  • Chrome — Google's proprietary (closed source) web browser.