Skip to contentSkip to index linksSkip to footer
Enable Modern theme


Below is a list of random Debian based Linux information for my reference. This info also includes some fixes for Raspberry Pi specific related issues.


Random Linux Information

01  What apps are useful for a New (clean) Install Debian

Misc apps etc…:

sudo apt install ufw gufw fonts-noto-color-emoji conky 7zip rclone tree traceroute inkscape rpi-imager vlc gnome-disk-utility bat sshfs sshpass audacious ansiweather lynx psensor mesa-vulkan-drivers mesa-utils vulkan-tools nmap mame zoxide fzf sxiv pass pass-otp ncal font-manager ark epiphany-browser netsurf-gtk supertuxkart dunst geany

Install VSCodium:

curl -fsSL https://repo.vscodium.dev/vscodium.gpg \
| gpg --dearmor \
| sudo dd of=/usr/share/keyrings/vscodium.gpg

sudo curl --output-dir /etc/apt/sources.list.d -LO https://repo.vscodium.dev/vscodium.list

sudo apt install codium

Flatpak package manager:

sudo apt install flatpak

flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

GIMP Beta:

flatpak install --user https://flathub.org/beta-repo/appstream/org.gimp.GIMP.flatpakref

GIMP stable:

flatpak install --user gimp

Netsurf web browser:

flatpak install --user netsurf

Password manager:

flatpak install --user keepassxc

Office suite:

flatpak install --user libreoffice

SNAP Package manager:

sudo apt install snapd

SNAP Store and Commander x16 emulator:

snap install core snap-store x16emu

02  Terminal Debian

Use the following key-presses to open a terminal window:

Crtl + Alt + T

To display the terminal command history use the following command:

history

03  Software update and Tidy up Debian

Use the following commands in a terminal window to update Linux to the latest software:

sudo apt update

sudo apt full-upgrade

Tidy up install:

sudo apt -y autoremove && sudo apt -y clean && sudo apt -y purge ?config-files

04  Journal files (journalctl) Debian

Use the following command in a terminal window to clear out all journal files older than 1 day

sudo journalctl --vacuum-time=1d

Use the following command in a terminal window to clear out all journal files but leave the most recent files upto the specified amount of disk space (##B, ##M, ##G)

sudo journalctl --vacuum-size=1B

Use the following command in a terminal window to find out the amount of disk space it taken up by journaling

journalctl --disk-usage

Use the following command in a terminal window to disable journaling

systemctl disable systemd-journald

05  Location of script files Debian

Scripts can be placed in the following directory so you don't have to require the full path

/usr/local/bin

06  Network Manager Debian

To stop use the following

sudo systemctl stop NetworkManager.service

To start use the following:

sudo systemctl start NetworkManager.service

To restart use the following:

sudo systemctl restart NetworkManager.service

07  Stop audio setting defaulting to headphones RasPi OS Ubuntu

Use the following (for Ubuntu 22.04 LTS):

sudo nano /etc/pulse/default.pa

Find "load-module module-switch-on-connect.so" and comment it out by adding a # to the front of the line

08  Scrambled online accounts screen Ubuntu RasPi OS Gnome

Use the following in terminal to open the settings with the screens unscrambled:

WEBKIT_DISABLE_COMPOSITING_MODE=1 gnome-control-center

09  Stop polling for an SD card constantly when not using one RasPi OS

Edit config.txt

sudo nano /boot/firmware/config.sys

Add the following to the end of config.txt

dtparam=sd_poll_once

10  Get the CPU temparature RasPi OS

Use the following command:

cat /sys/class/thermal/thermal_zone0/temp

Note: The result needs to be divided by 1000 to get the actual temperature in °C

11  *.desktop file, allow launching Debian

Use the following command:

gio set file.desktop metadata::trusted true

12  Add *.desktop file to launcher and/or menu Debian

Copy the *desktop file into the following folder:

~\.local\share\applications

13  Turn off splash screen RasPi OS

Edit the following file:

sudo nano /boot/firmware/cmdline.txt

Remove the following from the end of the line:

quiet splash

14  Backup / Restore entire HDD using command line (Terminal) Debian

Backup:

dd if=/dev/sda of=./part1.image

Restore:

dd if=./part1.image of=/dev/sda

15  Compressed backup to img file using command line (Terminal) Debian

Backup:

cd ~

sudo dd if=/dev/<drive> | gzip -c - > <name>.img.gz

Where <drive> is the name of the mounted drive ie sde, mmcblk0, etc…

16  Login screen settings Gnome

Use the following to edit the settings:

sudo nano /etc/gdm3/greeter.dconf-defaults

Some settings under the [org/gnome/desktop/interface] section:

cursor-size=64

text-scaling-factor=1.50

clock-format="12h"

17  ALT + F2 to open Run.. dialogue Wayfire Labwc

Add the following into the file ~/.config/wayfire.ini at the bottom of the [command] section:

binding_power = <alt> KEY_F2

command_power = sh -c "$(zenity --entry --title='Run' --text='Enter Command' --width='800')"

Place the following in the labwc ~/.config/labwc/rc.xml file

<keyboard>
<keybind key="A-f2">
<action name="Execute">
<command>sh -c "$(zenity --entry --title='Run' --text='Enter Command' --width='800')"</command>
</action>
</keybind>
</keyboard>

18  Configure Network Manager from CLI RasPi OS Bookworm

Use the following command:

nmtui

19  Auto update CertBot using cron Debian

Use the following command to create a cron job:

sudo touch /etc/cron.d/certbot

Use Nano to edit the above file

sudo nano /etc/cron.d/certbot

Cut and paste the following into nano and save the file

# /etc/cron.d/certbot: crontab entries for the certbot package
#
# Upstream recommends attempting renewal twice a day
#
# Eventually, this will be an opportunity to validate certificates
# haven't been revoked, etc. Renewal will only occur if expiration
# is within 30 days.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e "sleep int(rand(3600))" && certbot -q renew

20  Show network information Debian

Use the following command (change eth0 for the device you're interested in):

nmcli device show eth0

21  Check firmware is up to date RasPi OS

Use the following command:

sudo rpi-eeprom-update

22  Stop / Start a package from updating via apt Debian

Use the following commands:

sudo apt-mark hold package-name

sudo apt-mark unhold package-name

or to show packages on hold

sudo apt-mark showhold

23  numlock on at system start Debian

Use the following command to install the app numlockx:

sudo apt install numlockx

24  Dark mode for the login screen RasPi OS

Edit the file /etc/lightdm/pi-greeter.conf:

[greeter]
default-user-image=/usr/share/raspberrypi-artwork/annieuk.png
desktop_bg=#000000000000
wallpaper=/usr/share/rpd-wallpaper/RPiSystemdark.png
wallpaper_mode=crop
gtk-theme-name=PiXnoir
gtk-icon-theme-name=PiXflat
gtk-font-name= PibotoLt 24

Note: The directories the wallpaper and icons come from should not be altered as this seems to be hardcoded somewhere, just place and new wallpaper / icon files in the above directories

25  Find names and info of devices on the network Debian

Use the following command:

avahi-browse -alr

26  Find MAC address and device manufacturer of most network device Debian

Use the following command:

sudo nmap -sn 192.168.1.0/24

27  Clear swap file when plenty of RAM free Debian

Use the following commands:

sudo swapoff -a; sudo swapon -a

28  Fix windows MBR after GRUB installed Windows

Boot up an install CD/DVD (ie Windows 7) and enter the recovery console, use the following command in a command window:

bootrec /fixmbr

29  Location of menu icons RasPi OS

Menu icons can be found in the following directory:

/usr/share/pixmaps

30  Add desktops (workspaces) to window manager Labwc

Add the following to ~/.config/labwc/rc.xml file:

<desktops>
  <popupTime>1000</popupTime>

  <names>
    <name>Desktop 1</name>
    <name>Desktop 2</name>
    <name>Desktop 3</name>
    <name>Desktop 4</name>
  </names>
</desktops>

<keyboard>
  <keybind key="W-C-Left">
    <action name="GoToDesktop" to="left" />
  </keybind>

  <keybind key="W-C-Right">
    <action name="GoToDesktop" to="right" />
  </keybind>
</keyboard>

31  Reload rc.xml configuration file after changes Labwc

Use the folowing command to load the configuration after changes:

labwc --reconfigure

32  Test speakers Debian

Use the folowing command:

speaker-test -t wav -c x

x = number of channels/speakers

33  How to install Nerd Fonts Debian

Use the folowing command (all one line):

bash -c "$(curl -fsSL https://raw.githubusercontent.com/officialrajdeepsingh/nerd-fonts-installer/main/install.sh)"

I use: Hack Nerd Font

34  How to reboot Linux during a lock up Debian

Use the folowing key sequence:

Make sure disk activity has stopped,
Press: sysreq r
Press: sysreq e
Press: sysreq i
Press: sysreq s
Press: sysreq u
Press: sysreq b

35  Chromium default flags Debian

Edit the file default-flags within the directorry /etc/chromium.d