How to install Chromium with apt-get on Ubuntu so you can use extensions that need to reach out

Sun Dec 25 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

Summary: Use a repository from the Linux Mint distribution. Promote chromium there and demote everything else from that Mint repository.Mint is like Ubuntu, but have decided to not go down the snap path.

Instructions

The instructions are copied from here with very light editing such as a newer Mint (una → vera) https://askubuntu.com/questions/1386738/how-to-install-chromium-from-the-linux-mint-repositories-in-ubuntu :

Make a backup of the stuff from the snap chromium you want to keep, such as bookmarks

Uninstall snap's Chromium, and if you installed it via apt, remember to also uninstall chromium-browser there or you will get a conflict that prevents Mint's Chromium from being installed

Create an apt source file for the Mint repository:

echo "deb http://packages.linuxmint.com vera upstream" | sudo tee /etc/apt/sources.list.d/mint-vera.list

To prevent NO_PUBKEY you have to add the GPG key by this:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com A1715D88E1DF1F24 40976EAF437D05B5 3B4FE6ACC0B21F32 A6616109451BBBF2

Then update package lists by apt: sudo apt update

Prevent installation of other packages by pin-file:

cat <<EOF | sudo tee /etc/apt/preferences.d/pin-chromium
Package: *
Pin: release o=linuxmint
Pin-Priority: -1
Package: chromium
Pin: release o=linuxmint
Pin-Priority: 1000
EOF

Install chromium:

sudo apt install chromium

Snap will be able to do it in the future

Some browser extensions cannot work with snap versions of Firefox and Chromium and snap is what Ubuntu offers nowadays. The snap people are working on making extensions that need to communicate outside the sandbox to work in both in Firefox and Chromium, and it seems they have a solution you can use for Firefox, if you snap install firefox-beta. Untested by me. Once they get the irons wrinkled out as one says, they will make this work for Firefox normal and for Chromium.

See: https://www.omgubuntu.co.uk/2022/07/ubuntu-devs-fix-another-frustrating-firefox-snap-flaw

A proxy server inside of the Chromium snap

You could conceivable get some glue to work inside the snap for e.g. Chromium, similar to this guide for Firefox and Flatpak:

https://discourse.flathub.org/t/how-to-run-firefox-and-keepassxc-in-a-flatpak-and-get-the-keepassxc-browser-add-on-to-work/437

In that case you'd put a proxy binary inside the snap and some JSON for the browser.