Infrastructure at your Service

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)

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

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

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

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

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

Installation of Flatpak:

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

Adding the Flatpak repository:

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

Installing Gnome Software without recommendations (Snap):

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

Install Gnome Flatpak plugin

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

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.

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

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.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Karsten Lenz
Karsten Lenz

Consultant