Commit f7b7ffdb authored by Ralf Matthes's avatar Ralf Matthes
Browse files

Added more distibutions (Arch, Debian, YUM based)

parent 9a2dc0c1
#!/bin/bash
# sources.list and install dependencys
# Add Debug messages in install script
DEBUG=1
# Check if System is Debian 10 / 11
VERSION=NONE
pat1="10.[0-100]"
pat2="11.[0-100]"
if [ $(cat /etc/debian_version) == $pat1 ]; then
VERSION=10
elif [ $(cat /etc/debian_version) == $pat2 ]; then
VERSION=11
fi
# Get Distributions
if [ $VERSION = "10" ]; then
echo "deb http://deb.debian.org/debian/ buster main contrib non-free" > /etc/sources.list
echo "deb-src http://deb.debian.org/debian/ buster main contrib non-free" >> /etc/sources.list
echo "" >> /etc/sources.list
echo "deb http://deb.debian.org/debian/ buster-updates main contrib non-free" >> /etc/sources.list
echo "deb-src http://deb.debian.org/debian/ buster-updates main contrib non-free" >> /etc/sources.list
echo "" >> /etc/sources.list
echo "deb http://deb.debian.org/debian-security buster/updates main contrib non-free" >> /etc/sources.list
echo "deb-src http://deb.debian.org/debian-security buster/updates main contrib non-free" >> /etc/sources.list
elif [ $VERSION = "11" ]; then
echo "deb http://ftp.uk.debian.org/debian/ bullseye main contrib non-free" > /etc/sources.list
echo "deb-src http://ftp.uk.debian.org/debian/ bullseye main contrib non-free" >> /etc/sources.list
echo "" >> /etc/sources.list
echo "deb http://ftp.uk.debian.org/debian/ bullseye-updates main contrib non-free" >> /etc/sources.list
echo "deb-src http://ftp.uk.debian.org/debian/ bullseye-updates main contrib non-free" >> /etc/sources.list
echo "" >> /etc/sources.list
echo "deb http://security.debian.org/ bullseye/updates main contrib non-free" >> /etc/sources.list
echo "deb-src http://security.debian.org/ bullseye/updates main contrib non-free" >> /etc/sources.list
if [ -f /etc/debian_version ]; then
# Debian System
sourceslist
apt update
apt install -y git curl wget unzip neofetch wget2
elif [ -f /etc/SuSe-release ]; then
# Yum based System
yum update
yum install git curl wget unzip neofetch wget2
elif [ -f /etc/arch-release ]; then
# Archlinux System
pacman -Syu
pacman -S git curl wget unzip neofetch wget2
else
# Fall back to uname, e.g. "Linux <version>", also works for BSD, etc.
echo "Unknown System. Please report to webmaster@rmatthes.de for Assistance"
OS=$(uname -s)
VER=$(uname -r)
ALL=$(uname -a)
echo $OS
echo $VER
echo $ALL
fi
# Install Updates
apt update
apt install -y git curl wget unzip neofetch wget2
# Check if System is Debian 10 / 11
function sourceslist() {
VERSION=NONE
pat1="10.[0-100]"
pat2="11.[0-100]"
if [ $(cat /etc/debian_version) == $pat1 ]; then
VERSION=10
elif [ $(cat /etc/debian_version) == $pat2 ]; then
VERSION=11
fi
if [ $VERSION = "10" ]; then
echo "deb http://deb.debian.org/debian/ buster main contrib non-free" > /etc/sources.list
echo "deb-src http://deb.debian.org/debian/ buster main contrib non-free" >> /etc/sources.list
echo "" >> /etc/sources.list
echo "deb http://deb.debian.org/debian/ buster-updates main contrib non-free" >> /etc/sources.list
echo "deb-src http://deb.debian.org/debian/ buster-updates main contrib non-free" >> /etc/sources.list
echo "" >> /etc/sources.list
echo "deb http://deb.debian.org/debian-security buster/updates main contrib non-free" >> /etc/sources.list
echo "deb-src http://deb.debian.org/debian-security buster/updates main contrib non-free" >> /etc/sources.list
elif [ $VERSION = "11" ]; then
echo "deb http://ftp.uk.debian.org/debian/ bullseye main contrib non-free" > /etc/sources.list
echo "deb-src http://ftp.uk.debian.org/debian/ bullseye main contrib non-free" >> /etc/sources.list
echo "" >> /etc/sources.list
echo "deb http://ftp.uk.debian.org/debian/ bullseye-updates main contrib non-free" >> /etc/sources.list
echo "deb-src http://ftp.uk.debian.org/debian/ bullseye-updates main contrib non-free" >> /etc/sources.list
echo "" >> /etc/sources.list
echo "deb http://security.debian.org/ bullseye/updates main contrib non-free" >> /etc/sources.list
echo "deb-src http://security.debian.org/ bullseye/updates main contrib non-free" >> /etc/sources.list
fi
}
# install oh-my-bash
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)" ==> OLD WAY
git clone git://github.com/ohmybash/oh-my-bash.git ~/.oh-my-bash
cp ~/.oh-my-bash/templates/bashrc.osh-template ~/.bashrc
# rmw (rm with trash)
echo "Installing rmw - rm with Trash"
......@@ -79,3 +103,5 @@ echo 'alias df="duf"' >> .bashrc
echo 'alias wget="wget2"' >> .bashrc
echo 'alias man="tldr"' >> .bashrc
echo 'neofetch' >> .bashrc
source ~/.bashrc
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment