Ubuntu
Introduction
I use Ubuntu as my primary OS, specifically the Kubuntu flavor. I also use it over Mac OS and Windows.
Well, now it is 50/50 Kubuntu and elementary OS. Oh, elementary OS isn't really part of the Ubuntu family, but it is based off Ubuntu.
Table of Contents
Apt Stuff
The apt command is tool that manages packages (software programs) in Debian and Ubuntu. I don't have a Debian section, so here it lands. Below are some tips, tricks and other forget-me-nots. Oh, this includes apt-get commands and don't forget most of the commands need sudo before them.
apt --fix-broken install => Some projects provide .deb files for installation. For various reasons, their dependencies do not get installed in the process. You will see something about a package not being listed for installation. This command usually fixes things up. I use it when installing Steam on a new machine.
apt-get -y install -f => Again for downloaded packages that do not get fully installed. It's a bit more bruteforce-ish; use it with caution. I use it when installing Google Chrome and Github Desktop.
Boot Stuff
Dual booting should not be a pain anymore. At least when I redid my laptop on 7/14/2024. There wasn't an automatic way for Windows to boot from grub; there is now. I see "Windows Boot Manager"; it also says what drive it is on. In the past, I've done all the steps below. Now you have to edit the grub defaults and the update-grub command.
sudo nano -w /etc/default/grub
uncomment (remove #) from: GRUB_DISABLE_OS_PROBER=false
change GRUB_TIMEOUT=5 (or another value to your tastes)
change GRUB_TIMEOUT_STYLE=menu (or another value to your tastes)
then create a custom boot entry file for grub:
determine the UUID for the EFI partition of your Windows installation; this is helpful when Windows and Linux are on different drives.
nano -w /etc/grub.d/40_custom
add in the following:
menuentry 'Windows 11' {
search --fs-uuid --no-floppy --set=root <UUID>
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
sudo update-grub (the output won't show the Windows 11 entry, but rebooting should display it)
if you have issues booting Windows 11, check that its boot process did not get messed up. To fix issues, go here for Fixing Boot Issues under Windows.
Change boot splash in Ubuntu(s):
sudo apt install plymouth-theme*
sudo update-alternatives --config default.plymouth
DKMS Modules
Auto-rebuild all dkms modules via command line:
ls /var/lib/initramfs-tools | sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start
Printing
Kubuntu is very different from many other flavors. I switched my Kubuntu machine to elementary OS and noticed that I no longer had "print to pdf". The follow command added it:
sudo apt install printer-driver-cups-pdf
If you have an older Ubuntu flavor, try:
sudo apt-get install cups-pdf
Miscellaneous
Debian / Ubuntu display manager found in /etc/X11/default-display-manager
Problems with lag / slow / freezes while copying large files:
Change how swap file is utilized: sudo sysctl vm.swappiness=10
Change your IO scheduler, which can be done per device: echo "bfq" | sudo tee /sys/block/sda/queue/scheduler
Python in 22.04 LTS is installed weirdly to me. The command python gives an error "No such file or directory". The version of Python installed is version 3. To have python work with version 3 you need to install: sudo apt install python-is-python3