farry

debian-chromium-on-ubuntu.sh

Jun 26th, 2020 (edited)
1,047
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.39 KB | None | 0 0
  1. #!/bin/bash
  2. # Install or update non-snap Chrome Chromium from Debian
  3.  
  4. sudo -v
  5.  
  6. sourcefile=/etc/apt/sources.list.d/debian-chromium.list
  7.  
  8. sources='
  9. deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://ftp.us.debian.org/debian/ stable main
  10.  
  11. deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://security.debian.org/ stable/updates main
  12.  
  13. # stable-updates, previously known as "volatile"
  14. deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://ftp.us.debian.org/debian/ stable-updates main
  15. '
  16.  
  17. prefsfile=/etc/apt/preferences.d/debian-chromium.pref
  18.  
  19. prefs='
  20. Explanation: Prevent installing from debian repo.
  21. Package: *
  22. Pin: origin "*.debian.org"
  23. Pin-Priority: 1
  24.  
  25. Explanation: Allow installing chromium from debian repo.
  26. Package: chromium*
  27. Pin: origin "*.debian.org"
  28. Pin-Priority: 100
  29. '
  30.  
  31. if [[ ! -f ${sourcefile}.save ]]; then
  32.  
  33.     echo "$sources" | sudo tee ${sourcefile}.save
  34.     echo "$prefs" | sudo tee $prefsfile
  35.  
  36. fi
  37.  
  38. read -p "Ready to enable Debian sources? <enter> "
  39. sudo apt install debian-archive-keyring
  40. sudo mv ${sourcefile}.save $sourcefile
  41. sudo apt update
  42.  
  43. read -p "Ready to update Chromium? <enter> "
  44. sudo apt install chromium
  45.  
  46. read -p "Ready to disable Debian sources? <enter> "
  47. sudo mv $sourcefile ${sourcefile}.save
  48. sudo apt update
  49.  
  50. echo
  51. echo "Suggest you rename Chromium in launch menu to: Chromium Debian non-snap"
  52.  
Advertisement
Add Comment
Please, Sign In to add comment