Checking out and building Chromium on Linux
Most development is done on Ubuntu (currently 14.04, Trusty Tahr). There are some instructions for other distros below, but they are mostly unsupported.
Install depot_tools
Clone the depot_tools repository:
Add depot_tools to the end of your PATH (you will probably want to put this in your
/.zshrc ). Assuming you cloned depot_tools to /path/to/depot_tools :
Get the code
Create a chromium directory for the checkout and change to it (you can call this whatever you like and put it wherever you like, as long as the full path has no spaces):
Run the fetch tool from depot_tools to check out the code and its dependencies.
If you don’t want the full repo history, you can save a lot of time by adding the —no-history flag to fetch .
Expect the command to take 30 minutes on even a fast connection, and many hours on slower ones.
If you’ve already installed the build dependencies on the machine (from another checkout, for example), you can omit the —nohooks flag and fetch will automatically execute gclient runhooks at the end.
When fetch completes, it will have created a hidden .gclient file and a directory called src in the working directory. The remaining instructions assume you have switched to the src directory:
Install additional build dependencies
Once you have checked out the code, and assuming you’re using Ubuntu, run build/install-build-deps.sh
You may need to adjust the build dependencies for other distros. There are some notes at the end of this document, but we make no guarantees for their accuracy.
Run the hooks
Once you’ve run install-build-deps at least once, you can now run the Chromium-specific hooks, which will download additional binaries and other things you might need:
Optional: You can also install API keys if you want your build to talk to some Google services, but this is not necessary for most development and testing purposes.
Setting up the build
Chromium uses Ninja as its main build tool along with a tool called GN to generate .ninja files. You can create any number of build directories with different configurations. To create a build directory, run:
- You only have to run this once for each new build directory, Ninja will update the build files as needed.
- You can replace Default with another name, but it should be a subdirectory of out .
- For other build arguments, including release settings, see GN build configuration. The default will be a debug component build matching the current host operating system and CPU.
- For more info on GN, run gn help on the command line or read the quick start guide.
Faster builds
This section contains some things you can change to speed up your builds, sorted so that the things that make the biggest difference are first.
Disable NaCl
By default, the build includes support for Native Client (NaCl), but most of the time you won’t need it. You can set the GN argument enable_nacl=false and it won’t be built.
Include fewer debug symbols
By default GN produces a build with all of the debug assertions enabled ( is_debug=true ) and including full debug info ( symbol_level=2 ). Setting symbol_level=1 will produce enough information for stack traces, but not line-by-line debugging. Setting symbol_level=0 will include no debug symbols at all. Either will speed up the build compared to full symbols.
Disable debug symbols for Blink
Due to its extensive use of templates, the Blink code produces about half of our debug symbols. If you don’t ever need to debug Blink, you can set the GN arg remove_webcore_debug_symbols=true .
Use Icecc
Icecc is the distributed compiler with a central scheduler to share build load. Currently, many external contributors use it. e.g. Intel, Opera, Samsung (Googlers use an internal system called Goma).
In order to use icecc , set the following GN args:
Using the system linker may also be necessary when using glibc 2.21 or newer. See related bug.
ccache
You can use ccache to speed up local builds (again, this is not useful if you’re using a Googler using Goma).
Increase your ccache hit rate by setting CCACHE_BASEDIR to a parent directory that the working directories all have in common (e.g., /home/yourusername/development ). Consider using CCACHE_SLOPPINESS=include_file_mtime (since if you are using multiple working directories, header times in svn sync’ed portions of your trees will be different — see the ccache troubleshooting section for additional information). If you use symbolic links from your home directory to get to the local physical disk directory where you keep those working development directories, consider putting
in your .bashrc so that $PWD or cwd always refers to a physical, not logical directory (and make sure CCACHE_BASEDIR also refers to a physical parent).
If you tune ccache correctly, a second working directory that uses a branch tracking trunk and is up to date with trunk and was gclient sync’ed at about the same time should build chrome in about 1/3 the time, and the cache misses as reported by ccache -s should barely increase.
This is especially useful if you use git-new-workdir and keep multiple local working directories going at once.
Using tmpfs
You can use tmpfs for the build output to reduce the amount of disk writes required. I.e. mount tmpfs to the output directory where the build output goes:
* note **Caveat: You need to have enough RAM + swap to back the tmpfs. For a full debug build, you will need about 20 GB. Less for just building the chrome target or for a release build. ***
Quick and dirty benchmark numbers on a HP Z600 (Intel core i7, 16 cores hyperthreaded, 12 GB RAM)
- With tmpfs:
- 12m:20s
- 15m:40s
Build Chromium
Build Chromium (the “chrome” target) with Ninja using the command:
You can get a list of all of the other build targets from GN by running gn ls out/Default from the command line. To compile one, pass the GN label to Ninja with no preceding “//” (so, for //chrome/test:unit_tests use ninja -C out/Default chrome/test:unit_tests ).
Run Chromium
Once it is built, you can simply run the browser:
Running test targets
You can run the tests in the same way. You can also limit which tests are run using the —gtest_filter arg, e.g.:
You can find out more about GoogleTest at its GitHub page.
Update your checkout
To update an existing checkout, you can run
The first command updates the primary Chromium source repository and rebases any of your local branches on top of tip-of-tree (aka the Git branch origin/master ). If you don’t want to use this script, you can also just use git pull or other common Git commands to update the repo.
The second command syncs dependencies to the appropriate versions and re-runs hooks as needed.
Tips, tricks, and troubleshooting
Linker Crashes
If, during the final link stage:
You get an error like:
you are probably running out of memory when linking. You must use a 64-bit system to build. Try the following build settings (see GN build configuration for other settings):
- Build in release mode (debugging symbols require more memory): is_debug = false
- Turn off symbols: symbol_level = 0
- Build in component mode (this is for development only, it will be slower and may have broken functionality): is_component_build = true
More links
- Information about building with Clang.
- You may want to use a chroot to isolate yourself from versioning or packaging conflicts.
- Cross-compiling for ARM? See LinuxChromiumArm.
- Want to use Eclipse as your IDE? See LinuxEclipseDev.
- Want to use your built version as your default browser? See LinuxDevBuildAsDefaultBrowser.
Next Steps
If you want to contribute to the effort toward a Chromium-based browser for Linux, please check out the Linux Development page for more information.
How to Install Chromium on Ubuntu 22.04 | 20.04
Chromium Browser is an open-source project that serves as the foundation for the popular Google Chrome browser. Its unique features and compatibility with the Ubuntu operating system make it a compelling choice for users looking to explore alternatives to more widely known browsers. In this introduction, we’ll highlight some of the key reasons why Ubuntu users might want to consider installing or trying out the Chromium Browser over other options.
Why Choose Chromium Browser for Ubuntu?
- Open-Source and Community-Driven: Unlike some proprietary browsers, Chromium is open-source, meaning its codebase is available to the public, allowing for greater transparency and collaboration. This feature often appeals to Ubuntu users who appreciate the open-source nature of their operating system.
- Customization and Extensions: Chromium offers a vast array of extensions and customization options, enabling users to tailor the browser to their preferences. Additionally, many Chrome extensions are compatible with Chromium, providing an extensive selection of tools and features to enhance the browsing experience.
- Frequent Updates and Security Patches: As an open-source project, Chromium benefits from continuous updates and security patches provided by its dedicated community. This ensures that the browser remains secure and up-to-date with the latest web technologies.
- Speed and Performance: Chromium is known for its impressive speed and performance, providing an efficient browsing experience even on low-resource systems. This makes it a particularly attractive option for Ubuntu users running their operating system on older or less powerful hardware.
- Privacy and Security: Chromium puts a strong emphasis on user privacy and security. While it does lack some of the privacy features found in other browsers like Firefox or Librewolf, it still provides a more private browsing experience than some other popular alternatives.
Chromium Browser vs. Popular Alternatives
When comparing Chromium to other popular browsers, some notable differences stand out:
- Google Chrome: While both Chromium and Google Chrome share the same codebase, Chrome is a proprietary browser and includes some additional features not found in Chromium, such as automatic updates and built-in support for Adobe Flash. However, Chromium offers greater transparency and flexibility due to its open-source nature.
- Firefox: Firefox is another popular open-source browser known for its focus on privacy and security. While Chromium has a similar commitment to these values, it may offer better performance and compatibility with certain web technologies due to its shared codebase with Chrome.
- Librewolf: Librewolf is a fork of Firefox that emphasizes privacy and security even more than its parent browser. While Librewolf is an excellent option for those seeking a highly private browsing experience, Chromium may provide better performance and extension compatibility for some users.
To summarize the points above, the Chromium Browser offers a versatile, open-source, high-performance browsing experience that complements the Ubuntu operating system. Its array of customization options, compatibility with Chrome extensions, and commitment to privacy make it a compelling alternative to other popular browsers. In the following guide, we will demonstrate how to install Chromium Browser on Ubuntu 22.04 Jammy Jellyfish or Ubuntu 20.04 Focal Fossa using Librewolf official APT or Flatpak. Note, for short-term Ubuntu releases, the methods for the LTS release in this article will also work unless your Ubuntu short-term release has reached the end-of-life status.
Table of Contents
Section 1: Install Chromium with APT
Step 1: Update Ubuntu System
Before proceeding with the installation of Chromium, it’s essential to update your Ubuntu system. This ensures that all existing packages are up-to-date, helping you avoid potential conflicts during the installation process. To update your system, execute the following command:
Step 2: Choose an Installation Method
There are two main methods to install Chromium on your Ubuntu system: using the Ubuntu repository or using a PPA (Personal Package Archive). Each method has its advantages, so let’s explore both options.
Method 1: Install Chromium with the Ubuntu Repository
The first installation method uses the APT package manager. However, it’s important to note that this method installs Chromium as a Snap package, similar to the default installation of Firefox. If you don’t mind using Snap packages, this method is an excellent choice for you. But if you prefer a non-snap APT method, you may want to consider Method 2, which uses a PPA.
To install Chromium with the Ubuntu repository and Snapcraft, execute the following command:
Method 2: Install Chromium with a PPA
The second method involves using the xtradeb/apps Launchpad PPA, which contains several well-known applications, including the Chromium browser. These applications are updated more frequently, making this PPA a reliable option for installing Chromium.
First, import the PPA by running the following command:
After adding the PPA, update the packages list with this command:
Finally, install Chromium by executing the following command:
Section 2: Install Chromium with Flatpak and Flathub
In this section, we will explore an alternative method to install Chromium using the Flatpak package manager. Flatpak is a universal packaging format similar to Snap, offering benefits such as sandboxing, easy distribution, and increased security for applications like Chromium.
Step 1: Enable Flathub
Before installing Chromium through Flatpak, you must enable the Flathub repository, a primary source for Flatpak applications. To enable Flathub, execute the following command in your terminal:
This command adds the Flathub repository to your Flatpak configuration, ensuring you have access to a wide variety of applications, including Chromium.
Step 2: Install Chromium
With Flathub enabled, you can now proceed to install Chromium using the flatpak install command. Run the following command in your terminal:
This command installs Chromium from the Flathub repository, providing you with the latest version of the browser.
Note: If your system does not have Flatpak installed, please refer to our comprehensive guide on How to Install Flatpak on Ubuntu for step-by-step instructions on installing the most recent supported version of Flatpak. This guide will help you set up Flatpak on your Ubuntu system and ensure that you can take advantage of its benefits when installing applications like Chromium.
Section 3: Launch Chromium Browser
Now that you have successfully installed the Chromium Browser on your system, it’s time to launch it and start browsing. There are several ways to open Chromium, depending on your preferences and installation method.
Step 1: Launch Chromium from Terminal
You can launch Chromium immediately from your terminal by typing the following command:
If you installed Chromium using Flatpak, you would need to use a different command to launch it from the terminal:
While launching Chromium from the terminal can be a quick and convenient method, it might not always be the most practical option for everyday use.
Step 2: Launch Chromium from Desktop Environment
For a more user-friendly approach, you can launch Chromium directly from your desktop environment. To do this, follow these steps:
- Open the Show Applications menu, usually located at the bottom-left corner of your screen.
- Search for “Chromium” in the search bar or browse the list of installed applications.
- Click on the Chromium Web Browser icon to launch the browser.
Example of Chromium Browser application icon on Ubuntu Linux:
Section 4: Getting Started with Chromium Browser
Now that you have Chromium installed and know how to launch it, it’s time to get acquainted with some tips and tricks to make the most of your browsing experience on Ubuntu Linux. This section will provide you with some general tips, customization options, and other helpful suggestions to enhance your Chromium experience.
General Tips
- Stay up-to-date: Keep Chromium updated to the latest version to ensure optimal performance, security, and access to new features. You can check for updates by clicking the three-dot menu in the top-right corner, then selecting Help > About Chromium.
- Use keyboard shortcuts: Speed up your browsing by learning and utilizing Chromium’s keyboard shortcuts. Some common shortcuts include Ctrl+T to open a new tab, Ctrl+W to close the current tab, and Ctrl+Shift+N to open a new incognito window.
- Manage extensions: Enhance Chromium’s functionality by adding extensions from the Chrome Web Store. To manage your extensions, click the three-dot menu > More tools > Extensions.
Customization Tips
- Change the theme: Personalize Chromium’s appearance by applying a custom theme. Visit the Chrome Web Store, search for themes, and click Add to Chrome on your chosen theme to apply it.
- Customize the new tab page: Tailor the new tab page to display your most visited sites, curated news articles, or a custom background by clicking the Customize button at the bottom-right corner of the new tab page.
- Organize bookmarks: Keep your favorite websites easily accessible by organizing your bookmarks. To create folders, right-click the bookmarks bar and select Add folder.
Other Helpful Tips
- Enable dark mode: Reduce eye strain and save battery life by enabling dark mode. Go to Settings > Appearance > Themes and select the dark theme.
- Manage your privacy: Configure your privacy settings to protect your personal information. Visit Settings > Privacy and security to review and adjust your privacy preferences.
- Sync your data: Synchronize your bookmarks, history, and extensions across devices by signing in with a Google account. Click on the profile icon in the top-right corner and follow the prompts to sign in and sync your data.
Example Chromium browser default UI first time launched on Ubuntu Linux:
Section 5: Additional Commands & Tips for Chromium
In this section, we will discuss how to update and uninstall the Chromium browser on your Ubuntu system, depending on the installation method you used. Following these steps will help you keep your browser up-to-date or remove it if you no longer need it.
Updating the Chromium Browser
To ensure optimal performance and security, it is essential to keep your Chromium browser updated. Depending on your installation method, use one of the following commands to update Chromium:
Updating Chromium via APT
If you installed Chromium using the APT package manager, execute the following command in your terminal to check for updates and upgrade all packages, including Chromium:
Updating Chromium via Flatpak
If you installed Chromium with Flatpak, use the following command to update the browser:
Removing (Uninstalling) Chromium Browser
If you no longer need the Chromium browser on your system, use one of the following commands based on your installation method to uninstall it:
Uninstalling Chromium via APT
For users who installed Chromium using the APT and Ubuntu’s repository package manager, execute the following command in your terminal to remove the browser:
Note: Ubuntu’s version uses Snaps, so it is best to use the Snap remove command.
Alternatively, PPA installations can run the following command to remove Chromium:
Uninstalling Chromium via Flatpak
For users who installed Chromium using Flatpak, run the following command to uninstall the browser and delete its associated data:
Closing Thoughts on Installing Chromium on Ubuntu Linux
In this article, we covered different methods for installing the Chromium browser on Ubuntu Linux, including the APT package manager and Flatpak. We also discussed how to launch the browser, shared tips for getting started, and provided additional commands and tips for updating and uninstalling Chromium. By following the steps outlined, you can easily manage your Chromium browser on your Ubuntu system to ensure a secure and efficient browsing experience.
Additional Resources and Links
To help you further explore and get the most out of the Chromium browser, we have compiled a list of official resources and links:
Установка Chromium Ubuntu 20.04
Chromium — очень популярный браузер с открытым исходным кодом, разрабатываемый компанией Google На данный момент он занимает лидирующую позицию на рынке браузеров, несмотря на то, что еще есть Mozilla Firefox, который более популярен в Linux системах. Google выпускает свой браузер в двух редакциях — Google Chrome, с закрытым исходным кодом и сбором статистики об использовании браузера, и Chromium — версия с открытым исходным кодом.
Первая редакция поставляется в виде уже готовых к установке бинарных пакетов, для Chromium же только публикуется исходный код, сборкой, подготовкой бинарников и обновлением занимается сообщество, а точнее, мейнтейнеры дистрибутивов. В этой статье мы рассмотрим как выполняется установка Chromium Ubuntu 20.04, 18.04 или 16.04.
Чем отличается Chromium от Google Chrome
Разница между Google Chrome и Chromium есть и довольно значительная. Chromium — это открытый проект по разработке легкого и быстрого браузера. Он разрабатывается сообществом и разработчиками компании Google. Исходный код браузера полностью открыт и доступен всем.
Google Chrome разрабатывается тоже в Google, но уже на основе Chromium. Он содержит в себе движок Chromium, а также модули Flash и модули для отправки статистики в Google. На базе Chromium разработан не только этот браузер, но и многие другие, включая Opera и Яндекс Браузер.
Установка Chromium в Ubuntu 20.04
Проприетарной версии в официальных репозиториях нет, но поскольку нас интересует свободная, собранная мейнтейнерами, то мы можем установить ее с помощью системного пакетного менеджера без особых проблем. Сначала обновите списки пакетов, чтобы получить самую новую доступную версию:
sudo apt update
Затем наберите для установки:
sudo apt install chromium-browser
Будет установлена та версия, которая была актуальной на момент выпуска дистрибутива, плюс обновления безопасности, если они были. Ещё вы можете установить Chromium с помощью snap пакета:
sudo snap install chromium-browser
Так вы получите самую свежую стабильную версию браузера. Но если вы хотите самую последнюю версию для разработчиков, то вам придется использовать ppa. Для добавления репозитоирия в систему выполните:
sudo add-apt-repository ppa:saiarcot895/chromium-dev
Затем обновите списки пакетов:
sudo apt-get update
И теперь может быть выполнена установка Chromium Ubuntu 16.04:
sudo apt install chromium-browser
Будет установлена версия программы для разработчиков. На данный момент самая свежая — 83, а версия для разработчиков — 85. Вы можете запустить программу через терминал или из главного меню.
Чтобы посмотреть какая у вас сейчас версия наберите в адресной строке браузера chrome://version:
Удалить Chromium
Если вы больше не хотите пользоваться тестовой версией программы, то вы можете откатить ее до версии в репозиториях. Для этого нужна утилита ppa-purge:
sudo apt instal ppa-purge
Теперь удаляем Chromium, полностью удалив PPA и все установленные из него пакеты:
sudo ppa-purge ppa:saiarcot895/chromium-dev
Если вам нужно удалить стабильную версию, установленную из официального репозитория, выполните:
sudo apt remove chromium-browser
Все, программа удалена из вашей системы.
Выводы
Вот и все, в этой небольшой статье мы рассмотрели как выполняется установка Chromium в Ubuntu 20.04. Как видите, все очень просто и если вам достаточно стабильной версии, то вам даже не нужно использовать PPA. Если у вас остались вопросы, спрашивайте в комментариях!
Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.
Устанавливаем Chromium в Убунту или как я снова сменил браузер
В последнее время я заметил, что Google Chrome, при открытии 15 и более вкладок, тормозит, подвисает и делает все, чтобы я нервничал. Установив Chromium я заметил, что при тех же условиях использования он работает намного стабильнее и быстрее. Поэтому в данной статье я поведаю об установке Chromium в Ubuntu.
По сути, Chromium и Google Chrome это близнецы-братья, но именно Chrome основан на Хромиуме, а не наоборот. Браузер от Google — это закрытый проект в котором по умолчанию встроена поддержка Flash, PDF, MP3, а также автообновление браузера до последней версии. Весьма много браузеров основаны на Chromium. Это Yandex Browser, Vivaldi, SRWare Iron, Opera, Comodo Dragon(Chromodo) и многие другие.
Chromium является свободным веб-браузером, который разрабатывают сообщество The Chromium Authors, компания Google и многие другие. По умолчанию в нем отсутствует поддержка несвободных медиа-форматов, автообления, а также нет сбора информации и отправки данных с вашего ПК на удаленные серверы для сбора статистики.
Но все эти недостатки, кроме отправки информации, в Убунту решаются без проблем. Установить Хромиум можно двумя способами.
Способ 1. Можно установить из репозитория Убунту, используя Центр приложений, либо через Терминал, выполнив команду:
sudo apt-get install chromium-browser
Способ 2. Можно установить браузер, подключив сторонний репозиторий:
sudo add-apt-repository ppa:chromium-daily/ppa
sudo apt-get update
sudo apt-get install chromium-browserНачиная с Ubuntu 14.04 есть возможность использовать обновленную версию Flash Player из Google Chrome (Pepper Flash Player). Чтобы установить Pepper Flash Player для Chromium нужно выполнить следующие команды в Терминале:
sudo apt-get install pepperflashplugin-nonfree
sudo update-pepperflashplugin-nonfree —install