Skip to content

Commit

Permalink
Better Chromium: install Raspberry Pi Foundation chromium on rpi Ubuntu
Browse files Browse the repository at this point in the history
suggestion from #2528
  • Loading branch information
theofficialgman committed Jan 16, 2024
1 parent 94bd606 commit bdf1b6b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
24 changes: 24 additions & 0 deletions apps/Better Chromium/install
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,30 @@ else
error "User error: Chromium is not installed! Failed to find either a 'chromium' command or 'chromium-browser' command. If you are sure Chromium is installed, please reach out to Botspot for this to be fixed."
fi

# obtain model
get_model &>/dev/null
if [[ "$model" == *"Raspberry Pi"* ]] && [[ "$__os_id" == Ubuntu ]] && printf '%s\n' "23.10" "$__os_release" | sort -CV; then
# rpi ubuntu (23.10+) use Pi OS packaged chromium for better hardware support
add_external_repo "raspberrypi" "https://archive.raspberrypi.com/debian/raspberrypi.gpg.key" "https://archive.raspberrypi.com/debian" "bookworm" "main" || exit 1
# also disable chromium snap apt package from Ubuntu
echo 'Package: *
Pin: release o=Raspberry Pi Foundation
Pin-Priority: -1
Package: chromium*
Pin: release o=Raspberry Pi Foundation
Pin-Priority: 1000
Package: chromium*
Pin: release o=Ubuntu*
Pin-Priority: -1' | sudo tee /etc/apt/preferences.d/chromium >/dev/null
install_packages chromium-browser || exit 1
# install_packages will not switch an already installed 1:1snap* package to a XXX chromium-browser package since this would constitute a downgrade
# the pin priorities added above will prevent Ubuntu repository chromium-browser packages from even showing or installing in the future but we still need to do the initial downgrade from 1:1snap* to the Pi OS version of chromium-browser
apt_lock_wait
sudo apt --only-upgrade --allow-downgrades install chromium-browser -y | less_apt
fi

#determine where the Chromium customizations folder is.
if [ -d /etc/chromium.d ];then
folder=/etc/chromium.d
Expand Down
4 changes: 4 additions & 0 deletions apps/Better Chromium/uninstall
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

# rpi ubuntu (23.10+) use Pi OS packaged chromium for better hardware support
purge_packages
rm_external_repo "raspberrypi"

#determine where the Chromium customizations folder is.
if [ -d /etc/chromium.d ];then
folder=/etc/chromium.d
Expand Down

0 comments on commit bdf1b6b

Please sign in to comment.