Mise-à-jour Ubuntu -> Debian🐛
- Suppression du code redondant - Installation de wget - wget silencieux lors de l'installation de fish - Nettoyage commentaires
This commit is contained in:
parent
f4e501c731
commit
5af56ad9ed
1 changed files with 15 additions and 21 deletions
36
wsl.sh
36
wsl.sh
|
@ -2,19 +2,21 @@
|
||||||
|
|
||||||
if grep "WSL" /proc/version > /dev/null;
|
if grep "WSL" /proc/version > /dev/null;
|
||||||
then
|
then
|
||||||
|
sudo apt update
|
||||||
|
|
||||||
which git &> /dev/null || sudo apt install git -y # install git if not already installed
|
which git &> /dev/null || sudo apt install git -y # install git if not already installed
|
||||||
which curl &> /dev/null || sudo apt install apt-transport-https curl -y # install curl (along with apt-transport-https) if not already installed
|
which curl &> /dev/null || sudo apt install apt-transport-https curl -y # install curl (along with apt-transport-https) if not already installed
|
||||||
|
which wget &> /dev/null || sudo apt install apt-transport-https curl -y # install curl (along with apt-transport-https) if not already installed
|
||||||
|
|
||||||
# == Upgrade and clean already installed packages ==
|
# == Upgrade and clean already installed packages ==
|
||||||
sudo apt full-upgrade -y
|
sudo apt full-upgrade -y
|
||||||
|
|
||||||
# == Basic dev ==
|
# == Basic dev ==
|
||||||
sudo apt install build-essential git -y
|
sudo apt install build-essential wget -y
|
||||||
|
|
||||||
# == Fish ==
|
# == Fish ==
|
||||||
sudo apt-add-repository ppa:fish-shell/release-3 -y
|
sudo apt-add-repository ppa:fish-shell/release-3 -y
|
||||||
sudo apt update
|
sudo apt install fish fzf bat procps exa micro -y
|
||||||
sudo apt install fish fzf bat procps curl exa micro -y
|
|
||||||
sudo snap install micro --classic
|
sudo snap install micro --classic
|
||||||
# Remove motd
|
# Remove motd
|
||||||
fish -c "set -U fish_greeting"
|
fish -c "set -U fish_greeting"
|
||||||
|
@ -23,14 +25,14 @@ then
|
||||||
fish -c "fisher install jethrokuan/fzf"
|
fish -c "fisher install jethrokuan/fzf"
|
||||||
# SSH
|
# SSH
|
||||||
rm "$HOME"/.config/fish/functions/fish_ssh_agent.fish 2>/dev/null
|
rm "$HOME"/.config/fish/functions/fish_ssh_agent.fish 2>/dev/null
|
||||||
wget https://gitlab.com/kyb/fish_ssh_agent/raw/master/functions/fish_ssh_agent.fish -P "$HOME"/.config/fish/functions/
|
wget -q https://gitlab.com/kyb/fish_ssh_agent/raw/master/functions/fish_ssh_agent.fish -P "$HOME"/.config/fish/functions/
|
||||||
mkdir "$HOME"/.ssh
|
mkdir "$HOME"/.ssh
|
||||||
# Custom config.fish
|
# Custom config.fish
|
||||||
rm "$HOME"/.config/fish/config.fish 2>/dev/null
|
rm "$HOME"/.config/fish/config.fish 2>/dev/null
|
||||||
wget https://git.kennel.ml/Anri/confOS/raw/branch/main/.config/fish/config_wsl.fish -P "$HOME"/.config/fish/config.fish
|
wget -q https://git.kennel.ml/Anri/confOS/raw/branch/main/.config/fish/config_wsl.fish -P "$HOME"/.config/fish/config.fish
|
||||||
# Custom prompt shell (based on Base16 Eighties)
|
# Custom prompt shell (based on Base16 Eighties)
|
||||||
rm "$HOME"/.config/fish/functions/fish_prompt.fish 2>/dev/null
|
rm "$HOME"/.config/fish/functions/fish_prompt.fish 2>/dev/null
|
||||||
wget https://git.kennel.ml/Anri/confOS/raw/branch/main/.config/fish/functions/fish_prompt.fish -P "$HOME"/.config/fish/functions/
|
wget -q https://git.kennel.ml/Anri/confOS/raw/branch/main/.config/fish/functions/fish_prompt.fish -P "$HOME"/.config/fish/functions/
|
||||||
fish -c 'set -U fish_color_normal normal'
|
fish -c 'set -U fish_color_normal normal'
|
||||||
fish -c 'set -U fish_color_command 99cc99'
|
fish -c 'set -U fish_color_command 99cc99'
|
||||||
fish -c 'set -U fish_color_quote ffcc66'
|
fish -c 'set -U fish_color_quote ffcc66'
|
||||||
|
@ -144,23 +146,15 @@ then
|
||||||
# == Remove SU password ==
|
# == Remove SU password ==
|
||||||
sudo sed -i "26s#.*#%sudo ALL=(ALL:ALL) NOPASSWD: ALL#" /etc/sudoers
|
sudo sed -i "26s#.*#%sudo ALL=(ALL:ALL) NOPASSWD: ALL#" /etc/sudoers
|
||||||
|
|
||||||
# Change LTS update to normal
|
# == Update Debian ==
|
||||||
# sudo sed -i "16s#.*#Prompt=normal#" /etc/update-manager/release-upgrades
|
# sudo sed -i "s/bullseye/bullseye/g" /etc/apt/sources.list
|
||||||
# echo -e "\nChannel update moved from \"LTS\" to \"normal\"! 🎉"
|
# sudo sed -i "s/bullseye/bullseye/g" /etc/apt/sources.list.d/*.list
|
||||||
|
|
||||||
# Remove snap for WSL because it block the 21.10 update (https://github.com/microsoft/WSL/issues/6942#issuecomment-879904997)
|
|
||||||
# sudo apt autoremove --purge snapd -y
|
|
||||||
# echo -e "\nSnap daemon removed! 🎉"
|
|
||||||
|
|
||||||
# Alternative solution for the update (https://github.com/microsoft/WSL/issues/6942#issuecomment-901121849)
|
|
||||||
sudo sed -i "s/bionic/impish/g" /etc/apt/sources.list
|
|
||||||
sudo sed -i "s/bionic/impish/g" /etc/apt/sources.list.d/*.list
|
|
||||||
|
|
||||||
# Make the update
|
# Make the update
|
||||||
sudo apt update
|
# sudo apt update
|
||||||
sudo apt full-upgrade -y
|
# sudo apt full-upgrade -y
|
||||||
|
|
||||||
echo -e "\nInstallation terminée.\nIl faut redémarrer l'ordinateur."
|
echo -e "\nInstallation terminée.\nIl faut redémarrer WSL (dans Powershell : wsl -t Debian)."
|
||||||
else
|
else
|
||||||
echo "Ce script ne fonctionne que sur WSL."
|
echo "Ce script ne fonctionne que sur WSL (Debian)."
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue