Add new package manager and enhance master setup with Xanmod kernel
This commit is contained in:
parent
b7623bcb26
commit
7c274a8b7a
2 changed files with 159 additions and 73 deletions
46
github_package_update.bash
Normal file
46
github_package_update.bash
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Function to check and pull the latest version of a package from GitHub
|
||||||
|
check_and_update_package() {
|
||||||
|
local repo_owner="$1"
|
||||||
|
local repo_name="$2"
|
||||||
|
local local_path="$3"
|
||||||
|
|
||||||
|
echo "Checking for updates for $repo_name..."
|
||||||
|
|
||||||
|
# Get the latest release info from GitHub API
|
||||||
|
latest_release=$(curl -s "https://api.github.com/repos/$repo_owner/$repo_name/releases/latest")
|
||||||
|
latest_version=$(echo "$latest_release" | grep -oP '(?<="tag_name": ")([^"]+)')
|
||||||
|
|
||||||
|
if [ -z "$latest_version" ]; then
|
||||||
|
echo "Failed to fetch latest version for $repo_name."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if the package is already installed at the local path
|
||||||
|
if [ -d "$local_path" ]; then
|
||||||
|
# Check if the installed version matches the latest
|
||||||
|
current_version=$(cd "$local_path" && git describe --tags 2>/dev/null || echo 'unknown')
|
||||||
|
if [ "$current_version" == "$latest_version" ]; then
|
||||||
|
echo "$repo_name is already up to date (version: $current_version)."
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo "Updating $repo_name from version $current_version to $latest_version..."
|
||||||
|
cd "$local_path" && git pull origin "$latest_version"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Installing $repo_name version $latest_version..."
|
||||||
|
git clone "https://github.com/$repo_owner/$repo_name.git" "$local_path"
|
||||||
|
cd "$local_path" && git checkout "$latest_version"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "$repo_name has been updated to version $latest_version."
|
||||||
|
else
|
||||||
|
echo "Failed to update $repo_name."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Example usage:
|
||||||
|
# check_and_update_package 'owner' 'repository' '/path/to/install'
|
186
mastersetup.bash
186
mastersetup.bash
|
@ -1,111 +1,151 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# standard lactazora script stub
|
# Standard lactazora script stub
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
set -eo pipefail #these can cause problems when you want stuff to keep going
|
if [[ -n "${BASHD_DEBUG}" ]]; then
|
||||||
|
|
||||||
if [[ -n "${BASHD_DEBUG}" ]]; then # a inevitability that this will be used
|
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
trap cleanup EXIT # A little more robust cleanup
|
trap cleanup EXIT
|
||||||
|
|
||||||
# trap errors and set the ERR trap
|
|
||||||
trap 'echo -e "\nERROR: $BASH_COMMAND\nFILE: ${BASH_SOURCE[0]}\nLINE: ${BASH_LINENO[0]}\n" >&2; exit 1' ERR
|
trap 'echo -e "\nERROR: $BASH_COMMAND\nFILE: ${BASH_SOURCE[0]}\nLINE: ${BASH_LINENO[0]}\n" >&2; exit 1' ERR
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
# We can clean up any temp files or what nots, but for now a place holder
|
rm -f /tmp/*.deb /tmp/tsetup.*.tar.xz
|
||||||
true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# end stub
|
# a useful function to grab the latest deb from a github repo
|
||||||
|
|
||||||
# Will setup anything debian based
|
# Function to download the latest .deb file from a GitHub repo's releases
|
||||||
|
# Usage: download_latest_deb "owner/repo" "output_file" ["asset_pattern"]
|
||||||
|
# curtsey of Grok
|
||||||
|
download_latest_deb() {
|
||||||
|
local repo="$1" # GitHub repo (e.g., "TabbyML/tabby")
|
||||||
|
local output="$2" # Output file path (e.g., "tabby.deb")
|
||||||
|
local pattern="$3" # Optional: regex pattern to filter assets (e.g., "tabby_.*_amd64.deb")
|
||||||
|
local api_url="https://api.github.com/repos/$repo/releases/latest"
|
||||||
|
local download_url
|
||||||
|
|
||||||
# First step that always needs to happen
|
# Fetch the latest release JSON and extract the download URL for the .deb
|
||||||
sudo apt update
|
download_url=$(curl -s "$api_url" | jq -r --arg pat "${pattern:-.*\.deb}" \
|
||||||
|
'.assets[] | select(.name | test($pat)) | .browser_download_url')
|
||||||
|
|
||||||
|
if [[ -z "$download_url" ]]; then
|
||||||
|
echo "Error: No .deb file found for $repo with pattern '$pattern'"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Download the .deb file
|
||||||
|
echo "Downloading $download_url to $output..."
|
||||||
|
curl -sL "$download_url" -o "$output"
|
||||||
|
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
echo "Successfully downloaded $output"
|
||||||
|
else
|
||||||
|
echo "Error: Failed to download $output"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# System update and base tools
|
||||||
|
echo "Updating system and installing base tools..."
|
||||||
|
sudo apt update
|
||||||
sudo apt upgrade -y
|
sudo apt upgrade -y
|
||||||
|
sudo apt install curl git wget btrfs-progs -y
|
||||||
|
|
||||||
# install curl,git, and wget
|
# Install Xanmod kernel
|
||||||
|
echo "Installing Xanmod kernel..."
|
||||||
|
echo 'deb http://deb.xanmod.org releases main' | sudo tee /etc/apt/sources.list.d/xanmod-kernel.list
|
||||||
|
wget -qO - https://dl.xanmod.org/gpg.key | sudo apt-key add -
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install linux-xanmod-x64v3 -y
|
||||||
|
# sudo update-grub Grok addded this but its not needed
|
||||||
|
|
||||||
sudo apt install curl git wget -y # at worst this does nothing
|
# Homebrew
|
||||||
|
echo "Installing Homebrew..."
|
||||||
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) --prefix=/opt/homebrew"
|
||||||
|
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bashrc
|
||||||
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||||
|
|
||||||
# install the fun stuff
|
# Pacstall
|
||||||
|
echo "Installing Pacstall..."
|
||||||
# We begin with homebrew
|
if ! curl -fsSL https://pacstall.dev/q/install | sudo bash; then
|
||||||
|
echo "Pacstall install failed" >&2
|
||||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
exit 1
|
||||||
|
fi
|
||||||
# inject homebrew into .bashrc
|
|
||||||
|
|
||||||
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
|
|
||||||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
|
||||||
|
|
||||||
# now pacstall
|
|
||||||
|
|
||||||
sudo bash -c "$(curl -fsSL https://pacstall.dev/q/install)"
|
|
||||||
|
|
||||||
# now makedeb
|
|
||||||
|
|
||||||
# we need a environment variable here
|
|
||||||
|
|
||||||
|
# makedeb
|
||||||
|
echo "Installing makedeb..."
|
||||||
export MAKEDEB_RELEASE="makedeb"
|
export MAKEDEB_RELEASE="makedeb"
|
||||||
|
if ! wget -q --spider https://shlink.makedeb.org/install; then
|
||||||
|
echo "makedeb URL failed" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
bash -ci "$(wget -qO - 'https://shlink.makedeb.org/install')"
|
bash -ci "$(wget -qO - 'https://shlink.makedeb.org/install')"
|
||||||
|
|
||||||
# Thats it for top level stuff now we dive a little deeper
|
# Floorp
|
||||||
|
echo "Installing Floorp..."
|
||||||
# Now floorp
|
curl -fsSL https://ppa.floorp.app/KEY.gpg | sudo apt-key add -
|
||||||
|
|
||||||
curl -fsSL https://ppa.floorp.app/KEY.gpg | sudo gpg --dearmor -o /usr/share/keyrings/Floorp.gpg
|
|
||||||
sudo curl -sS --compressed -o /etc/apt/sources.list.d/Floorp.list 'https://ppa.floorp.app/Floorp.list'
|
sudo curl -sS --compressed -o /etc/apt/sources.list.d/Floorp.list 'https://ppa.floorp.app/Floorp.list'
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install floorp -y
|
sudo apt install floorp -y
|
||||||
|
|
||||||
# now let's do signal
|
# Signal
|
||||||
|
echo "Installing Signal..."
|
||||||
# 1. Install our official public software signing key:
|
wget -O- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > /tmp/signal-desktop-keyring.gpg
|
||||||
wget -O- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > signal-desktop-keyring.gpg
|
sudo mv /tmp/signal-desktop-keyring.gpg /usr/share/keyrings/
|
||||||
cat signal-desktop-keyring.gpg | sudo tee /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null
|
|
||||||
|
|
||||||
# 2. Add our repository to your list of repositories:
|
|
||||||
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' |\
|
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' |\
|
||||||
sudo tee /etc/apt/sources.list.d/signal-xenial.list
|
sudo tee /etc/apt/sources.list.d/signal-xenial.list
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install signal-desktop -y
|
||||||
|
|
||||||
# 3. Update your package database and install Signal:
|
|
||||||
sudo apt update && sudo apt install signal-desktop -y
|
|
||||||
|
|
||||||
# now let's do discord
|
# Discord
|
||||||
|
echo "Installing Discord..."
|
||||||
|
wget -O /tmp/discord.deb 'https://discord.com/api/download?platform=linux&format=deb'
|
||||||
|
sudo apt install /tmp/discord.deb -y
|
||||||
|
|
||||||
wget 'https://discord.com/api/download?platform=linux&format=deb' -O discord.deb
|
# Telegram
|
||||||
sudo apt install ./discord.deb -y
|
echo "Installing Telegram..."
|
||||||
|
wget https://td.telegram.org/tlinux/tsetup.5.11.1.tar.xz -O /tmp/tsetup.5.11.1.tar.xz
|
||||||
# now let's do telegram
|
tar -xvf /tmp/tsetup.5.11.1.tar.xz -C /tmp
|
||||||
|
sudo mv /tmp/Telegram /opt/Telegram
|
||||||
wget https://td.telegram.org/tlinux/tsetup.5.11.1.tar.xz -O tsetup.5.11.1.tar.xz
|
sudo ln -sf /opt/Telegram/Telegram /usr/local/bin/telegram
|
||||||
tar -xvf tsetup.5.11.1.tar.xz
|
|
||||||
|
|
||||||
# Now lets do kopia
|
|
||||||
|
|
||||||
|
# Kopia
|
||||||
|
echo "Installing Kopia..."
|
||||||
curl -s https://kopia.io/signing-key | sudo gpg --dearmor -o /etc/apt/keyrings/kopia-keyring.gpg
|
curl -s https://kopia.io/signing-key | sudo gpg --dearmor -o /etc/apt/keyrings/kopia-keyring.gpg
|
||||||
echo "deb [signed-by=/etc/apt/keyrings/kopia-keyring.gpg] http://packages.kopia.io/apt/ stable main" | sudo tee /etc/apt/sources.list.d/kopia.list
|
echo "deb [signed-by=/etc/apt/keyrings/kopia-keyring.gpg] http://packages.kopia.io/apt/ stable main" | sudo tee /etc/apt/sources.list.d/kopia.list
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install kopia -y
|
sudo apt install kopia kopia-ui -y
|
||||||
sudo apt install kopia-ui -y
|
|
||||||
|
|
||||||
# now lets do steam
|
# Steam
|
||||||
|
echo "Installing Steam..."
|
||||||
|
wget https://cdn.cloudflare.steamstatic.com/client/installer/steam.deb -O /tmp/steam.deb
|
||||||
|
sudo apt install /tmp/steam.deb -y
|
||||||
|
|
||||||
wget https://cdn.cloudflare.steamstatic.com/client/installer/steam.deb -O steam.deb
|
# NVM and Node.js
|
||||||
sudo apt install ./steam.deb -y
|
echo "Installing NVM and Node.js..."
|
||||||
|
bash -i <(wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh)
|
||||||
# that is it for now, maybe later add xanmod or openrc
|
. ~/.nvm/nvm.sh
|
||||||
|
|
||||||
# Now lets add NVM
|
|
||||||
|
|
||||||
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
|
||||||
source $HOME/.bashrc
|
|
||||||
nvm install --lts
|
nvm install --lts
|
||||||
|
|
||||||
# Now bun
|
# Bun
|
||||||
|
echo "Installing Bun..."
|
||||||
|
curl -fsSL https://bun.sh/install | bash || { echo "Bun install failed" >&2; exit 1; }
|
||||||
|
|
||||||
curl -fsSL https://bun.sh/install | bash
|
# Joplin
|
||||||
|
wget -O - https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash
|
||||||
|
|
||||||
|
# Tabby
|
||||||
|
download_latest_deb "Eugeny/tabby" "tabby.deb"
|
||||||
|
sudo apt install ./tabby.deb -y
|
||||||
|
|
||||||
|
# Windsurf
|
||||||
|
|
||||||
|
curl -fsSL "https://windsurf-stable.codeiumdata.com/wVxQEIWkwPUEAGf3/windsurf.gpg" | sudo gpg --dearmor -o /usr/share/keyrings/windsurf-stable-archive-keyring.gpg
|
||||||
|
echo "deb [signed-by=/usr/share/keyrings/windsurf-stable-archive-keyring.gpg arch=amd64] https://windsurf-stable.codeiumdata.com/wVxQEIWkwPUEAGf3/apt stable main" | sudo tee /etc/apt/sources.list.d/windsurf.list > /dev/null
|
||||||
|
sudo apt update
|
||||||
|
sudo apt upgrade windsurf -y
|
||||||
|
|
||||||
|
echo "Setup complete!"
|
Loading…
Add table
Add a link
Reference in a new issue