Streamlining Software Installation and Package Management in Fedora OS: A Comprehensive Guide

Coding Linux Shell Script to Update Ungoogled Chromium One-Command Line

This blog post will show how to code a Linux shell script to get the Ungoogled Chrome browser one-command line. Link to Github gist – here

What is Ungoogled Chrome browser it’s fully removed from Google tracking scripts and search engines. More in https://ungoogled-software.github.io/

To code a Linux shell script to update Postman one-command line, you will need the following:

  • A Linux computer

Steps to write update Ungoogled Chrome browser one-command line

  1. Create a new file and name it update_ungoogled_chrome.sh
  2. Open the file in a text editor.
  3. Add the following lines to the file (or copy from gist):
#!/bin/bash

# Get latest from releases ungoogled-chromium-portablelinux
api_endpoint="https://api.github.com/repos/ungoogled-software/ungoogled-chromium-portablelinux/releases/latest"

# Go to the temp folder
cd /tmp

# Send a GET request to the API endpoint and extract the download URL of the tar.xz archive
archive_url=$(curl -s $api_endpoint | jq -r ".assets[] | select(.content_type | test(\"application/x-xz\")) | .browser_download_url")

folder_name=$(curl -s $api_endpoint | jq -r ".assets[] | select(.content_type | test(\"application/x-xz\")) | .name")

filename_no_extension="${folder_name%.tar.xz}"

echo "$archive_url"

echo "$filename_no_extension"

# Download the latest Chromium source archive
#wget "$archive_url" -P /tmp/ -O chromium.tar.xz

# Extract the Chromium source archive to created Chromium folder
tar -xJvf chromium.tar.xz -C /tmp

# Replace the existing Chromium app with the new one from tmp
cp -r "/tmp/${filename_no_extension}/*" /opt/chromium/

# Remove the old Chromium source archive
#rm /tmp/chromium.tar.xz && rm -rf "/tmp/${filename_no_extension}"
  1. Save the file.
  2. Make the file executable:
chmod +x <span style="background-color: initial; font-family: inherit; font-size: inherit; color: var(--wp--preset--color--contrast);">update_ungoogled_chrome.sh</span>

6. To download and copy portable Chrome, simply run the following command

./<span style="background-color: initial; font-family: inherit; font-size: inherit; color: var(--wp--preset--color--contrast);">update_ungoogled_chrome.sh</span>

This script will download the latest ungoogled-software source archive with portable, extract it to the /opt/chrome folder, and then replace the existing files with the new one. It will also remove the old Discord source archive.

All one-line shell-script in my blog – this page.


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

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