How to install Chromium without snap?

66,307

Solution 1

You can use Chromium from the Debian "buster" repository.
For example, if your Ubuntu release is Eoan (19.10):

  1. Remove Ubuntu chromium packages:

    sudo apt remove chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg-extra
    
  2. Add Debian "buster" repository. Create a file /etc/apt/sources.list.d/debian.list with the following content:

    deb [arch=amd64 signed-by=/usr/share/keyrings/debian-buster.gpg] http://deb.debian.org/debian buster main
    deb [arch=amd64 signed-by=/usr/share/keyrings/debian-buster-updates.gpg] http://deb.debian.org/debian buster-updates main
    deb [arch=amd64 signed-by=/usr/share/keyrings/debian-security-buster.gpg] http://deb.debian.org/debian-security buster/updates main
    
  3. Add the Debian signing keys:

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DCC9EFBF77E11517
    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 112695A0E562B32A
    
  4. Store GPG keys in /usr/share/keyrings

    sudo apt-key export 77E11517 | sudo gpg --dearmour -o /usr/share/keyrings/debian-buster.gpg
    sudo apt-key export 22F3D138 | sudo gpg --dearmour -o /usr/share/keyrings/debian-buster-updates.gpg
    sudo apt-key export E562B32A | sudo gpg --dearmour -o /usr/share/keyrings/debian-security-buster.gpg
    
  5. Configure apt pinning. Create a file /etc/apt/preferences.d/chromium.pref with the following content:

    # Note: 2 blank lines are required between entries
    Package: *
    Pin: release a=eoan
    Pin-Priority: 500
    
    Package: *
    Pin: origin "deb.debian.org"
    Pin-Priority: 300
    
    # Pattern includes 'chromium', 'chromium-browser' and similarly
    # named dependencies:
    Package: chromium*
    Pin: origin "deb.debian.org"
    Pin-Priority: 700
    
  6. Install Chromium again

    sudo apt update
    sudo apt install chromium
    

This should install the latest chromium from the debian-security repository and look like this:

$ sudo apt install chromium
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  chromium-common chromium-sandbox libjpeg62-turbo libminizip1 libre2-5
Suggested packages:
  chromium-l10n chromium-shell chromium-driver
The following NEW packages will be installed:
  chromium chromium-common chromium-sandbox libjpeg62-turbo libminizip1 libre2-5
0 upgraded, 6 newly installed, 0 to remove and 9 not upgraded.
Need to get 56,6 MB of archives.
After this operation, 202 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://de.archive.ubuntu.com/ubuntu eoan/universe amd64 libminizip1 amd64 1.1-8build1 [20,2 kB]
Get:2 http://ftp.de.debian.org/debian buster/main amd64 libjpeg62-turbo amd64 1:1.5.2-2+b1 [134 kB]
Get:3 http://de.archive.ubuntu.com/ubuntu eoan/universe amd64 libre2-5 amd64 20190801+dfsg-1 [162 kB]
Get:4 http://ftp.de.debian.org/debian-security buster/updates/main amd64 chromium-common amd64 79.0.3945.130-1~deb10u1 [257 kB]
Get:5 http://ftp.de.debian.org/debian-security buster/updates/main amd64 chromium amd64 79.0.3945.130-1~deb10u1 [55,9 MB]
Get:6 http://ftp.de.debian.org/debian-security buster/updates/main amd64 chromium-sandbox amd64 79.0.3945.130-1~deb10u1 [141 kB]

As you can see, only Chromium related packages are fetched from the Debian repository, but all others like libminizip1 still come from your Ubuntu repository.

Solution 2

If you can live with Chrome instead of Chromium, you can use the officially provided Debian package from Google:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt install ./google-chrome-stable_current_amd64.deb

You can get the download URL from the normal Chrome download page, then scroll to the very bottom of the page and select "other platforms". The URL is not directly displayed but you can see it in your download history.

apt instead of dpkg also takes care of installing all dependencies – which snap is not one of.

From reading a few files in that package, I have the impression that it installs a cron job that automatically updates the Chrome installation, just like we know it from Windows. So this looks like a pretty solid solution to me, without tinkering with package sources from other distributions or even personal PPAs. And it might even be available for longer, no need for procedure updates with a new distro version.

I've installed this in Ubuntu 20.04 LTS and it works for me, but I'm only using it headless on a web server. The package includes config files for graphical desktop environments, too, though.

Solution 3

For the time being, the chromium-beta PPA also works fine & does not require snap: https://launchpad.net/~saiarcot895/+archive/ubuntu/chromium-beta

To add this PPA:

sudo add-apt-repository ppa:saiarcot895/chromium-beta
sudo apt-get update

Solution 4

Chromium is now available in Flatpak packaging format on Flathub: https://flathub.org/apps/details/org.chromium.Chromium

Although Flatpak is similar to Snap, I think it matches the freedom standards that many Linux users are usually looking for, much better than Snap.

Solution 5

For completeness: Another option is to use nix:

# Install nix
curl -L https://nixos.org/nix/install | sh
. /home/$USER/.nix-profile/etc/profile.d/nix.sh
nix-env --install chromium
chromium

Unfortunately, for getting chromium into your launcher, you'll need to execute whereis chromium and, supposed the outcome is /nix/store/bpmjh6lpsfn3fwrkqx9kp1013x4hqk2y-user-environment/bin/chromium, create ~/.local/share/applications/chromium.desktop (e.g. by gedit ~/.local/share/applications/chromium.desktop) like

[Desktop Entry]
Name=chromium
Exec=/nix/store/bpmjh6lpsfn3fwrkqx9kp1013x4hqk2y-user-environment/bin/chromium
Comment=
Terminal=false
Icon=gnome-panel-launcher
Type=Application

While this basically works, chromium sometimes hangs with this solution, I have no clue why. So if you are ok with the Debian-solution, stick to it.

Share:
66,307

Related videos on Youtube

lonix
Author by

lonix

Updated on September 18, 2022

Comments

  • lonix
    lonix almost 2 years

    I just discovered that chromium will only be released as a snap package.

    How can I continue to get chromium, without snap? Is this possible without building from source?

    Notes:

    • Please let's keep to the question as stated - not "what do you have against snap?"
    • I'm not asking how to remove snap - just how to use chromium as it is now, a deb.

    Update

    No, this is not a duplicate of that linked question. I don't need to know "why it's a snap". I want to know how to use it without snap.

    Right now there is building from source, and some random PPA mentioned below. I hope someone can advise us of trustworthy alternatives.

    • DK Bose
      DK Bose over 4 years
      I don't use chromium but does askubuntu.com/a/1200343/248158 work for you?
    • lonix
      lonix over 4 years
      @DKBose I'm very (VERY!) tempted to use that ppa, but without offense to it's maintainers... it's just some random ppa. If it had more "traction" I'd use it. Right now it has only 3 maintainers. I'm gonna keep an eye on it though... thanks!
    • N0rbert
      N0rbert over 4 years
    • lonix
      lonix over 4 years
      @N0rbert No but thanks. That is the "why" - I wanted to know how to continue getting it without snap (hopefully as a deb). Maybe with time someone will post a decent solution here, or that PPA will get some traction (I'm wary of it right now).
    • hrzhu
      hrzhu about 4 years
      This is a ppa doesn't look like random. But they only provide dev and beta version. The stable version hasn't updated for a long time. launchpad.net/~chromium-team/+archive/ubuntu/dev
    • j4nd3r53n
      j4nd3r53n about 4 years
      I don't like snap either - I simply removed it from the Ubuntu that I am using atm. It doesn't seem to hamr anything, and I no longer have something using up my loopback devices.
    • lonix
      lonix about 4 years
      @j4nd3r53n You removed snap from ubuntu desktop? I thought that wasn't possible... some things break if you remove snap completely. How did you do it, any good links, etc.?
    • j4nd3r53n
      j4nd3r53n about 4 years
      @lonix No, I just did - it doesn't appear to be an essential part of the system. Depending on what you feel is essential, of course. If you do apt remove ... you should see a list of all the things that are going to disappear. In my case there was one or two which I wouldn't miss any way.
    • Sqerstet
      Sqerstet almost 4 years
      @lonix Uninstalled it too, no problems. It will only come back if you install something which depends on it.
    • Mitar
      Mitar over 3 years
      This is useful to have to install inside Docker images.
    • Brent Bradburn
      Brent Bradburn over 3 years
      The question is well-taken, since apps installed via snap have weird file system access limitations. FWIW, google-chrome-stable probably has the functionality that you need (although --temp-profile is missing so you have to roll-your-own with --user-data-dir). However, if you require Chromium because it's open-source, then why not build from source? One reason I can think of is that updates won't be automatic.
    • Stephen Boston
      Stephen Boston over 3 years
      apt purge snap! And pouf the nasty creature is banished. It's so neat and slick a purging it's like the devs just knew what a terrible terrible thing is snap.
    • Piotr Henryk Dabrowski
      Piotr Henryk Dabrowski over 2 years
    • lonix
      lonix over 2 years
      @PiotrHenrykDabrowski That question is unrelated.
  • lonix
    lonix over 4 years
    This is excellent, and just the sort of cleverness I was looking for! I'm changing the accepted answer to this! Thanks!
  • ʇsәɹoɈ
    ʇsәɹoɈ over 4 years
    I used a similar approach. Details here: askubuntu.com/a/1206502/164224
  • lonix
    lonix over 4 years
    @ʇsәɹoɈ Thanks. I saw that approach but wasn't sure whether to try it. From what I understand ubuntu breaks if snap itself is removed, because it ships various system things as snap. So it's not just chromium. Wasn't that your experience?
  • ʇsәɹoɈ
    ʇsәɹoɈ over 4 years
    @lonix I haven't removed snapd from my system yet, but snap list tells me that the only things it currently manages are itself and gtk-common-themes. I might just leave it installed, in case Canonical ends up replacing more important deb packages with snaps. (I might also drop Ubuntu if they do that.) As long as there isn't a snap directory cluttering my home dir, I can tolerate snapd lurking in the background for now. It might even become useful to me if they fix bug 1575053 and learn from their mistake there.
  • lonix
    lonix over 4 years
    "I might also drop Ubuntu"... Considering this too. It's just too much of a hassle to switch, even if it's to Debian.
  • pruflyos
    pruflyos over 4 years
    I doubt that snap will be used for important system packages or security critical system updates. Anyway, right now it is save to be removed completely. You'll notice when another Ubuntu deb package requires it as a dependency in the future and asks to install it again.
  • pruflyos
    pruflyos over 4 years
    Apart from snapd being an additional system service running in the background all the time, every snap is mounted as a separate loop device. I don't think that's scalable from a UX perspective. There are so many Linux programs that are suddenly spammed by all those loop devices snapd creates. df -h being just one example. Imagine having 30 snaps or so one day :-) Ubuntu would have to patch so many different applications to hide the snap loop devices from their output.
  • Ferroao
    Ferroao over 4 years
    security deb gave me error, have to use: deb security.debian.org buster/updates main contrib non-free
  • jarno
    jarno over 4 years
    I wonder why Ubuntu does not provide that debian package in its repository?
  • Chen Noam
    Chen Noam about 4 years
    Does adding these repos have any side-effects for other packages?
  • lonix
    lonix about 4 years
    This was already mentioned above. It may be an option for some people, but keep in mind it's just some random PPA - who knows whether it's safe to use? The approach in the accepted answer ensures you get chromium without malware.
  • Sachin
    Sachin about 4 years
    @lonix their project is open source though - github.com/saiarcot895/chromium-ubuntu-build . Also its totally up to date , the accepted answer will install chromium 80 if that matters for someone
  • Sqerstet
    Sqerstet almost 4 years
    Perhaps not a good idea, in general, to use a random PPA for such sprawling software as a browser. Auditability near zero even if it is open source.
  • James Bradbury
    James Bradbury almost 4 years
    Thanks @Ferroao. When I added "deb security.debian.org/debian-security buster/updates main contrib non-free" to debian.list instead of the last line above, it worked!
  • Ferroao
    Ferroao almost 4 years
    @jamesBradbury I ended uninstalling this because debian dependencies cause dependency nightmare for other ubuntu packages.
  • Ferroao
    Ferroao almost 4 years
    @jamesBradbury I think i got problem installing libssl-dev libsasl2-dev or ubuntu versions of them.
  • Zouppen
    Zouppen almost 4 years
    After this answer Debian has changed their repository from ftp subdomain to deb. See wiki.debian.org/SourcesList#Example_sources.list
  • Lorenz Keel
    Lorenz Keel almost 4 years
    System76's employee themselves don't recommend using Pop!_OS' PPA over Ubuntu. There is a warning as well in the PPA page. For reference, askubuntu.com/a/1188837
  • Michael Butler
    Michael Butler almost 4 years
    Do NOT do this. I almost screwed up my laptop (Kubuntu 20.04) massively. I had to use ppa-purge to fix everything. What happened was that by adding the system76/pop repository, the next time I ran the standard package updates (Software Updates) it ended up basically installing all of PopOS along with Gnome, GDM3, and it even changed Grub!
  • HippoMan
    HippoMan over 3 years
    Agreed about the risk of using a random PPA. However, the snap-based chromium cannot access files on my separately-mounted /opt filesystem. The non-snap chromium has no such limitation. Until or unless the snap version ever is able to access all the filesystems on my device, I am willing to live with the risk of a PPA-based version.
  • John Rose
    John Rose over 3 years
    The above 85.0.4183 18.04.2 packages have been removed. I then tried the 85.0.4183 20.04.2 packages. Even though they installed (after displaying some software channel nonsense), Chromium was not available as an app (i.e. using Activities or the nine dots on the Ubuntu standard screen).
  • John Rose
    John Rose over 3 years
    I entered previous comment again as it cut me off while I was looking up details in repo index. The above 85.0.4183.83 18.04.2 packages have been removed. I then tried the 85.0.4183.83 20.04.2 packages. Even though they installed (after displaying some software channel nonsense), Chromium was not available as an app (i.e. using Activities or the nine dots on the Ubuntu standard screen). I then tried the 86.0.4640.75 18.04.1 packages and they installed OK:, though I had to do the codecs package install first due to dependency problem when I tried the browser package install first.
  • Pynchia
    Pynchia over 3 years
    It did not work for me. How do you remove all those components now?
  • David Georg Reichelt
    David Georg Reichelt over 3 years
    Just get rid of the nix folders: stackoverflow.com/questions/51929461/how-to-uninstall-nix If you would further specify why installing chromium using nix did not work for you, it would maybe be possible to provide a solution, in case others also stumble over the problem.
  • user2364305
    user2364305 over 3 years
    Just install the flatpak! I fixed all the issues with this answer, only to find I installed a pre-covid version of Chrome... Which crashed like a mother on the RPi4 with Disco Donkey. flatpak install org.chromium.chromium is great
  • Darren G
    Darren G over 3 years
    Strange how Ubuntu can simply use thousands of packages from Debian, but are unable to do so for Chromium.
  • undsoft
    undsoft over 3 years
    I realise you're just venting snark, but for anyone reading, it's partly because we're supporting multiple (5) stable releases of Ubuntu, so we don't use the debian package of chromium, because that's only updated in stable/unstable/experimental. We support 14.04/16.04/18.04/20.04/20.10/21.04.
  • TheAlphaReturns
    TheAlphaReturns over 3 years
    Yes, chromium will get updates, you should manually look for the latest versions of chromium :)
  • Chris1804505
    Chris1804505 over 3 years
    Running Virtual machines?? no freaking way..
  • Archisman Panigrahi
    Archisman Panigrahi over 3 years
    This PPA seems to be discontinued (last updated in 2019).
  • Heisenberg
    Heisenberg over 3 years
    How do I update this version?
  • Brent Bradburn
    Brent Bradburn over 3 years
    There is a package google-chrome-stable in the standard repositories for Ubuntu 20.04 (I probably originally installed via "Software Boutique"), so you don't need to do anything this exotic.
  • axblount
    axblount over 3 years
    @nobar I see that I have that package installed on my system. I also noticed it was updated some time ago. So I think what I downloaded was just a copy of that package and it's more easily available through apt indeed.
  • user2364305
    user2364305 over 3 years
    It is much faster... but the AUR and the Flatpak have a crippling sync bug. The snap is 3 versions out of date. Annoying position to be in. I'll try the beta Flatpak I guess. If Xenial was an option, I could just have a deb.
  • stephenfjohnson
    stephenfjohnson about 3 years
    snapd is reinstalled regardless using this method
  • TheAlphaReturns
    TheAlphaReturns about 3 years
    @danger89 you don't need to... Can get from the Ubuntu Archive
  • Timo
    Timo about 3 years
    @nobar, my Lubuntu 20.04 LTs apt cannot find the chrome package.
  • Timo
    Timo about 3 years
    @Zouppen, does the domain change to deb from ftp also refer to the apt pinning /etc/apt/preferences.d/chromium.pref ?
  • Timo
    Timo about 3 years
    @Ferroao your solution did not work, I left the list as is, not changing the 3rd (security) entry.
  • Brent Bradburn
    Brent Bradburn about 3 years
    @Timo: I did some experiments, and apparently google-chrome-stable only shows up for apt after you install via the "Software Boutique". Lubuntu has "Discover", which seems to have different packages available -- so my approach probably won't work for Lubuntu.
  • Timo
    Timo about 3 years
    The thing is that apt install <deb>.deb does not work for Lubuntu I guess, you need package only. So I should have used dpkg but what about dependencies then. I installed with the manual from the top post here. It works,if I get updates,ok, if not I come back to your solution as a basis for a gui chromium;)
  • ʇsәɹoɈ
    ʇsәɹoɈ about 3 years
    @lonix I am now on Ubuntu 20.04.2 LTS and have removed snapd; nothing broke. Chromium is currently at version 90.0.4430.212 and working fine. I also wrote up my approach to using the Debian package instead of the snap: inx.one/blog/debian-repo-on-ubuntu
  • lonix
    lonix over 2 years
    What is the difference between your PPA and the other ones floating around? Same warnings would apply as stated above to any PPA for such a core system programme. I'm not unappreciative for you efforts, just curious.
  • Piotr Henryk Dabrowski
    Piotr Henryk Dabrowski over 2 years
    It contains only official Ubuntu packages from Ubuntu 18.04, where Chromium .deb is still supported.
  • Liso
    Liso over 2 years
    This works on fresh 20.04, I removed both repo and key after installing as I don't frequently update browser.
  • chx101
    chx101 over 2 years
    sudo dpkg -i *.deb Man, this looks dangerous
  • kontextify
    kontextify over 2 years
    Check the current Debian sources.list page for up to date repositories. The default Bullseye example works for me on Impish!
  • lonix
    lonix over 2 years
    A very good option for some people, except they'd have to manage updates themselves. Most users prefer to rely on a package manager.
  • Ganton
    Ganton about 2 years
    That "beta" repo is maintained and can be used. (The "stable" repo is the one which is not maintained, although the "beta" one is available).
  • Admin
    Admin about 2 years
    Following these instructions leads to $ chromium-browser Command '/usr/bin/chromium-browser' requires the chromium snap to be installed. Please install it with: snap install chromium