diff --git a/scripts/common_packages.txt b/scripts/common_packages.txt index 9b81b404..9c78ba1f 100644 --- a/scripts/common_packages.txt +++ b/scripts/common_packages.txt @@ -13,7 +13,6 @@ dialog dmidecode dnsutils file -firmware-linux-nonfree git hdparm iftop @@ -25,14 +24,15 @@ isc-dhcp-client isc-dhcp-common jq less -linux-headers-amd64 -linux-image-amd64 +linux-headers-generic +linux-image-generic lm-sensors locales lsb-release lshw lsof lz4 +lz4 lzop man mc diff --git a/scripts/install_ubuntu.sh b/scripts/install_ubuntu.sh index ddb1f7c1..d0209b35 100755 --- a/scripts/install_ubuntu.sh +++ b/scripts/install_ubuntu.sh @@ -44,19 +44,118 @@ apt-get -yf install . libreoffice.sh . exam.sh . docker.sh -. ubuntu_tweaks.sh -# Install additional packages +# Purge unused Ubuntu packages pkgs=" +apparmor +apport +bind9 +bolt +cups* +exim* +fprintd +friendly-recovery +gnome-initial-setup +gnome-online-accounts +gnome-power-manager +gnome-software +gnome-software-common +memtest86+ +orca +popularity-contest +python3-update-manager +secureboot-db +snapd +speech-dispatcher* +spice-vdagent +ubuntu-report +ubuntu-software +unattended-upgrades +update-inetd +update-manager-core +update-notifier +update-notifier-common +whoopsie +xdg-desktop-portal +" + +apt-get -y purge $pkgs +apt-get -y autoremove --purge + +# Install packages +pkgs="$(cat common_packages.txt) +baobab +blender +dconf-editor emacs f2fs-tools +firefox +gimp +gnome-calculator +gnome-system-monitor +gnome-tweaks golang-mode +i3lock +imagemagick +mpv vim +virtualbox xfsprogs +zenity " - apt-get -y install $pkgs +# Disable services +services=" +apt-daily-upgrade.timer +apt-daily.timer +console-setup.service +e2scrub_reap.service +keyboard-setup.service +motd-news.timer +remote-fs.target +" +systemctl disable $services + +services=" +grub-common.service +plymouth-quit-wait.service +" +systemctl mask $services + +# Disable GTK hidden scroll bars +echo GTK_OVERLAY_SCROLLING=0 >> /etc/environment + +# Reveal boot messages +sed -i -e 's/TTYVTDisallocate=yes/TTYVTDisallocate=no/g' /etc/systemd/system/getty.target.wants/getty@tty1.service + +# Speedup boot +sed -i 's/MODULES=most/MODULES=dep/g' /etc/initramfs-tools/initramfs.conf +sed -i 's/COMPRESS=gzip/COMPRESS=lz4/g' /etc/initramfs-tools/initramfs.conf + +# Reveal autostart services +sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop + +# Remove password complexity constraints +sed -i 's/ obscure / minlen=1 /g' /etc/pam.d/common-password + +# Remove splash screen (plymouth) +sed -i 's/quiet splash/quiet/g' /etc/default/grub + +update-initramfs -u +update-grub + +# Change ext4 default mount options +sed -i -e 's/ errors=remount-ro/ noatime,nodelalloc,errors=remount-ro/g' /etc/fstab + +# Disable swapfile +swapoff /swapfile ||: +rm -f /swapfile +sed -i '/swapfile/d' /etc/fstab + +# Put temporary and cache folders as tmpfs +echo 'tmpfs /tmp tmpfs defaults,noatime,rw,nosuid,nodev,noexec,mode=1777,size=1G 0 0' >> /etc/fstab + # Install additional drivers ubuntu-drivers install ||: diff --git a/scripts/ubuntu_tweaks.sh b/scripts/ubuntu_tweaks.sh deleted file mode 100755 index 5b92db37..00000000 --- a/scripts/ubuntu_tweaks.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env bash - -# Configure ubuntu desktop systems - -script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" -cd "$script_dir" -. set.sh - -# Install dependencies -apt-get -y install lz4 - -# Change ext4 default mount options -sed -i -e 's/ errors=remount-ro/ noatime,nodelalloc,errors=remount-ro/g' /etc/fstab - -# Disable GTK hidden scroll bars -echo GTK_OVERLAY_SCROLLING=0 >> /etc/environment - -# Reveal boot messages -sed -i -e 's/TTYVTDisallocate=yes/TTYVTDisallocate=no/g' /etc/systemd/system/getty.target.wants/getty@tty1.service - -# Speedup boot -sed -i 's/MODULES=most/MODULES=dep/g' /etc/initramfs-tools/initramfs.conf -sed -i 's/COMPRESS=gzip/COMPRESS=lz4/g' /etc/initramfs-tools/initramfs.conf - -# Reveal autostart services -sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop - -# Remove password complexity constraints -sed -i 's/ obscure / minlen=1 /g' /etc/pam.d/common-password - -# Remove splash screen (plymouth) -sed -i 's/quiet splash/quiet/g' /etc/default/grub - -update-initramfs -u -update-grub - -# Disable swapfile -swapoff /swapfile ||: -rm -f /swapfile -sed -i '/swapfile/d' /etc/fstab - - -# Purge unused Ubuntu packages -pkgs=" -apparmor -apport -bind9 -bolt -cups* -exim* -fprintd -friendly-recovery -gnome-initial-setup -gnome-online-accounts -gnome-power-manager -gnome-software -gnome-software-common -memtest86+ -orca -popularity-contest -python3-update-manager -secureboot-db -snapd -speech-dispatcher* -spice-vdagent -ubuntu-report -ubuntu-software -unattended-upgrades -update-inetd -update-manager-core -update-notifier -update-notifier-common -whoopsie -xdg-desktop-portal -" - -apt-get -y purge $pkgs -apt-get -y autoremove --purge - -services=" -apt-daily-upgrade.timer -apt-daily.timer -console-setup.service -e2scrub_reap.service -keyboard-setup.service -motd-news.timer -remote-fs.target -" -systemctl disable $services - -services=" -grub-common.service -plymouth-quit-wait.service -" -systemctl mask $services - -# Install packages -pkgs="$(cat common_packages.txt) -baobab -blender -dconf-editor -firefox -gimp -gnome-calculator -gnome-system-monitor -gnome-tweaks -i3lock -imagemagick -mpv -virtualbox -zenity -" - -# Replace debian packages with ubuntu's -pkgs=${pkgs/linux-image-amd64/linux-image-generic} -pkgs=${pkgs/linux-headers-amd64/linux-headers-generic} -pkgs=${pkgs/firmware-linux-nonfree} - -apt-get -y install $pkgs