-
Notifications
You must be signed in to change notification settings - Fork 0
/
debianWslFreshInstall
executable file
·102 lines (76 loc) · 4.2 KB
/
debianWslFreshInstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
# apt-get commands to upgrade system
sudo apt-get-get update
sudo apt-get-get -y upgrade
# apt-get command to install some software I usually use on Debian WSL Distribution
sudo apt-get -y install \
wget vim curl awscli apt-get-plugin-system-upgrade jq gpg kernel-devel kernel-headers gcc make dkms python3 \
acpid libglvnd-glx libglvnd-opengl libglvnd-devel pkgconfig vdpauinfo libva-vdpau-driver libva-utils xclip pwgen
# Copying .bash_aliases on this repo to user's home directory; Maybe a combination with cat and appending unique values might be better; I did this a while ago so maybe I had my reason to do it like this, can't remember right now.
if [ -f ~/.bash_aliases ]; then
echo "File ~/.bash_aliases already exists!"
else
cp .bash_aliases ~/.bash_aliases
fi
# Adding addToBashrc contents to .bashrc file in users' home directory
if [ -f ~/.bashrc ]; then
echo "File ~/.bashrc already exists!"
else
cat addToBashrc >> ~/.bashrc
fi
# Sourcing files so their content is readily availabe
source ~/.bash_aliases ~/etc/.bashrc
# Creating a directory to put some installers inside and switching to it
mkdir -vp /home/dl/installers
cd /home/dl/installers
# Download and install kubectl
# Download and installation of GitHub CLI as copied from https://github.com/cli/cli/blob/trunk/docs/install_linux.md
# on 20230528 @ ~ 15.30 UTC
type -p curl >/dev/null || (sudo apt-get update && sudo apt-get install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt-get/sources.list.d/github-cli.list > /dev/null \
&& sudo apt-get update \
&& sudo apt-get install gh -y
# Download and installation of docker as copied from https://docs.docker.com/engine/install/debian/
# on 20230528 @ ~ 15.30 UTC
## Uninstall old versions
### Uninstall all conflicting packages
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
# Install using the apt repository
## Set up the repository
### Update the apt package index and install packages to allow apt to use a repository over HTTPS:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
### Add Docker’s official GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
### Setup repo
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
## Install Docker Engine
### Update apt package index
sudo apt-get update
### Install Docker Engine, containerd, and Docker Compose (latest)
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
### Verify that the Docker Engine installation is successful by running the hello-world image
sudo docker run hello-world
# Install minikube stable from Debian repo as copied from https://minikube.sigs.k8s.io/docs/start/
# on 20230528 @ ~ 15.30 UTC
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
sudo dpkg -i minikube_latest_amd64.deb
# eksctl for AWS EKS CLI installation as copied from https://github.com/weaveworks/eksctl/blob/main/README.md#installation
# according to https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html
## for ARM systems, set ARCH to: `arm64`, `armv6` or `armv7`
ARCH=amd64
PLATFORM=$(uname -s)_$ARCH
curl -sLO "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz"
## (Optional) Verify checksum
curl -sL "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_checksums.txt" | grep $PLATFORM | sha256sum --check
tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && rm eksctl_$PLATFORM.tar.gz
sudo mv /tmp/eksctl /usr/local/bin
# Removing folder
rm -rvi /home/dl