Install Chromium on Ubuntu from Debian instead of Snap

UPD: Consider using Ungoogled Chromium — privacy focused Chromium without dependency on Google web services (you can still use extensions). There is an OBS repo for Ubuntu available.

Alternatively, you could install Chromium or Ungoogled Chromium with Flatpak.


As you might know, starting from 19.10 Ubuntu ships with Chromium as a snap with no option to install it as a deb package. IMO, snap is still not polished enough to become default, having drawbacks like slow app first startup, integration issues sometimes, etc. I hope some day it will shine, but until then, users have to have a choice.

I get Ubuntu devs arguments: stop wasting too much time to package for different Ubuntu versions with different tools and dependencies — better package once and use this time/resources in more productive ways. But there are other ways of achieving this, rather than going snap-only, like use package from Debian verbatim (you know, like it's done with 99% of packages in Ubuntu).

So that's exactly what we're going to do: use package from Debian.

I know, I know: Ubuntu devs don't recommend to use packages from Debian. And I generally agree with that. But you know what, I don't recommend Ubuntu devs to force Calculator that takes 5 seconds to start from SSD on their users. Anyway, we are going to configure apt to never install anything from Debian repos except for Chromium and a couple of dependencies not available in Ubuntu.

  1. Set preferences for Debian repos in general and Chromium package in particular:

    sudo tee /etc/apt/preferences.d/chromium.pref << EOF > /dev/null
    Package: *
    Pin: origin "deb.debian.org"
    Pin-Priority: -10
    
    Package: chromium* libevent-2.1-6 libicu63 libjpeg62-turbo libvpx5
    Pin: origin "deb.debian.org"
    Pin-Priority: 999
    EOF
    

  2. Add Debian repos:

    sudo tee /etc/apt/sources.list.d/debian.list << EOF > /dev/null
    deb http://deb.debian.org/debian/ stable main #Debian stable
    deb http://deb.debian.org/debian/ stable-updates main #Debian updates
    deb http://deb.debian.org/debian-security stable/updates main #Debian security updates
    EOF
    

  3. Install Debian signing keys:

    sudo apt install debian-archive-keyring && \
    sudo apt-key add /usr/share/keyrings/debian-archive-keyring.gpg
    

  4. Update package lists: sudo apt update
    First update will take some time, as it needs to download about 50MB of package information data.

  5. Check that our package preferences work as intended: apt-cache policy chromium linux-base

    It should list chromium from Debian as a candidate, but linux-base should be from Ubuntu (even if Debian has newer version, as in example below):

    chromium:
      Installed: (none)
      Candidate: 83.0.4103.116-1~deb10u3
      Version table:
        83.0.4103.116-1~deb10u3 999
            -10 http://deb.debian.org/debian stable/main amd64 Packages
            -10 http://deb.debian.org/debian-security stable/updates/main amd64 Packages
    linux-base:
      Installed: 4.5ubuntu3.1
      Candidate: 4.5ubuntu3.1
      Version table:
        4.6 -10
            -10 http://deb.debian.org/debian stable/main amd64 Packages
            -10 http://deb.debian.org/debian stable/main i386 Packages
    *** 4.5ubuntu3.1 500
            500 http://no.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
            500 http://no.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages
            500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
            500 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages
            100 /var/lib/dpkg/status
        4.5ubuntu3 500
            500 http://no.archive.ubuntu.com/ubuntu focal/main amd64 Packages
            500 http://no.archive.ubuntu.com/ubuntu focal/main i386 Packages
    

  6. Install Chromium: sudo apt install chromium