mirror of
https://github.com/vhaudiquet/mymachine.git
synced 2025-12-19 20:46:08 +00:00
ubuntu: Fix extra packages messages
This commit is contained in:
@@ -75,6 +75,38 @@ refresh_package_db() {
|
|||||||
apt-get update >/dev/null 2>&1
|
apt-get update >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_github_cli() {
|
||||||
|
# GitHub CLI
|
||||||
|
mkdir -p -m 755 /etc/apt/keyrings \
|
||||||
|
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
|
||||||
|
&& cat $out | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
|
||||||
|
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
|
||||||
|
&& mkdir -p -m 755 /etc/apt/sources.list.d \
|
||||||
|
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
|
||||||
|
&& apt update \
|
||||||
|
&& apt install gh -y
|
||||||
|
}
|
||||||
|
|
||||||
|
install_docker() {
|
||||||
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
||||||
|
chmod a+r /etc/apt/keyrings/docker.asc
|
||||||
|
echo \
|
||||||
|
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
||||||
|
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
|
||||||
|
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||||
|
}
|
||||||
|
|
||||||
|
install_kubectl() {
|
||||||
|
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.33/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
|
||||||
|
chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg
|
||||||
|
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.33/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list
|
||||||
|
chmod 644 /etc/apt/sources.list.d/kubernetes.list
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y kubectl
|
||||||
|
}
|
||||||
|
|
||||||
export EXTRA_INSTALL_MESSAGE="Installing snap packages"
|
export EXTRA_INSTALL_MESSAGE="Installing snap packages"
|
||||||
extra_init() {
|
extra_init() {
|
||||||
# Install ghostty
|
# Install ghostty
|
||||||
@@ -88,38 +120,18 @@ extra_init() {
|
|||||||
# TODO: Install android-studio
|
# TODO: Install android-studio
|
||||||
# TODO: Install zen browser
|
# TODO: Install zen browser
|
||||||
|
|
||||||
# GitHub CLI
|
install_github_cli >/dev/null 2>&1
|
||||||
mkdir -p -m 755 /etc/apt/keyrings \
|
|
||||||
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
|
|
||||||
&& cat $out | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
|
|
||||||
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
|
|
||||||
&& mkdir -p -m 755 /etc/apt/sources.list.d \
|
|
||||||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
|
|
||||||
&& apt update \
|
|
||||||
&& apt install gh -y
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo -e "${BRed}Could not install github-cli. Skipping.${NC}"
|
echo -e "${BRed}Could not install github-cli. Skipping.${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Docker, Kubectl
|
# Docker, Kubectl
|
||||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
install_docker >/dev/null 2>&1
|
||||||
chmod a+r /etc/apt/keyrings/docker.asc
|
|
||||||
echo \
|
|
||||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
|
||||||
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
|
|
||||||
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo -e "${BRed}Could not install docker. Skipping.${NC}"
|
echo -e "${BRed}Could not install docker. Skipping.${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.33/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
|
install_kubectl >/dev/null 2>&1
|
||||||
chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg
|
|
||||||
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.33/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list
|
|
||||||
chmod 644 /etc/apt/sources.list.d/kubernetes.list
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y kubectl
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo -e "${BRed}Could not install kubectl. Skipping.${NC}"
|
echo -e "${BRed}Could not install kubectl. Skipping.${NC}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ done
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Install distribution-specific extra packages
|
# Install distribution-specific extra packages
|
||||||
|
echo -e "Initializing extra package installation..."
|
||||||
extra_init
|
extra_init
|
||||||
echo -ne "${EXTRA_INSTALL_MESSAGE}... "
|
echo -ne "${EXTRA_INSTALL_MESSAGE}... "
|
||||||
for package in "${EXTRA_PACKAGES[@]}"; do
|
for package in "${EXTRA_PACKAGES[@]}"; do
|
||||||
|
|||||||
Reference in New Issue
Block a user