59

I am wondering whether or not there is a way to completely remove snap from Ubuntu 19.10 without losing the ability to install important applications like Chromium.

When I just recently updated to the newest Ubuntu release I realized that the installer programmatically reinstalled snap, although I had manually removed it before. Additionally the installer removed Chromium, which was installed via the repositories, and reinstalled it via snap.

As I don't want snap to be installed on my machines for various reasons my question is if anybody knows a safe way to remove it, and to get the Chromium DEB back to the sources?

Is there a PPA? Could I use a source of an Ubuntu flavor additionally, which didn't remove the Chromium Deb from its sources?

Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212
user5950
  • 6,186
  • 3
    The move to chromium as a snap is discussed here. My understanding is that all 19.10 flavors will be providing only the snap. Depending on various factors, the availability of Chromium as only a snap maybe enforced in 18.04 as well. – DK Bose Oct 07 '19 at 11:37
  • 3
    Generically find alternate source of packaging. Specifically there is a chromium beta ppa, https://launchpad.net/~saiarcot895/+archive/ubuntu/chromium-beta and a dev ppa, https://launchpad.net/~saiarcot895/+archive/ubuntu/chromium-dev – doug Oct 07 '19 at 12:26
  • 3
    This IS a a great question once 19.10 is released and we can speak specifically about chromium-browser (which is still a deb package which loads causes the install of snap) Snap packages inside a deb have been used before (currently supported releases, plus EOL) so one of those examples would have been fine even though not as useful to your real currently off-topic want. – guiverc Oct 07 '19 at 22:29
  • The snap does not work on my system for various reasons. It always say permission denied so I need the deb back. – Michael Tsang Oct 28 '19 at 02:23
  • 1
    Not what you're asking but I download the chrome deb from the google chrome site. No snap, – Stephen Boston Nov 04 '19 at 02:02
  • I would not recommend running code from some random person's PPA without auditing it, sandboxing it, or confining it to a machine that never sees sensitive information. It's safer to stick with a high-profile PPA controlled by someone known and trusted in the community, because it is much more likely to be well maintained and subject to scrutiny in that case. Better yet, get chromium packages from the debian archive. I just added an answer that details how to do this. – ʇsәɹoɈ Jan 29 '20 at 19:32
  • Does this answer your question? Chromium without snap – feeela Nov 18 '20 at 12:12

7 Answers7

52

September 2022 Update:

Ubuntu and Debian both got new releases since I originally wrote this article. The exact steps described here might not work on them. (I haven't checked.)

Ubuntu 20.04 users will probably still get good results by replacing stable with buster in the sources.list.d file described below, for as long as Debian continues to support their Buster release.

I am leaving this post in place because it describes general techniques for cherry picking packages from debian-compatible repos for use on different distributions or releases.


Debian Repo Saves the Day!

(Full article here)

Debian still maintains Chromium as a regular package in their APT repository. We can configure Ubuntu to get it from there, and continue to receive timely security updates along with all of our other OS updates. This makes sense from a security perspective, since Debian is where Ubuntu already gets most of its packages, and is a very well known high-profile project. There is no need to risk installing software from some random source or telling your system to trust a PPA.

Obligatory Warning: This is entirely unsupported and could conceivably cause problems either immediately or in the future. If you break something, it's your own fault.

Here's what I did on Ubuntu 19.10:

sudo apt update && sudo apt upgrade

That brings all my already-installed Ubuntu packages up to date, so it will be easier to see how upgrades are affected after I make my changes.

snap remove chromium

Bye bye, annoying snap.

sudo apt purge chromium-browser chromium-chromedriver

Bye bye, fake Chromium packages. (You can leave out the chromium-chromedriver part if that package isn't installed on your system.)

umask 22

That just makes sure that the files I create will be readable by everyone, including the system.

Create an /etc/apt/sources.list.d/debian-stable.list file containing:

deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian stable main
deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian stable main

deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian-security/ stable-security main deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian-security/ stable-security main

deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian stable-updates main deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian stable-updates main

That tells apt to look for packages not only in the Ubuntu archives, but also in the Debian stable archives. This is ordinarily a bad idea, because you don't want hundreds of random Ubuntu packages being replaced with Debian versions, which would very likely break your system. However, we're going to add some rules to avoid this problem.

Note: The /usr/share/keyrings/debian-archive-keyring.gpg file referenced above, along with several other Debian keyring files, are already present on my Ubuntu system thanks to the debian-archive-keyring package. It may already be on your system, too, but if not, you should install it: sudo apt install debian-archive-keyring

Create an /etc/apt/preferences.d/debian-chromium file containing:

Explanation: Allow installing chromium from the debian repo.
Package: chromium*
Pin: origin "*.debian.org"
Pin-Priority: 100

Explanation: Avoid other packages from the debian repo. Package: * Pin: origin "*.debian.org" Pin-Priority: 1

The first stanza assigns a below-normal priority to Debian Chromium packages; just high enough to allow them to be manually installed and automatically updated, but not high enough to be preferred over Ubuntu packages. This is called apt pinning, and is described in the apt_preferences manual. The second stanza assigns a very low priority to all other Debian packages, so they will only be automatically installed or updated if necessary to satisfy a dependency.

(I suppose I could have assigned a much higher priority to Debian's Chromium packages if I needed them to override Ubuntu's, but since they use different package names, no overriding is necessary. I could also have pinned all of the Debian repo at priority 100; that would make any Debian-only dependencies eligible for automatic updates, effectively treating the Debian repo like Ubuntu Backports in manual install mode. I chose the more conservative approach just to be cautious.)

sudo apt update

That refreshes the package database, so my Ubuntu system now knows about everything in the Debian archives that I added.

apt upgrade --simulate

That shows me what a system-wide package upgrade would do, without actually doing it. Since I already did an upgrade before making any changes, I don't expect to see any upgradable packages listed here.

If one or two upgradable packages were listed, it could mean that Ubuntu happened to release some updates while I was working, which is normal. I would ask apt where each of those updates come from before proceeding, with apt policy package-name. If any of them were from the Debian archives, I would consider reverting my changes, by removing the files I created and running sudo apt update again.

If many upgradable packages were listed, it would probably mean that apt now thinks Debian's packages are valid replacements for Ubuntu's packages, which I do not want. This would happen if I made a mistake in those files I created. I would revert my changes, by removing the files I created and running sudo apt update again. I might then consider starting over and typing more carefully.

All was well at this point (no upgradable packages were listed), so I proceeded.

sudo apt install chromium

The package manager then asked me to confirm, listing chromium and a small handful of dependency packages needed by Chromium. Once again, if many packages were listed here, I would investigate and consider reverting my changes. (I investigated each dependency anyway, because I'm careful, and found that only one of the dependencies was coming from the Debian archive: libjpeg62-turbo, and it doesn't conflict with anything I have installed.) All looked well, so I told the package manager to proceed.

When it finished, Chromium was finally installed as an apt package. Thanks, Debian maintainers!

I don't use any snaps, so the next thing I did was to look in the snap directory in my home dir, make sure there was nothing in there that I needed, and then drop it in the trash. If you want to do the same, consider first that any user data that you created/modified/saved in Chromium since the snap was first installed lives somewhere under that snap folder. (Probably under snap/chromium/current/.config which is hidden by default in most file managers.) You might want to back it up or move it to chromium's usual data directory: $HOME/.config/chromium. In my case, the Chromium data that I wanted to keep was still in its old/usual place, since I had only used the snap for about five minutes.

That's it. I hope it helps someone. If it damages your system, steals your bike, runs off with your boyfriend, or does something else that you don't like, then I'm sorry, but it's still your own responsibility.

Good luck!

ʇsәɹoɈ
  • 944
  • 9
  • 12
  • 1
    This should be the accepted answer. Although, if I were you, I would have gone for Debian Testing non-free, as it has more up-to-date packages. Also I would create a backup (say, using TimeShift) for easy restoration in case it damages my system, steals my bike, runs off with my girlfriend, or does something else that I don't like. – Qazi Fahim Farhan Jan 29 '20 at 04:48
  • 1
    As far as I can tell, Debian Stable gets regular chromium updates and contains the same chromium version as Debian Testing. I chose the former to reduce the chance of some dependency being pulled from the debian repo (due to a higher version number) in cases when it isn't necessary. – ʇsәɹoɈ Jan 29 '20 at 05:24
  • This is working wonderfully for me on 19.04. I had to install the Debian key using sudo apt install debian-archive-keyring and I also needed Chromedriver from the Debian repo for which the command was sudo apt install chromium-driver. – Ian Mackinnon Feb 05 '20 at 10:36
  • @IanMackinnon In 19.04, I think you could already install Chromium from the Ubuntu repositories without using snap. If my memory is correct, it was only by 19.10 that sudo apt install chromium-browser began to install the snap instead. I do not like that type of redirection. apt and apt-get should never install a snap! I love this answer, btw. – Lonnie Best Feb 16 '20 at 14:55
  • This answers my question too. You can't firejail the snap version. That's my biggest issue with it. – Lonnie Best Feb 18 '20 at 21:50
  • I find this rather cumbersome and easy to break. I have posted a simple solution, but building on your idea: https://askubuntu.com/a/1230153/267858 – eitch Apr 24 '20 at 08:04
  • 2
    I don't know what you mean by easy to break, since is uses fully-supported features of APT, introduces zero new security risks, requires no ongoing maintenance at all, and has not ever broken. I will grant you that your approach requires fewer steps to set up, but it also entrusts the security of the user and the OS to a third-party PPA that is not vetted by the Ubuntu or Debian maintainers or their large community of users. No thanks. – ʇsәɹoɈ Apr 24 '20 at 18:32
  • Thank you! The only issue I had is that, being chromium my predefined web browser, after installing the debian chromium, I had to change the predefined web browser from the unexistent chromium from snap to the current chromium installation. Perhaps a note at the bottom of the answer could be useful to something else. – Paolo Benvenuto Oct 05 '20 at 18:21
  • 1
    libicu63 come from debian, too. – Paolo Benvenuto Oct 05 '20 at 20:48
  • 3
    I don't need to do this in any way but I learned so much just reading this post. Maybe it should become a blog article on dealing with snaps and apt? – Justin W Nov 04 '20 at 18:50
  • Linux Mint seems to have made its own package (see their blog). This might be a better apt source, since Debian has quite out of date packages. – Ruslan Nov 25 '20 at 10:38
  • @Ruslan No, Debian's Chromium packages are not out of date. (Using Mint packages could conceivably work, though. I suppose it's nice to have more options. Just keep in mind that doing so would involve trusting a new party.) – ʇsәɹoɈ Nov 25 '20 at 19:37
  • 1
    Well, Chromium 83 (first released this May) in Debian vs 86 in Ubuntu 18.04 or 87 in the Snap... I'd consider the Debian's one out of date indeed. – Ruslan Nov 25 '20 at 20:03
  • Bloody well done ʇsәɹoɈ! Worked perfectly on this 19.10 distro. And, thanks for all of totally insinde admin fixes everone else! Next in the works, Snap removal as well! Cheer, odoncaoa – odoncaoa Dec 01 '20 at 18:57
  • Nice work! Just bare-metal installed (xubuntu) 20.04 on a machine that formerly had a gnarly old upgraded 20.04. So glad to stop wrestling with all the snap noise. Here's what installed --> Version 87.0.4280.88 (Developer Build) built on Debian 10.7, running on Debian bullseye/sid (64-bit) This is why stack exchange sites stand out on the WWW as having a reliably high signal-to-noise ratio. Again, Bravo! xubuntu entered my life when Unity Desktop appeared. Hope to avoid moving on over snaps. – BISI Jan 08 '21 at 21:31
  • As @PaoloBenvenuto said, now (2021/08), chromium from Debian stable depends on libicu63 which has to come from Debian, since Ubuntu is now using libicu66 (already installed on my system). What should I do to avoid breaking the whole system? Same for libevent-2.1-6 VS libevent-2.1-7 and libvpx5 VS libvpx6 – PlasmaBinturong Aug 11 '21 at 10:20
  • @PlasmaBinturong Libraries with different numbers in their base name, like the ones you listed, can normally be installed alongside one another without conflict. I've just confirmed this on my own system, which has both versions of those libraries, and it works fine. If it concerns you, though, you could always wait a couple weeks for Debian Bullseye to become Debian Stable. It uses newer versions as well. – ʇsәɹoɈ Aug 11 '21 at 18:27
  • @ʇsәɹoɈ thanks for the clarification. Being impatient, I had run the install anyway! – PlasmaBinturong Aug 13 '21 at 21:45
  • Tried this today, but all I got was a version of Chromium (90.0.4430) old enough not to be supported by Netflix. (Also the Chromium syncing/login feature no longer works, because Google no longer allow Chromium the use of the APIs.) – Sadly, I go back to Chrome. :/ – zrajm Sep 09 '21 at 15:28
  • 1
    @ʇsәɹoɈ Now (On 21.04) I get Depends: libwebpmux3 (>= 0.6.1-2+b1) but 0.6.1-2ubuntu0.21.04.1 is to be installed. Unfortunately libwebmux3 is a dependency to a lot of packages installed on my system. Any ideas? – Bruni Oct 13 '21 at 09:21
  • Thanks. I suspected that Debian would be the way to go. Honestly, I couldn't care less about devs assertions that snaps save effort. They break the entire concept of Linux. I don't WANT a monolithic install. I've banned firefox for this same issue, and wouldn't bother with chromium if there wasn't a work-around. – Auspex Nov 30 '22 at 10:08
  • 1
    This has been working nicely, but now I'm getting the following when I run apt install chromium: The following packages have unmet dependencies: chromium : Depends: libwebp7 (>= 1.2.4) but 1.2.2-2ubuntu0.22.10.1 is to be installed Depends: libwebpdemux2 (>= 1.2.4) but 1.2.2-2ubuntu0.22.10.1 is to be installed Depends: libwebpmux3 (>= 1.2.4) but 1.2.2-2ubuntu0.22.10.1 is to be installed E: Unable to correct problems, you have held broken packages. -- any ideas? – drmrbrewer Jun 11 '23 at 21:54
6

I have nothing against snap in theory, but spamming my mounts, processes, and filesystem is just too darn much. I only used it for one thing (the micro editor) before chromium was pushed on me as well. (And is not needed for micro anymore either in 20.04.)

Remove snap*, and prevent its return:

sudo apt remove --purge snapd -y    # may take a while
killall snap snapd                  # probably not necessary

sudo rm -rf /snap /var/cache/snapd/ # buh-bye rm -rf ~/snap # that one too! sudo apt-mark hold snap snapd # prevent reinstall

Install chromium, dev or beta:

# sudo add-apt-repository ppa:chromium-team/dev
sudo add-apt-repository ppa:saiarcot895/chromium-beta
# sudo apt update                   # if it didn't already
sudo apt install chromium-browser

Micro editor - before < 20.04 Focal

# install it from snap beforehand or compile, then copy locally:
cp micro ~/bin

Micro editor - after >= 20.04 Focal

sudo apt install micro
  • Note that the package snap has nothing to do with snap packages. snapd is the only package you need to hold. – Akilan Aug 31 '23 at 20:21
3
sudo snap remove chromium    
sudo apt purge snapd    
rm -rf ~/snap

add repo

sudo add-apt-repository ppa:chromium-team/dev

change eoan to disco in /etc/apt/sources.list.d/chromium-team-dev.list

if file not exist or empty then paste that:

deb http://ppa.launchpad.net/chromium-team/dev/ubuntu disco main
deb-src http://ppa.launchpad.net/chromium-team/dev/ubuntu disco main

then update

sudo apt update

check

apt policy chromium-browser

install

sudo apt install chromium-browser
muru
  • 197,895
  • 55
  • 485
  • 740
  • Why do you use dev rather than stable? – lonix Feb 07 '20 at 11:15
  • @lonix For one it seems the "stable" PPA hasn't been updated in over half a year – Matti Virkkunen Mar 27 '20 at 23:15
  • On Ubuntu 20 I get an error that the PPA doesn't have a Release file so automatic updates are disabled. – Dan Dascalescu May 15 '20 at 00:11
  • "The repository 'http://ppa.launchpad.net/chromium-team/dev/ubuntu focal Release' does not have a Release file." – James Bradbury Jul 18 '20 at 16:00
  • I downloaded manually as adding the repo didnt work on 20.04. Here you can find beta, dev and stable: https://launchpad.net/~chromium-team, I chose beta as is somewhat tested and much newer. The only way to successfuly install is sudo dpkg -i chromium-*.deb (gdebi didnt work with this one) – Aquarius Power Sep 14 '20 at 00:49
2

This PPA seems to work great for this purpose: https://launchpad.net/~saiarcot895/+archive/ubuntu/chromium-dev It's the dev branch, but besides that, it's perfect.

  • 1
    Note that Chrome sync will not work with the dev version unless you apply for developer API keys. https://www.chromium.org/developers/how-tos/api-keys – Ian Mackinnon Feb 05 '20 at 10:46
2

Similar to forest's example above i did the following:

# first add the beta repo, the stable isn't possible as it doesn't get updated
sudo add-apt-repository ppa:chromium-team/beta

now edit the file, changing the reference to disco, instead of eoan:

sudo nano /etc/apt/sources.list.d/chromium-team-ubuntu-stable-eoan.list deb http://ppa.launchpad.net/chromium-team/beta/ubuntu disco main

Now update the repos:

sudo apt update

Now pin the repository order: sudo nano /etc/apt/preferences.d/chromium

Explanation: Disallow installing chromium from ubuntu repo.
Package: chromium*
Pin: origin &quot;*.ubuntu.com&quot;
Pin-Priority: 1

Explanation: Allow installing chromium from launchpad repo.
Package: chromium*
Pin: origin &quot;ppa.launchpad.net&quot;
Pin-Priority: 100

Check which version is to be installed:

apt policy chromium-browser

Now we can install chromium (the extra codecs resolve playback issues):

sudo apt install chromium-browser chromium-codecs-ffmpeg-extra

eitch
  • 373
  • 3
  • 6
  • This is a late response, but I just recently discovered how the snap-based chromium is crippled, and I came across this discussion. I have now followed your procedure here, and I want to thank you! I can now use a fully featured, non-crippled version of chromium under Ubuntu 20.04. – HippoMan Oct 25 '20 at 15:42
  • Hi, i am happy to help. Sadly this won't work on 20.10, you will need to use a different PPA: ppa:saiarcot895/chromium-beta and then use a different preferences priority of 1000 – eitch Oct 26 '20 at 18:56
0

You can download latest official .deb build for Ubuntu 20.04 LTS (Focal), 21.04 (Hirsute) and 21.10 (Impish) here: https://launchpad.net/~phd/+archive/ubuntu/chromium-browser/

This is a PPA repository with official Ubuntu packages released originally for Ubuntu 18.04 LTS (Bionic) and updated as soon as a new version is released.

UPDATE:

Since April 2023 Canonical does no longer provide Chromium .deb packages for any version of Ubuntu.
Hence THIS REPOSITORY WILL NO LONGER BE UPDATED.
You may want to switch to:
https://freeshell.de/phd/chromium

-4

You can use APT to add the repository for Chromium. Then you won't need snapd at all.

sudo add-apt-repository ppa:chromium-team/stable
sudo apt-get update
sudo apt install chromium
Eliah Kagan
  • 117,780