Skip to content

Latest commit

 

History

History
300 lines (219 loc) · 8.7 KB

ubuntu.md

File metadata and controls

300 lines (219 loc) · 8.7 KB

Ubuntu

Applications and packages

Application Description
aseprite Pixel art tool
blueman Bluetooth manager
evince Document viewer
gnome-books Ebook reader
gnome-disks Tool to manage storage devices
heroic Epic Games Store launcher
itch itch.io game launcher
lutris Wine, Steam, etc game launcher
obs Tool to record video and perform live streaming
pcmanfm File manager
piper Configure mouse DPI
retroarch ROM game and emulator launcher
seahorse Tool to manage the Gnome keyring
solaar Manage Logitech unifying receivers and devices
usb-creator-gtk Tool to write ISO files to USB storage devices

Desktop environment

Application Description
Betterlockscreen Lockscreen for X11
BSPWM Tiling window manager for X11 (ansible-role-bspwm)
ElKowars wacky widgets (EWW) Bar for X11 and Wayland
Ly Display manager
River WM Dynamic tiling Wayland compositor
Rofi Window switcher, application launcher and dmenu replacement
Stalonetray System tray for X11
Sway WM i3-compatible Wayland compositor
Waybar Bar for Wayland

Monitoring and statistics commands

Command Description
atop AT Computing's System & Process Monitor
htop ncurses-based process viewer for Linux
intel_gpu_top, nvtop, radeontop Monitor graphics devices
iostat CPU and input/output statistics for devices and partitions
lsof Lists on its standard output file information about files opened by processes
mtr Combines the functionality of the traceroute and ping programs in a single network diagnostic tool
nethogs Net top tool grouping bandwidth per process
netstat Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
pidstat Monitor individual tasks currently being managed by the Linux kernel
powertop Power consumption and power management diagnosis tool
sensors Print temperature sensors information
vmstat Report virtual memory statistics

Search for installed applications

grep -li ${SEARCH_TEXT} /usr/share/applications/*.desktop
# or
dpkg -l | grep ${SEARCH_TEXT}

# eg.
$ grep -li music /usr/share/applications/*.desktop
/usr/share/applications/spotify.desktop

Search for Ubuntu packages by filename

sudo apt-get install apt-file
apt-file update
apt-file search ${pattern}

Default application associations

Edit ~/.config/mimeapps.list:

[Default Applications]
text/html=firefox.desktop
application/pdf=org.gnome.Evince.desktop

Associate PDFs with Evince:

xdg-mime default org.gnome.Evince.desktop application/pdf

Post-install cleanup / Uninstall packages

sudo apt purge evolution* language-selector-gnome whoopsie*

# Remove Snap
sudo rm -rf /var/cache/snapd/
sudo apt autoremove --purge snapd gnome-software-plugin-snap speech-dispatcher
sudo apt-mark hold snapd
rm -rf ~/snap

# Free up disk-space
sudo apt autoremove && sudo apt clean

Upgrade Ubuntu from LTS to non-LTS

sudo sed -i 's/^\(Prompt\s*=\s*\)\w\+/\1normal/g' /etc/update-manager/release-upgrades
sudo do-release-upgrade

Disable release upgrade notifications

sudo sed -i 's/^\(Prompt\s*=\s*\)\w\+/\1never/g' /etc/update-manager/release-upgrades
echo -n "" > /var/lib/ubuntu-release-upgrader/release-upgrade-available

Disable language switcher

Use dconf watch / to monitor changes.

Using dconf:

@au [] specifies the type of the empty array (which would not parse otherwise)

# Remove language switcher keyboard shortcut
dconf write /org/gnome/desktop/wm/keybindings/switch-input-source '@au []'

# Disable "Intelligent Input Bus Daemon"
dconf write /org/gnome/settings-daemon/plugins/keyboard/active false

# Restart (replace) ibus-daemon
ibus-daemon -rd

Using dconf-editor:

apt install dconf-editor
dconf-editor
# Navigate to: /org/gnome/desktop/wm/keybindings/switch-input-source
# Set to []

Magic SysRq Keys

Force reboot an unresponsive system.

ALT + SHIFT + PRINT SCR + R E I S U B

unRaw      (take control of keyboard back from X),
 tErminate (send SIGTERM to all processes, allowing them to terminate gracefully),
 kIll      (send SIGKILL to all processes, forcing them to terminate immediately),
  Sync     (flush data to disk),
  Unmount  (remount all filesystems read-only),
reBoot.

Mount a network share in fstab

$ echo '
//$HOSTNAME/stuff /media/stuff cifs defaults,guest,ro 0 0' | sudo tee -a /etc/fstab

Preserve $PATH when using sudo

$ sudo env "PATH=$PATH" command

sysctl settings

$ echo '
fs.file-max = 100000
fs.inotify.max_user_watches = 524288' | sudo tee -a /etc/sysctl.conf

$ sudo sysctl -pf

Temporarily change the date/time using timedatectl

timedatectl set-ntp false
timedatectl set-time "2016-06-20 10:00:00"
timedatectl set-time "10:00:00"
timedatectl set-ntp true

Wipe storage device using hdparm

hdparm -I /dev/sdX (result: Security:not enabled)
hdparm --user-master u --security-set-pass PasSWorD /dev/sdX
hdparm -I /dev/sdX (result: Security:enabled)
hdparm --user-master u --security-erase PasSWorD /dev/sdX
hdparm -I /dev/sdX (result: Security:not enabled)

Xephyr

Grap mouse and keyboard input

CTRL + SHIFT + C

debconf

sudo debconf-show ${packageName}

# or

sudo debconf-get-selections|grep -i ${packageName}

Debugging and troubleshooting

Fix broken grub install

mount /dev/sda1 /mnt \
  mount --bind /dev /mnt/dev \
  mount --bind /proc /mnt/proc \
  mount --bind /sys /mnt/sys \
  chroot /mnt

grub-install /dev/sda

umount /mnt/proc/ /mnt/dev /mnt/sys /mnt

apt update 404

This error occurs when running apt update on an unsupported version of Ubuntu.

sudo sed -i -e 's/\([a-z]*.\?\)\?archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

Redshift.conf is not read when it is a symlink

GitHub issue

  1. Permit access to the symlink source by editing /etc/apparmor.d/local/usr.bin.redshift:
owner @{HOME}/PATH_TO_VAULT/redshift.conf r,
  1. Restart AppArmor:
sudo systemctl reload apparmor

gnome-control-center segmentation fault on startup

This can be caused by accessing the "Sound" section/tab of Gnome Control Center on an installation provisioned by ansible-workstation.

rm -rf .config/dconf/

SSH RSA authentication is not working

RSA SHA-1 is deprecated starting in Ubuntu 22.04. Re-enable it by adding the following to /etc/ssh/ssh_config:

Host *
   # ...
   PubkeyAcceptedKeyTypes +ssh-rsa