#!/bin/bash echo "INFO: Mounting efivarfs to avoid errors when generating grub." && mount -t efivarfs none /sys/firmware/efi/efivars && echo "INFO: Updating database of packages." && apt update && echo "INFO: Removing package shim-signed as it causes dependancy issues later." && apt remove -y --allow-remove-essential --purge shim-signed && echo "INFO: Installing packages necessary for the 32 bit grub." && apt install -y efibootmgr grub-common grub-efi-ia32 grub-efi-ia32-bin grub-pc-bin grub2-common mokutil secureboot-db && echo "INFO: Autoremoving and purging unnecessary packages to keep the update clean." && apt autoremove -y --purge && echo "INFO: Installing 32 bit grub to the storage." && grub-install --target=i386-efi --efi-directory=/boot/efi --bootloader-id=GRUB --boot-directory=/boot/ && echo "INFO: Fixing wireless network issues by disabling ipv6 and power management for the module r8723bs." && echo 'options r8723bs rtw_power_mgnt=0' > /etc/modprobe.d/r8723bs.conf && sed -i '/GRUB_CMDLINE_LINUX/ s/"$/ ipv6.disable=1"/' /etc/default/grub && echo "INFO: Generating grub.cfg file." && update-grub && echo "INFO: Checking if disabling the ipv6 took." && grep -i ipv6 /boot/grub/grub.cfg && echo "INFO: Bringing whole system up to date." && apt -y update && apt -y upgrade && apt -y dist-upgrade && apt -y full-upgrade && apt -y --purge autoremove && echo "INFO: Removing Firefox using snap. I dislike Firefox - comment out the next step to keep it." && snap remove firefox && echo "INFO: Updating all the snap installed packages." && snap refresh && echo "INFO: Installing some necessary and some of my favourite packages." && apt -y install mc htop mlocate numlockx inotify-tools iio-sensor-proxy l3afpad && updatedb && echo "INFO: Checking if ubuntu can detect some devices and install drivers for them." && ubuntu-drivers autoinstall && echo "INFO: Are we in X11 or Wayland." && echo $XDG_SESSION_TYPE && # echo "INFO: Switching from Wayland to X11. Not necessary in Ubuntu Mate." && # sed -i 's/#WaylandEnable=false/WaylandEnable=false/g' /etc/gdm3/custom.conf && echo "INFO: Downloading and installing Microsoft Edge browser. Yeah I like it. Sue me :P..." && wget -O microsoft-edge-stable.deb -c 'https://go.microsoft.com/fwlink?linkid=2149051&brand=M102' && apt -y install ./microsoft-edge-stable.deb && echo "INFO: Installing a service file that will disable the num lock at start. Super annoying..." && cd /usr/lib/systemd/system && wget -c https://files.andrzejl.eu/S1002/NumlockOff.service && cat /usr/lib/systemd/system/NumlockOff.service && systemctl daemon-reload && systemctl enable NumlockOff.service && echo "INFO: Enabling some services to fix errors in journalctl." && systemctl enable tlp.service && echo "INFO: Disable some services to fix errors in journalctl." && systemctl disable apport.service && # systemctl disable casper-md5check.service && echo "INFO: Exiting. Please reboot the system now." && exit