Advanced Package Tool (apt)
The Advanced Package Tool, also known as apt is the default package manager on Debian based Linux distributions such as the one that ships on most ChromeOS devices. Apt seamlessly handles package installations and package updates via a few simple commands. Apt is a command-line-based tool (cli) that is executed via the ChromeOS Linux Terminal application. In addition to managing user-installed packages, apt will also update all system-level packages in your Linux installation.
This website and the line of ChromeOS.Guide books make heavy use of apt when providing instructions to install applications on ChromeOS devices. It is strongly advised for users to be familiar with the use of apt if they choose to take full advantage of Linux on their devices.
The use of sudo
The apt package manager performs global changes to your ChromeOS Linux Environment and as such, most commands require the use of the Linux sudo
command, which grants apt the ability to make system-wide changes. This website will only contain curated content that should be safe to perform without the risk of causing issues with your ChromeOS instance. It is still important to carefully read and understand the potential impact of any systemwide change to your ChromeOS Linux Environment.
Installing The Advanced Package Tool (apt)
There is no need to manually install the Advanced Package Tool (apt) as it is already built into your ChromeOS Linux Environment by default.
Apt Application Repositories
The Advanced Package Tool relies on repositories, commonly referred to as "repos". A repository is a catalog of applications that can be installed on your machine. This includes metadata such as the application description, the download path and a list of all dependencies needed to install the application. There are several "default" repositories that are installed as part of the base operating system, however you are also free to add your own repositories or repositories from third party software developers who choose to distribute their applications via apt.
Upstream Debian Repositories
By default, your Linux environment includes several "upstream" repositories managed by Debian Team. These repositories contain the core operating system components that are used to construct the distribution. These upstream repositories also contain thousands of third-party applications that have been (loosely) vetted by the Debian team.
ChromeOS Repositories
In addition to the upstream Debian repositories installed on your ChromeOS device, The ChromeOS Linux Environment includes a repository that is managed by the ChromeOS Team. This repository contains several applications and libraries that are used to provide features that are unique to the integration between ChromeOS and the ChromeOS Linux Environment (such as The ChromeOS File Manager integration and application integration into the ChromeOS Application Launcher).
Using Apt
Updating Apt Database
The Advanced Package Tool creates a local index of packages that are included in all the repositories that are active on your device. This allows apt to quickly locate and install the packages that you wish to install. This index also includes the versions of each package, as well as any dependencies that are required by the applications you wish to install.
Updating the apt package manager index can be done by using the sudo apt update
command. This command must be ran as a privileged user via the sudo command.
sudo apt update
This command should be used when adding a new repository to your ChromeOS device to ensure the applications that are contained in the repository are properly indexed in apt's database.
The apt update
command also updates the version numbers of applications in the apt repositories, which allows apt to identify outdated packages that you have installed on your machine. If there are any packages that need to be upgraded, it can be done via the sudo apt upgrade
command, which will be documented in the next section of this guide.
Updating Applications With Apt
The apt package manager will automatically update any application that is installed on your machine as long as it was installed via apt. This includes all systemwide packages that are installed in your ChromeOS Linux Environment by default. Apt cannot update binary packages that were installed manually or applications installed via a different package manager.
You can update a specific package by running sudo apt upgrade packagename
(replacing "packagename" with the name of the package that you wish to upgrade. You can omit the package name if you wish to allow apt to automatically update all packages installed in your ChromeOS Linux Environment by running sudo apt upgrade
. It is strongly advised that you update the Apt Database prior to upgrading packages via the sudo apt update
command.
The following example will upgrade the nano text editor to the latest release.
sudo apt upgrade nano
The following example will upgrade all packages installed on your machine.
sudo apt upgrade
Installing Applications with Apt
Installing applications in your ChromeOS Linux Environment is done with the apt install
command, where you specify the name of the package you would like to install. The ChromeOS.Guide website is building a catalog of some of the more popular Linux Applications that run well on ChromeOS, complete with instructions to install the application. Most, if not all of these cataloged applications will be installed via apt.
The following example will install the nano text editor with apt.
sudo apt install nano