Last active
February 28, 2024 22:15
-
-
Save NetOpWibby/4b8c4729b18171a1c3d322837835cf68 to your computer and use it in GitHub Desktop.
server setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# disable "pending kernel upgrade" popup | https://askubuntu.com/a/1424249 | |
sed -i "s/#\$nrconf{kernelhints} = -1;/\$nrconf{kernelhints} = -1;/g" /etc/needrestart/needrestart.conf | |
# ignore "daemons using outdated libraries" popup | https://stackoverflow.com/a/73397110#comment131834051_73397970 | |
sed -i "/#\$nrconf{restart} = 'i';/s/.*/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf | |
# set timezone | |
echo "\n—————\nSetting timezone to US Pacific…\n—————\n" | |
ln -fs /usr/share/zoneinfo/US/Pacific /etc/localtime | |
dpkg-reconfigure -f noninteractive tzdata | |
# update and upgrade packages | |
echo "\n—————\nUpdating and upgrading packages…\n—————\n" | |
apt update && apt upgrade -y | |
# install exa | |
echo "\n—————\nInstalling exa…\n—————\n" | |
apt install exa -y | |
# install zsh | |
echo "\n—————\nInstalling zsh…\n—————\n" | |
apt install zsh -y | |
# install ohmyzsh | |
echo "\n—————\nInstalling ohmyzsh…\n—————\n" | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended | |
exit # exit bash to use zsh | |
# make zsh default shell | |
chsh -s /usr/bin/zsh | |
zsh | |
echo "\n—————\nServer setup complete! Reboot if you want.\n—————\n" |
Ubuntu needs chsh -s /usr/bin/zsh
apparently (instead of chsh -s $(which zsh)
), to change default shell to zsh.
Why do I need to enter chsh -s /usr/bin/zsh
AFTER the script runs and the server reboots, for it to stick?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sh -c "$(curl -fsSL https://gist.githubusercontent.com/NetOpWibby/4b8c4729b18171a1c3d322837835cf68/raw/e797d6732113b89663d2f195c5699f8b93b2bd4b/install.sh)"
Reboot after.