mirror of
https://github.com/Lissy93/dotfiles.git
synced 2025-06-29 05:11:20 +02:00
Updates repo add to detect if Debian or Ubuntu and add sources accordingly
This commit is contained in:
parent
afdb6b9201
commit
d252104151
@ -3,7 +3,7 @@
|
|||||||
################################################################
|
################################################################
|
||||||
# 📜 Debian/ Ubuntu, apt Package Install / Update Script #
|
# 📜 Debian/ Ubuntu, apt Package Install / Update Script #
|
||||||
################################################################
|
################################################################
|
||||||
# Installs listed packages on Debian-based systems via Pacman #
|
# Installs listed packages on Debian-based systems via apt-get #
|
||||||
# Also updates the cache database and existing applications #
|
# Also updates the cache database and existing applications #
|
||||||
# Confirms apps aren't installed via different package manager #
|
# Confirms apps aren't installed via different package manager #
|
||||||
# Doesn't include desktop apps, that're managed via Flatpak #
|
# Doesn't include desktop apps, that're managed via Flatpak #
|
||||||
@ -73,13 +73,18 @@ debian_apps=(
|
|||||||
'neofetch' # Show off distro and system info
|
'neofetch' # Show off distro and system info
|
||||||
)
|
)
|
||||||
|
|
||||||
debian_repos=(
|
ubuntu_repos=(
|
||||||
'main'
|
'main'
|
||||||
'universe'
|
'universe'
|
||||||
'restricted'
|
'restricted'
|
||||||
'multiverse'
|
'multiverse'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
debian_repos=(
|
||||||
|
'main'
|
||||||
|
'contrib'
|
||||||
|
)
|
||||||
|
|
||||||
# Following packages not found by apt, need to fix:
|
# Following packages not found by apt, need to fix:
|
||||||
# aria2, bat, broot, diff-so-fancy, duf, hyperfine,
|
# aria2, bat, broot, diff-so-fancy, duf, hyperfine,
|
||||||
# just, procs, ripgrep, sd, tealdeer, tokei, trash-cli,
|
# just, procs, ripgrep, sd, tealdeer, tokei, trash-cli,
|
||||||
@ -128,10 +133,22 @@ echo -e "${CYAN_B}Would you like to enable listed repos? (y/N)${RESET}\n"
|
|||||||
read -t $PROMPT_TIMEOUT -n 1 -r
|
read -t $PROMPT_TIMEOUT -n 1 -r
|
||||||
echo
|
echo
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
|
if ! hash add-apt-repository 2> /dev/null; then
|
||||||
|
sudo apt install --reinstall software-properties-common
|
||||||
|
fi
|
||||||
|
# If Ubuntu, add Ubuntu repos
|
||||||
|
if lsb_release -a 2>/dev/null | grep -q 'Ubuntu'; then
|
||||||
|
for repo in ${ubuntu_repos[@]}; do
|
||||||
|
echo -e "${PURPLE}Enabling ${repo} repo...${RESET}"
|
||||||
|
sudo add-apt-repository $repo
|
||||||
|
done
|
||||||
|
else
|
||||||
|
# Otherwise, add Debian repos
|
||||||
for repo in ${debian_repos[@]}; do
|
for repo in ${debian_repos[@]}; do
|
||||||
echo -e "${PURPLE}Enabling ${repo} repo...${RESET}"
|
echo -e "${PURPLE}Enabling ${repo} repo...${RESET}"
|
||||||
sudo add-apt-repository $repo
|
sudo add-apt-repository $repo
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prompt user to update package database
|
# Prompt user to update package database
|
||||||
|
Loading…
x
Reference in New Issue
Block a user