Use Ubuntu instead of Debian on a Chromebook

If you prefer stability and security, then sticking with the default Debian container is the best choice. If not, you can switch to Ubuntu, as it provides more flexibility and software options. There are plenty of LXD images you can use, so you are not restricted to Ubuntu either.

1. Boot up your Chromebook. Do not open any Linux app. Open the Chrome browser and press Ctrl + Alt + T to launch the Crosh shell.

Start the terminal with this command:

vmc start termina

2. The default Debian container is labeled as “penguin,” which is used to integrate with the Chrome OS filesystem. To replace Debian, we will first need to strip the Debian container of its “penguin” label:

lxc stop penguin --force lxc rename penguin debian

3. Next, create a new Ubuntu container named penguin:

lxc launch ubuntu:18.04 penguin

This will take quite some minutes to install.

4. Once this is downloaded, boot into the new ubuntu-linux container:

lxc exec penguin -- bash

5. Update and upgrade the system with these commands (no sudo is needed, because you are in root mode):

apt update apt upgrade

6. Install the Crostini packages so it can integrate with the native filesystem.

Enter the following commands to add the cros-packages’ repo (one per time):

echo "deb https://storage.googleapis.com/cros-packages stretch main" > /etc/apt/sources.list.d/cros.list if [ -f /dev/.cros_milestone ]; then sudo sed -i "s?packages?packages/$(cat /dev/.cros_milestone)?" /etc/apt/sources.list.d/cros.list; fi apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1397BC53640DB551 apt update

Install the dependencies:

apt install binutils

7. Even though we added the repo, we won’t be able to install the Crostini packages directly.

Here is the method to download the Crostini package with this command:

apt download cros-ui-config

You will receive a warning message. Ignore it.

Now extract the downloaded packages:

ar x cros-ui-config_0.12_all.deb data.tar.gz gunzip data.tar.gz tar f data.tar --delete ./etc/gtk-3.0/settings.ini gzip data.tar ar r cros-ui-config_0.12_all.deb data.tar.gz rm -rf data.tar.gz

Install the Crostini package from the deb file:

apt install cros-guest-tools ./cros-ui-config_0.12_all.deb

8. Lastly, remove the downloaded package:

rm cros-ui-config_0.12_all.deb

9. Install the "adwaita-icon-theme-full" package. Without this package GUI Linux apps may have a very small user Interface.

apt install adwaita-icon-theme-full

10. The default user in the container is “ubuntu.” We need to remove it and replace with your Gmail username. Using your Gmail username (the Gmail account you use to sign in to your Chromebook) is essential if you want to integrate this Ubuntu container with the native filesystem. Without this, you won’t be able to access your Linux files from the File manager.

killall -u ubuntu groupmod -n chrome-username ubuntu usermod -md /home/chrome-username -l chrome-username ubuntu usermod -aG users chrome-username loginctl enable-linger chrome-username sed -i 's/ubuntu/chrome-username/' /etc/sudoers.d/90-cloud-init-users

Note: replace “chrome-username” with your own Gmail username. Just the username, without @gmail.com.

11. Once this is completed, shut down the container

shutdown -h now

and reboot the Chromebook. Once restarted, start the Terminal application from the launcher. It takes some time to launch.

If it fails, try again.

12. Try updating the system again.

sudo apt update

If you see the error message:

The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 7638D0442B90D010 NO_PUBKEY 04EE7237B7D453EC

that is because the private key of the Crostini package is not found in the system. Add the private key with the command below:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 8B48AD6246925553

and you should be able to run apt update with no issue.

You can now start to install Linux apps with the apt install command. For example, to install Libreoffice use the command:

sudo apt install libreoffice

Removing the Debian container

If you have no more use for the Debian container, you can remove it to free up storage space.

1. In the Chrome browser, press Ctrl + Alt + T to launch the Crosh shell.

2. Start the terminal:

vmc start termina

3. Remove the Debian container:

lxc delete debian