fix builds with $SUDO

This commit is contained in:
Frieder Schlesier 2022-01-27 20:02:27 +01:00
parent d9e336de5d
commit 170187d08c
1 changed files with 41 additions and 35 deletions

View File

@ -102,12 +102,12 @@ base_applications() {
zip \ zip \
--no-install-recommends --no-install-recommends
$SUDO restic self-update
echo "... DONE... cleaning up\n\n" echo "... DONE... cleaning up\n\n"
$SUDO apt autoremove $SUDO apt autoremove
$SUDO apt autoclean $SUDO apt autoclean
$SUDO apt clean $SUDO apt clean
restic self-update
} }
@ -199,8 +199,8 @@ install_workstation_apps() {
DEBIAN_FRONTEND=noninteractive DEBIAN_FRONTEND=noninteractive
apt update $SUDO apt update
apt install -y \ $SUDO apt install -y \
alsa-tools \ alsa-tools \
alsa-utils \ alsa-utils \
aspell \ aspell \
@ -295,35 +295,40 @@ install_i3() {
DEBIAN_FRONTEND=noninteractive DEBIAN_FRONTEND=noninteractive
apt update $SUDO apt update
apt install -y \ $SUDO apt install -y \
feh \ feh \
fswebcam \ fswebcam \
i3 \ i3 \
i3lock \ i3lock \
i3lock-fancy \ i3lock-fancy \
i3status \ i3status \
lightdm \
network-manager-gnome \ network-manager-gnome \
network-manager-vpnc \ network-manager-vpnc \
network-manager-vpnc-gnome \ network-manager-vpnc-gnome \
remmina \ remmina \
rxvt-unicode-256color \ rxvt-unicode \
scrot \ scrot \
shotwell \ shotwell \
slim \ suckless-tools \
vlc \ vlc \
xdotool \ xdotool \
xorg \ xorg \
--no-install-recommends --no-install-recommends
cat <<-EOF > /usr/share/dbus-1/services/org.freedesktop.Notifications.service # for f in (); do
[D-BUS Service] # ln -s $f /home/$USER/$f
Name=org.freedesktop.Notifications # done
Exec=/usr/lib/notification-daemon/notification-daemon
EOF # $SUDO cat <<-EOF > /usr/share/dbus-1/services/org.freedesktop.Notifications.service
# [D-BUS Service]
# Name=org.freedesktop.Notifications
# Exec=/usr/lib/notification-daemon/notification-daemon
#EOF
echo "... setting capslock to control" echo "... setting capslock to control"
sed -i "s/^XKBOPTIONS=.*/XKBOPTIONS=\"ctrl:nocaps\"/" /etc/default/keyboard $SUDO sed -i "s/^XKBOPTIONS=.*/XKBOPTIONS=\"ctrl:nocaps\"/" /etc/default/keyboard
} }
@ -333,25 +338,25 @@ install_syncthing() {
curl -s https://syncthing.net/release-key.txt | sudo apt-key add - curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
# Add the "stable" channel to your APT sources: # Add the "stable" channel to your APT sources:
echo "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list cat "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
# pin the correct apt repo # pin the correct apt repo
printf "Package: *\nPin: origin apt.syncthing.net\nPin-Priority: 990\n" | sudo tee /etc/apt/preferences.d/syncthing printf "Package: *\nPin: origin apt.syncthing.net\nPin-Priority: 990\n" | sudo tee /etc/apt/preferences.d/syncthing
# Update and install syncthing: # Update and install syncthing:
sudo apt-get update $SUDO apt-get update
sudo apt-get install syncthing $SUDO apt-get install syncthing
echo "... DONE... cleaning up\n\n" echo "... DONE... cleaning up\n\n"
apt autoremove $SUDO apt autoremove
apt autoclean $SUDO apt autoclean
apt clean $SUDO apt clean
echo "enable and start the syncthing per-user service for ${USERNAME}" echo "enable and start the syncthing per-user service for ${USERNAME}"
cp ../etc/systemd/system/syncth* /etc/systemd/system/ $SUDO cp ../etc/systemd/system/syncth* /etc/systemd/system/
user=${USERNAME} user=${USERNAME}
sudo systemctl daemon-reload $SUDO systemctl daemon-reload
sudo systemctl enable syncthing@${USERNAME} $SUDO systemctl enable syncthing@${USERNAME}
sudo systemctl start syncthing@${USERNAME}.service $SUDO systemctl start syncthing@${USERNAME}.service
systemctl status syncthing@${USERNAME}.service systemctl status syncthing@${USERNAME}.service
} }
@ -363,8 +368,8 @@ install_vscodium() {
echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' | sudo tee --append /etc/apt/sources.list.d/vscodium.list echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' | sudo tee --append /etc/apt/sources.list.d/vscodium.list
apt update $SUDO apt update
apt install -y \ $SUDO apt install -y \
codium \ codium \
--no-install-recommends --no-install-recommends
@ -379,14 +384,15 @@ install_wine() {
# https://wiki.winehq.org/Debian # https://wiki.winehq.org/Debian
curl https://dl.winehq.org/wine-builds/winehq.key | gpg --dearmor > /etc/apt/trusted.gpg.d/winehq.gpg curl https://dl.winehq.org/wine-builds/winehq.key | gpg --dearmor > /etc/apt/trusted.gpg.d/winehq.gpg
echo 'deb https://dl.winehq.org/wine-builds/debian/ bullseye main' | sudo tee --append /etc/apt/sources.list.d/wine.list echo 'deb https://dl.winehq.org/wine-builds/debian/ bookworm main' | sudo tee /etc/apt/sources.list.d/wine.list
apt update $SUDO sudo dpkg --add-architecture i386
apt install \ $SUDO apt update
$SUDO apt install \
winehq-staging \ winehq-staging \
--no-install-recommends --install-recommends
wine version wine --version
} }
@ -398,7 +404,7 @@ install_docker() {
echo "installing docker binary Version $VERS ..." echo "installing docker binary Version $VERS ..."
# https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount # https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount
apt install -y \ $SUDO apt install -y \
apt-transport-https \ apt-transport-https \
ca-certificates \ ca-certificates \
curl \ curl \
@ -415,12 +421,12 @@ install_docker() {
# deb [arch=amd64] https://download.docker.com/linux/debian buster nightly # deb [arch=amd64] https://download.docker.com/linux/debian buster nightly
EOF EOF
apt update $SUDO apt update
apt install -y \ $SUDO apt install -y \
docker-ce \ docker-ce \
--no-install-recommends --no-install-recommends
addgroup ${USERNAME} docker $SUDO addgroup ${USERNAME} docker
docker version docker version
docker info docker info
@ -454,7 +460,7 @@ install_compose() {
install_virtualbox() { install_virtualbox() {
# https://wiki.debian.org/VirtualBox#Installation_of_non-free_edition # https://wiki.debian.org/VirtualBox#Installation_of_non-free_edition
apt install -y \ $SUDO apt install -y \
apt-transport-https \ apt-transport-https \
ca-certificates \ ca-certificates \
curl \ curl \