Canonical is consistently promoting Snap Integration in the Ubuntu world with all its market power. However, many do not like this development with Ubuntu. But what options do you still have as an Ubuntu user if you don’t necessarily want to change the distribution? I’ll show you how to run Ubuntu 20.04 with Flatpak instead of Snap and get rid of the data-collecting packages.

Many switch to Linux because dealing with privacy in other operating systems doesn’t leave them feeling good. Can it be beneficial if the Linux distribution is possibly oriented in a similar direction? You should ask yourself this question once and find the right answer for you. I personally have no problem using Ubuntu with the following optimizations.

It starts directlay after installation, do not send reports if not wanted:

And switch of location tracking if this is not wanted:

We are deleting the following packages in order to prevent the opt-out or diagnosis and telemetry data collection and transmission:

Ubuntu report (Report hardware and other collected metrics)
Popularity contest (sends anonymous statistics about app usage behavior)
Apport (collects data in the event of program crashes)
Apport-gtk (Apport GTK + Frontend)
Whoopsie (this program submits crash reports back to ubuntu server)

$ [[user@ubuntu:~]$ sudo apt purge ubuntu-report popularity-contest apport apport-gtk whoopsie
$ [[user@ubuntu:~]$ [sudo] password for user: 
$ [[user@ubuntu:~]$ Reading package lists... Done
$ [[user@ubuntu:~]$ Building dependency tree       
$ [[user@ubuntu:~]$ Reading state information... Done
$ [[user@ubuntu:~]$ The following packages were automatically installed and are no longer required:
$ [[user@ubuntu:~]$   apport-symptoms gdb gdbserver libbabeltrace1 libc6-dbg libcc1-0 libdw1 python3-systemd
$ [[user@ubuntu:~]$ Use 'sudo apt autoremove' to remove them.
$ [[user@ubuntu:~]$ The following packages will be REMOVED:
$ [[user@ubuntu:~]$   apport* apport-gtk* popularity-contest* ubuntu-report* ubuntu-standard* whoopsie*
$ [[user@ubuntu:~]$ 0 upgraded, 0 newly installed, 6 to remove and 185 not upgraded.
$ [[user@ubuntu:~]$ After this operation, 9’098 kB disk space will be freed.
$ [[user@ubuntu:~]$ Do you want to continue? [Y/n] Y
$ [[user@ubuntu:~]$ (Reading database ... 161318 files and directories currently installed.)
$ [[user@ubuntu:~]$ Removing apport-gtk (2.20.11-0ubuntu27.16) ...
$ [[user@ubuntu:~]$ Removing apport (2.20.11-0ubuntu27.16) ...
$ [[user@ubuntu:~]$ Removing ubuntu-standard (1.450.2) ...
$ [[user@ubuntu:~]$ Removing popularity-contest (1.69ubuntu1) ...
$ [[user@ubuntu:~]$ Removing ubuntu-report (1.6.1) ...
$ [[user@ubuntu:~]$ Removing whoopsie (0.2.69ubuntu0.2) ...
$ [[user@ubuntu:~]$ Processing triggers for mime-support (3.64ubuntu1) ...
$ [[user@ubuntu:~]$ Processing triggers for hicolor-icon-theme (0.17-2) ...
$ [[user@ubuntu:~]$ Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
$ [[user@ubuntu:~]$ Processing triggers for man-db (2.9.1-1) ...
$ [[user@ubuntu:~]$ Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
$ [[user@ubuntu:~]$ (Reading database ... 161186 files and directories currently installed.)
$ [[user@ubuntu:~]$ Purging configuration files for whoopsie (0.2.69ubuntu0.2) ...
$ [[user@ubuntu:~]$ Purging configuration files for popularity-contest (1.69ubuntu1) ...
$ [[user@ubuntu:~]$ Purging configuration files for apport (2.20.11-0ubuntu27.16) ...
$ [[user@ubuntu:~]$ Purging configuration files for ubuntu-report (1.6.1) ...
$ [[user@ubuntu:~]$ dpkg: warning: while removing ubuntu-report, directory '/etc/systemd/user/default.target.wants' not empty so not removed
$ [[user@ubuntu:~]$ Processing triggers for systemd (245.4-4ubuntu3.4) ...
$ [[user@ubuntu:~]$

If you also want to ensure that no connections can be established here, you can, for example, block access to these domains at the DNS level via pi-hole, AdGuard Home or router:

metrics.ubuntu.com
popcon.ubuntu.com

Privacy settings:

We open the Gnome settings and navigate to data protection and further to error diagnosis. We set the sending of error reports to Canonical to “Manual” or better to “Never”.

Under Connectivity, deactivate the “Check the connection” function. Here, too, technical diagnostic data is collected, which to prevent.

Package container (Snap and Flatpak)

In favor of increased data protection, we are separating from Canonical’s Snap container solution and optionally we are integrating the open-source Flatpak container solution into the system. Those who do not integrate Flatpak can only obtain their software from the package sources provided by Ubuntu.

Uninstall the following packages:

Snapd
Ubuntu core launcher
Sqashfs-tools

$ [[user@ubuntu:~]$ sudo apt purge snapd ubuntu-core-launcher squashfs-tools
$ [[user@ubuntu:~]$ Reading package lists... Done
$ [[user@ubuntu:~]$ Building dependency tree       
$ [[user@ubuntu:~]$ Reading state information... Done
$ [[user@ubuntu:~]$ Package 'ubuntu-core-launcher' is not installed, so not removed
$ [[user@ubuntu:~]$ The following packages were automatically installed and are no longer required:
$ [[user@ubuntu:~]$  apport-symptoms gdb gdbserver libbabeltrace1 libc6-dbg libcc1-0 libdw1 python3-systemd
$ [[user@ubuntu:~]$ Use 'sudo apt autoremove' to remove them.
$ [[user@ubuntu:~]$ The following packages will be REMOVED:
$ [[user@ubuntu:~]$  snapd* squashfs-tools*
$ [[user@ubuntu:~]$ 0 upgraded, 0 newly installed, 2 to remove and 184 not upgraded.
$ [[user@ubuntu:~]$ After this operation, 127 MB disk space will be freed.
$ [[user@ubuntu:~]$ Do you want to continue? [Y/n] Y
$ [[user@ubuntu:~]$ (Reading database ... 161170 files and directories currently installed.)
$ [[user@ubuntu:~]$ Removing snapd (2.48+20.04) ...
$ [[user@ubuntu:~]$ Removing squashfs-tools (1:4.4-1) ...
$ [[user@ubuntu:~]$ Processing triggers for mime-support (3.64ubuntu1) ...
$ [[user@ubuntu:~]$ Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
$ [[user@ubuntu:~]$ Processing triggers for man-db (2.9.1-1) ...
$ [[user@ubuntu:~]$ Processing triggers for dbus (1.12.16-2ubuntu2.1) ...
$ [[user@ubuntu:~]$ Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
$ [[user@ubuntu:~]$ (Reading database ... 161083 files and directories currently installed.)
$ [[user@ubuntu:~]$ Purging configuration files for snapd (2.48+20.04) ...
$ [[user@ubuntu:~]$ Stopping snap-core18-1988.mount
$ [[user@ubuntu:~]$ Stopping unit snap-core18-1988.mount
$ [[user@ubuntu:~]$ Waiting until unit snap-core18-1988.mount is stopped [attempt 1]
$ [[user@ubuntu:~]$ snap-core18-1988.mount is stopped.
$ [[user@ubuntu:~]$ Removing snap core18 and revision 1988
$ [[user@ubuntu:~]$ Removing snap-core18-1988.mount
$ [[user@ubuntu:~]$ Stopping snap-gnome\x2d3\x2d34\x2d1804-66.mount
$ [[user@ubuntu:~]$ Stopping unit snap-gnome\x2d3\x2d34\x2d1804-66.mount
$ [[user@ubuntu:~]$ Waiting until unit snap-gnome\x2d3\x2d34\x2d1804-66.mount is stopped [attempt 1]
$ [[user@ubuntu:~]$ snap-gnome\x2d3\x2d34\x2d1804-66.mount is stopped.
$ [[user@ubuntu:~]$ Removing snap gnome-3-34-1804 and revision 66
$ [[user@ubuntu:~]$ Removing snap-gnome\x2d3\x2d34\x2d1804-66.mount
$ [[user@ubuntu:~]$ Stopping snap-gtk\x2dcommon\x2dthemes-1514.mount
$ [[user@ubuntu:~]$ Stopping unit snap-gtk\x2dcommon\x2dthemes-1514.mount
$ [[user@ubuntu:~]$ Waiting until unit snap-gtk\x2dcommon\x2dthemes-1514.mount is stopped [attempt 1]
$ [[user@ubuntu:~]$ snap-gtk\x2dcommon\x2dthemes-1514.mount is stopped.
$ [[user@ubuntu:~]$ Removing snap gtk-common-themes and revision 1514
$ [[user@ubuntu:~]$ Removing snap-gtk\x2dcommon\x2dthemes-1514.mount
$ [[user@ubuntu:~]$ Stopping snap-snap\x2dstore-518.mount
$ [[user@ubuntu:~]$ Stopping unit snap-snap\x2dstore-518.mount
$ [[user@ubuntu:~]$ Waiting until unit snap-snap\x2dstore-518.mount is stopped [attempt 1]
$ [[user@ubuntu:~]$ snap-snap\x2dstore-518.mount is stopped.
$ [[user@ubuntu:~]$ Removing snap snap-store and revision 518
$ [[user@ubuntu:~]$ Removing snap-snap\x2dstore-518.mount
$ [[user@ubuntu:~]$ Stopping snap-snapd-11036.mount
$ [[user@ubuntu:~]$ Stopping unit snap-snapd-11036.mount
$ [[user@ubuntu:~]$ Waiting until unit snap-snapd-11036.mount is stopped [attempt 1]
$ [[user@ubuntu:~]$ snap-snapd-11036.mount is stopped.
$ [[user@ubuntu:~]$ Removing snap snapd and revision 11036
$ [[user@ubuntu:~]$ Removing snap-snapd-11036.mount
$ [[user@ubuntu:~]$ Final directory cleanup
$ [[user@ubuntu:~]$ Discarding preserved snap namespaces
$ [[user@ubuntu:~]$ Removing extra snap-confine apparmor rules
$ [[user@ubuntu:~]$ Removing snapd cache
$ [[user@ubuntu:~]$ Removing snapd state
$ [[user@ubuntu:~]$ 

Remove the last remaining old package corpses and then restart the system.

$ [[user@ubuntu:~]$ sudo apt autoremove && sudo reboot
$ [[user@ubuntu:~]$ Reading package lists... Done
$ [[user@ubuntu:~]$ Building dependency tree       
$ [[user@ubuntu:~]$ Reading state information... Done
$ [[user@ubuntu:~]$ The following packages will be REMOVED:
$ [[user@ubuntu:~]$   apport-symptoms gdb gdbserver libbabeltrace1 libc6-dbg libcc1-0 libdw1 python3-systemd
$ [[user@ubuntu:~]$ 0 upgraded, 0 newly installed, 8 to remove and 184 not upgraded.
$ [[user@ubuntu:~]$ After this operation, 88.9 MB disk space will be freed.
$ [[user@ubuntu:~]$ Do you want to continue? [Y/n] 

Installation of Flatpak:

$ [[user@ubuntu:~]$ sudo apt install flatpak
$ [[user@ubuntu:~]$ [sudo] password for user: 
$ [[user@ubuntu:~]$ Reading package lists... Done
$ [[user@ubuntu:~]$ Building dependency tree       
$ [[user@ubuntu:~]$ Reading state information... Done
$ [[user@ubuntu:~]$ The following additional packages will be installed:
$ [[user@ubuntu:~]$   libappstream-glib8 libostree-1-1
$ [[user@ubuntu:~]$ The following NEW packages will be installed:
$ [[user@ubuntu:~]$   flatpak libappstream-glib8 libostree-1-1
$ [[user@ubuntu:~]$ 0 upgraded, 3 newly installed, 0 to remove and 184 not upgraded.
$ [[user@ubuntu:~]$ Need to get 1’483 kB of archives.
$ [[user@ubuntu:~]$ After this operation, 6’988 kB of additional disk space will be used.
$ [[user@ubuntu:~]$ Do you want to continue? [Y/n] Y
$ [[user@ubuntu:~]$ Get:1 http://ch.archive.ubuntu.com/ubuntu focal/main amd64 libappstream-glib8 amd64 0.7.16-1ubuntu1 [135 kB]
$ [[user@ubuntu:~]$ Get:2 http://ch.archive.ubuntu.com/ubuntu focal/universe amd64 libostree-1-1 amd64 2020.3-1 [280 kB]
$ [[user@ubuntu:~]$ Get:3 http://ch.archive.ubuntu.com/ubuntu focal-updates/universe amd64 flatpak amd64 1.6.5-0ubuntu0.3 [1’068 kB]
$ [[user@ubuntu:~]$ Fetched 1’483 kB in 0s (3’299 kB/s)  
$ [[user@ubuntu:~]$ Selecting previously unselected package libappstream-glib8:amd64.
$ [[user@ubuntu:~]$ (Reading database ... 160579 files and directories currently installed.)
$ [[user@ubuntu:~]$ Preparing to unpack .../libappstream-glib8_0.7.16-1ubuntu1_amd64.deb ...
$ [[user@ubuntu:~]$ Unpacking libappstream-glib8:amd64 (0.7.16-1ubuntu1) ...
$ [[user@ubuntu:~]$ Selecting previously unselected package libostree-1-1:amd64.
$ [[user@ubuntu:~]$ Preparing to unpack .../libostree-1-1_2020.3-1_amd64.deb ...
$ [[user@ubuntu:~]$ Unpacking libostree-1-1:amd64 (2020.3-1) ...
$ [[user@ubuntu:~]$ Selecting previously unselected package flatpak.
$ [[user@ubuntu:~]$ Preparing to unpack .../flatpak_1.6.5-0ubuntu0.3_amd64.deb ...
$ [[user@ubuntu:~]$ Unpacking flatpak (1.6.5-0ubuntu0.3) ...
$ [[user@ubuntu:~]$ Setting up libappstream-glib8:amd64 (0.7.16-1ubuntu1) ...
$ [[user@ubuntu:~]$ Setting up libostree-1-1:amd64 (2020.3-1) ...
$ [[user@ubuntu:~]$ Setting up flatpak (1.6.5-0ubuntu0.3) ...
$ [[user@ubuntu:~]$ Processing triggers for man-db (2.9.1-1) ...
$ [[user@ubuntu:~]$ Processing triggers for dbus (1.12.16-2ubuntu2.1) ...
$ [[user@ubuntu:~]$ Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
$ [[user@ubuntu:~]$ 

Adding the Flatpak repository:

$ [[user@ubuntu:~]$  sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
$ [[user@ubuntu:~]$ 

Installing Gnome Software without recommendations (Snap):

$ [[user@ubuntu:~]$ sudo apt install --no-install-recommends gnome-software
$ [[user@ubuntu:~]$ Reading package lists... Done
$ [[user@ubuntu:~]$ Building dependency tree       
$ [[user@ubuntu:~]$ Reading state information... Done
$ [[user@ubuntu:~]$ The following additional packages will be installed:
$ [[user@ubuntu:~]$   gnome-software-common
$ [[user@ubuntu:~]$ Suggested packages:
$ [[user@ubuntu:~]$   gnome-software-plugin-flatpak
$ [[user@ubuntu:~]$ Recommended packages:
$ [[user@ubuntu:~]$   gnome-software-plugin-snap
$ [[user@ubuntu:~]$ The following NEW packages will be installed:
$ [[user@ubuntu:~]$   gnome-software gnome-software-common
$ [[user@ubuntu:~]$ 0 upgraded, 2 newly installed, 0 to remove and 184 not upgraded.
$ [[user@ubuntu:~]$ Need to get 6’452 kB of archives.
$ [[user@ubuntu:~]$ After this operation, 12.9 MB of additional disk space will be used.
$ [[user@ubuntu:~]$ Do you want to continue? [Y/n] Y
$ [[user@ubuntu:~]$ Get:1 http://ch.archive.ubuntu.com/ubuntu focal-updates/main amd64 gnome-software-common all 3.36.1-0ubuntu0.20.04.0 [5’559 kB]
$ [[user@ubuntu:~]$ Get:2 http://ch.archive.ubuntu.com/ubuntu focal-updates/main amd64 gnome-software amd64 3.36.1-0ubuntu0.20.04.0 [892 kB]
$ [[user@ubuntu:~]$ Fetched 6’452 kB in 1s (5’578 kB/s)     
$ [[user@ubuntu:~]$ Selecting previously unselected package gnome-software-common.
$ [[user@ubuntu:~]$ (Reading database ... 160703 files and directories currently installed.)
$ [[user@ubuntu:~]$ Preparing to unpack .../gnome-software-common_3.36.1-0ubuntu0.20.04.0_all.deb ...
$ [[user@ubuntu:~]$ Unpacking gnome-software-common (3.36.1-0ubuntu0.20.04.0) ...
$ [[user@ubuntu:~]$ Selecting previously unselected package gnome-software.
$ [[user@ubuntu:~]$ Preparing to unpack .../gnome-software_3.36.1-0ubuntu0.20.04.0_amd64.deb ...
$ [[user@ubuntu:~]$ Unpacking gnome-software (3.36.1-0ubuntu0.20.04.0) ...
$ [[user@ubuntu:~]$ Setting up gnome-software-common (3.36.1-0ubuntu0.20.04.0) ...
$ [[user@ubuntu:~]$ Setting up gnome-software (3.36.1-0ubuntu0.20.04.0) ...
$ [[user@ubuntu:~]$ Processing triggers for mime-support (3.64ubuntu1) ...
$ [[user@ubuntu:~]$ Processing triggers for hicolor-icon-theme (0.17-2) ...
$ [[user@ubuntu:~]$ Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
$ [[user@ubuntu:~]$ Processing triggers for libglib2.0-0:amd64 (2.64.6-1~ubuntu20.04.1) ...
$ [[user@ubuntu:~]$ Processing triggers for man-db (2.9.1-1) ...
$ [[user@ubuntu:~]$ Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
$ [[user@ubuntu:~]$ 

Install Gnome Flatpak plugin

$ [[user@ubuntu:~]$ sudo apt install gnome-software-plugin-flatpak
$ [[user@ubuntu:~]$ Reading package lists... Done
$ [[user@ubuntu:~]$ Building dependency tree       
$ [[user@ubuntu:~]$ Reading state information... Done
$ [[user@ubuntu:~]$ The following additional packages will be installed:
$ [[user@ubuntu:~]$   libflatpak0
$ [[user@ubuntu:~]$ The following NEW packages will be installed:
$ [[user@ubuntu:~]$   gnome-software-plugin-flatpak libflatpak0
$ [[user@ubuntu:~]$ 0 upgraded, 2 newly installed, 0 to remove and 184 not upgraded.
$ [[user@ubuntu:~]$ Need to get 374 kB of archives.
$ [[user@ubuntu:~]$ After this operation, 1’239 kB of additional disk space will be used.
$ [[user@ubuntu:~]$ Do you want to continue? [Y/n] Y
$ [[user@ubuntu:~]$ Get:1 http://ch.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libflatpak0 amd64 1.6.5-0ubuntu0.3 [277 kB]
$ [[user@ubuntu:~]$ Get:2 http://ch.archive.ubuntu.com/ubuntu focal-updates/universe amd64 gnome-software-plugin-flatpak amd64 3.36.1-0ubuntu0.20.04.0 [97.1 kB]
$ [[user@ubuntu:~]$ Fetched 374 kB in 0s (1’664 kB/s)                        
$ [[user@ubuntu:~]$ Selecting previously unselected package libflatpak0:amd64.
$ [[user@ubuntu:~]$ (Reading database ... 160796 files and directories currently installed.)
$ [[user@ubuntu:~]$ Preparing to unpack .../libflatpak0_1.6.5-0ubuntu0.3_amd64.deb ...
$ [[user@ubuntu:~]$ Unpacking libflatpak0:amd64 (1.6.5-0ubuntu0.3) ...
$ [[user@ubuntu:~]$ Selecting previously unselected package gnome-software-plugin-flatpak.
$ [[user@ubuntu:~]$ Preparing to unpack .../gnome-software-plugin-flatpak_3.36.1-0ubuntu0.20.04.0_amd64.deb ...
$ [[user@ubuntu:~]$ Unpacking gnome-software-plugin-flatpak (3.36.1-0ubuntu0.20.04.0) ...
$ [[user@ubuntu:~]$ Setting up libflatpak0:amd64 (1.6.5-0ubuntu0.3) ...
$ [[user@ubuntu:~]$ Setting up gnome-software-plugin-flatpak (3.36.1-0ubuntu0.20.04.0) ...
$ [[user@ubuntu:~]$ Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
$ [[user@ubuntu:~]$  

With this operation gnome software is installed including the Flatpak repository connected to it.

And now installation of packages out of Flatpak using Gnome Software:

Conclusion

Ubuntu users should check from which source they get their software, unless they want to be forced in one direction. Chromium on Ubuntu is such an example, because even if you enter chromium with sudo apt install under Ubuntu, you don’t get Chromium on the basis of a * .deb package, but instead as a snap package.

$ [[user@ubuntu:~]$ sudo apt search chromium
$ [[user@ubuntu:~]$ chromium-codecs-ffmpeg-extra/focal-updates,now 1:85.0.4183.83-0ubuntu0.20.04.2 amd64 [installed,automatic]
$ [[user@ubuntu:~]$   Transitional package - chromium-codecs-ffmpeg-extra -> chromium-ffmpeg snap
$ [[user@ubuntu:~]$ 

Creating a file /etc/apt/preferences.d/nosnap.pref with following content:
Package: snapd
Pin: release a=*
Pin-Priority: -10

Will prevent snapd from coming back.

I don’t like this fact. I want to be able to choose the source of my software myself. Ubuntu can fix this point quickly. But currently it seems like Ubuntu Snap is trying with all its might to push ahead. Canonical or Ubuntu justifies this step, among other things, by the fact that the provision of third-party software via this container solution is far less effort, since you can pack all the necessary dependencies for all supported Ubuntu versions (e.g. 16.04, 18.04, 20.04 etc.) centrally and roll out the container. Technically, I can fully follow this justification, but the criticism of the compulsion to take the measure in connection with the closed server infrastructure remains.