32

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?

  • 2
    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 7 '19 at 11:37
  • 3
    Generically find alternate source of packaging. Specifically there is a chromium beta ppa, launchpad.net/~saiarcot895/+archive/ubuntu/chromium-beta and a dev ppa, launchpad.net/~saiarcot895/+archive/ubuntu/chromium-dev – doug Oct 7 '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 7 '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 2:23
  • Not what you're asking but I download the chrome deb from the google chrome site. No snap, – Stephen Boston Nov 4 '19 at 2:02
16
+100

Debian Repo Saves the Day!

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 a very well known high-profile project, and is already where Ubuntu gets most of its packages. There is no need to risk installing mystery browser builds from some random source or fringe PPA.

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://ftp.us.debian.org/debian/ stable main
deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://ftp.us.debian.org/debian/ stable main

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

# stable-updates, previously known as 'volatile'
deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://ftp.us.debian.org/debian/ stable-updates main
deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://ftp.us.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; that would very likely break your system. However, we're going to add some rules to prevent this from happening.

(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's probably on your system already, 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: Prevent installing from debian repo.
Package: *
Pin: origin "*.debian.org"
Pin-Priority: 1

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

The first stanza assigns a very low priority to all packages from the Debian archives, so they will not override anything in the Ubuntu archives. The second stanza assigns a somewhat higher priority to Debian Chromium packages. This is called apt pinning, and is described in the apt_preferences manual.

(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.)

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-cache 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!

| improve this answer | |
  • 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 at 4:48
  • 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 at 5: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 5 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 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 at 21:50
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.

| improve this answer | |
2

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

| improve this answer | |
  • Why do you use dev rather than stable? – lonix Feb 7 at 11:15
  • @lonix For one it seems the "stable" PPA hasn't been updated in over half a year – Matti Virkkunen Mar 27 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 at 0:11
1

Manually copy the required packages from the 19.04 distribution and install them with dpkg.

apt purge snapd
curl -OO http://ftp.ubuntu.com/ubuntu/ubuntu/pool/universe/c/chromium-browser/{chromium-browser_79.0.3945.79-0ubuntu0.19.04.3_amd64.deb,chromium-codecs-ffmpeg-extra_79.0.3945.79-0ubuntu0.19.04.3_amd64.deb}
dpkg -i chromium-codecs-ffmpeg-extra_79.0.3945.79-0ubuntu0.19.04.3_amd64.deb chromium-browser_79.0.3945.79-0ubuntu0.19.04.3_amd64.deb
apt-mark hold chromium-browser chromium-codecs-ffmpeg-extra snapd

Edit: I just realized that I could use Pinning to which ʇsәɹoɈ referred above in relation to the debian repo. I will get back to this when I have time to experiment.

| improve this answer | |
1

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 not needed for micro anymore either.)

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
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
| improve this answer | |
1

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 "*.ubuntu.com"
    Pin-Priority: 1
    
    Explanation: Allow installing chromium from launchpad repo.
    Package: chromium*
    Pin: origin "ppa.launchpad.net"
    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
| improve this answer | |
  • Please, for the love of god, don't tell people to use vi, especially if they're looking to install chromium on Ubuntu. There's nano everywhere, which a much easier to use editor. – Bim Jun 17 at 9:23
0
  • Download Google Chrome

  • Compile Google Chromium from source

  • Find a PPA or deb package file that a third party has provided.

Google releases a new major version of Chromium every six weeks, with typically several minor versions to address security vulnerabilities in between. Every new stable version has to be built for each supported Ubuntu release − 16.04, 18.04, 19.04 and the upcoming 19.10 − and for all supported architectures (amd64, i386, armhf, arm64).

Additionally, ensuring Chromium even builds (let alone runs) on older releases such as 16.04 can be challenging, as the upstream project often uses new compiler features that are not available on older releases.

In contrast, a snap needs to be built only once per architecture, and will run on all systems that support snapd. This covers all supported Ubuntu releases including 14.04 with Extended Security Maintenance (ESM), as well as other distributions like Debian, Fedora, Mint, and Manjaro.

https://ubuntu.com/blog/chromium-in-ubuntu-deb-to-snap-transition

| improve this answer | |
  • 5
    This explains the reasoning behind why snapd is now used to package Chromium, but it doesn't say whether it's possible to remove snapd without removing Chromium, which is the OP's question. – starbeamrainbowlabs Nov 4 '19 at 11:35
-3

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
| improve this answer | |
  • 3
    It's same thing. "chromium-browser Transitional package - chromium-browser -> chromium snap" – adasiko Nov 5 '19 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.