Before we go any deeper with this, I’d like to confess that I am in no way an expert on Linux. Since the Crostini project first emerged and brought Linux applications to Chrome OS, I have been quite busy researching the various Linux distros and more specifically, how apps are packaged and handled on said distributions. I’m learning as I go and that’s why I was excited to start this new Command Line series. I enjoy tinkering and I’m happy to test new things and tread uncharted waters so that you don’t have to.
In my explorations, I’ve have spent a lot of time figuring out how to install different types of packages via Linux on Chrome OS. You have the “native” .deb files that will generally install with a simple double click. Then, you have a variety of .tar or “tarballs” that require unpacking by various means before they can be made executable. Next, there are “standalone” applications that consist of a file that contains all the necessary information to run directly from the image. (It’s a bit more technical than that but this is an easy way to picture how these apps work) We’ve covered Flatpaks and Appimages but the other popular packages are Snaps.
Snaps (snap packages) are available for all major Linux distributions and can be installed on other distros using the applicable installation methods that can be found here. For general users, Snaps offer a big advantage as they can be found in places such as the official Snap Store and installed with one click or a single command line code. Having a storefront for the apps creates a more familiar environment for users who are accustomed to using shops like the Play Store, the Chrome Web Store, iTunes, etc.
For Debian 9 and 10, Snaps can be installed directly from the command line but unfortunately, they don’t work quite as well as they do on traditional Linux operating systems. For months, I have tried to install Snapd (the daemon responsible for installing and running Snaps) on my Chromebook only to fail miserably as my terminal spit out errors that made absolutely no sense to me as a Linux “newbie.” Thankfully, there are those that know a lot more about how these things work and a little trip over to Reddit provided me with the answers I was looking for to get this working.
Caveats: This installation works and it will allow you to install Snap packages. However, it does not work well and depending on the application, you may encounter any number of compatibility issues. Skype, for example, requires changing the permissions for the root directory. Other applications need access to xhost in order to run a GUI and this requires an additional set of commands. We will go into those in-depth at a later time. For now, this article will focus entirely on installing snapd, required dependencies and running your first Snap package.
Okay, let’s get started. Before we install snapd, we will get the required dependencies installed. Snaps use FUSE and squashfs to mount packages among other things. If you install snapd without installing these dependencies, you will get an error when trying to download and install and Snaps. To install, run the following command in your terminal. If prompted, hit “y” to continue and wait for the installation to complete.
sudo apt install libsquashfuse0 squashfuse fuse
Now it’s time to install snapd. It is available directly from the Debian repository and can be installed using the apt command below. Once it is finished, we’ll be ready to install our first Snap.
sudo apt install snapd
Now that you’ve installed snapd, you may see the following warning.
Warning: /snap/bin was not found in your $PATH. If you've not restarted your session since you installed snapd, try doing that. No worries. Simply close the terminal and reopen it for a fresh session. Next, we’ll install a test Snap. Run the following command to install the “hello-world” snap.
sudo snap install hello-world
This will take a few to install but once it is finished, you should be able to type hello-world and hit enter. If the installation was a success, your output will be Hello World! If you succeeded, we will move on to installing a full-blown application.
I have had success installing Gimp’s Snap package and it is a very popular image editor. So, we will now install Gimp. Note, you will always need to use the “sudo” command when installing Snaps. To install Gimp, use this command and go grab a cup of coffee because it will take a few minutes to download.
sudo snap install gimp
Once the install is finished, you can type gimp in the terminal to launch the program. I did notice that the first time loading took some time as Gimp updated extensions and files but after closing my terminal and running it a second time, it ran a lot smoother.
So, where can you find more Snaps to install? As I mentioned before, the Snap Store contains a ton of applications and each one will give you the command to install the Snap from the terminal. Once installed, just type the application name in the terminal to launch it. If you’re unsure of the exact file name, type snap list in the terminal to see all of your installed Snaps and their filename. You can find the Snap Store here.
Because I know someone will mention it, yes, you can install the Snap Store Snap package and it will run on a Chromebook. However, it takes forever to launch. It throws all kinds of errors and I have not been able to sign into the Snap Store once it launches which prevents you from actually downloading Snaps with the install button. If you have found a fix or workaround for this, please shoot me an email or drop a comment below. I’d love to get it working. To sum up, I wouldn’t recommend using Snaps on Chrome OS unless it was your only option to install an application. There are a lot of alternatives out there for most apps and until Snaps run smoother on Chrome OS, it’s just more trouble than it’s worth. Either way, it was fun and interesting to finally get this working. See you next time when we explore how to change your default container from Debian to Ubuntu.
Big shout out to WPWoodjr for figuring out the missing pieces for Snaps on Chrome OS and also for walking me through some of this.