Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
phalanx-hk committed Feb 27, 2024
1 parent d247f03 commit 7eef754
Showing 1 changed file with 28 additions and 17 deletions.
45 changes: 28 additions & 17 deletions install/ubuntu/apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ function addPackerRepo() {
}

function addDockerRepo() {
curl -fsSL 'https://download.docker.com/linux/ubuntu/gpg' | apt-key add -
if [ "$(uname -m)" != "x86_64" ]; then
add-apt-repository -y "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
else
add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
fi
install -m 0755 -d /etc/apt/keyrings
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 "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
}

function addGhRepo() {
Expand All @@ -34,10 +35,6 @@ function addEzaRepo() {
}

function install_apt_package() {
addDockerRepo
addPackerRepo
addGhRepo
addEzaRepo
add-apt-repository -y ppa:git-core/ppa
apt-get update
apt-get upgrade -y
Expand All @@ -46,23 +43,20 @@ function install_apt_package() {
autoconf \
bat \
build-essential \
ca-certificates \
clang \
clangd \
clang-format \
cmake \
docker-ce \
docker-ce-cli \
eza \
curl \
fd-find \
gh \
git \
git-lfs \
gpg \
jq \
libfuse-dev \
libsqlite3-dev \
libssl-dev \
packer \
python3 \
ripgrep \
shellcheck \
Expand All @@ -72,8 +66,25 @@ function install_apt_package() {
wget \
zip \
zsh
mkdir -p "${HOME}"/.local/bin
ln -s /usr/bin/batcat "${HOME}"/.local/bin/bat
mv /usr/bin/batcat /usr/bin/bat
if ! command -v docker &> /dev/null; then
addDockerRepo
apt-get update
apt-get install -y \
docker-ce \
docker-ce-cli \
containerd.io \
docker-buildx-plugin \
docker-compose-plugin
fi
addPackerRepo
addGhRepo
addEzaRepo
apt-get update
apt-get install -y \
gh \
eza \
packer
}

function main() {
Expand Down

0 comments on commit 7eef754

Please sign in to comment.