Linux Mint Notes
These are my reference notes for configuring my Linux Mint computer.
Use RAM for /tmp
#
Add this line to /etc/fstab
to use a RAM-backed file system instead of local storage for /tmp
:
1 2 |
|
This is what the options do:
defaults
is the baseline.nodev,noexec,nosuid
are security precautions to reduce the system attack surface: do not allow special device files, deny file execution, and ignore the SUID bit.nosuid
is redundant ifnoexec
is set, but it's a good idea to keep it just in case you decide to removenoexec
later.
mode=1777
gives everyone full rwx permissions on/tmp
. The1
in1777
is the sticky bit, which prevents a regular user from being able to delete other users' files.size=4096M
sets the maximum size of/tmp
, if not specified it defaults to half the RAM size.
Check if /tmp
is RAM-backed after reboot:
1 2 |
|
Issues Installing GOG Linux Games due to noexec
#
Mounting /tmp
with noexec
is a security best practice, but some software might expect being able to execute files in /tmp
. I hit this problem when installing some Linux games from GOG, which all failed with an error like this:
1 2 |
|
A workaround is to run the MojoSetup installer with the --keep
flag, which makes it write and execute temporary files in the current directory instead of in /tmp
: ./game-installer.sh --keep
.
Disable Swap#
My computer doesn't have a lot of RAM, but I don't run anything too intense either. Since I don't need swap, I would rather that drive space be put to better use by the SSD's wear leveling system.
The Linux Mint 18 installer lets you choose not to use a swap partition, but Linux Mint 19 always uses a swap file located at /swapfile
. Note how this is a special file instead of a separate partition. Here are the steps I used to turn it off:
- Turn swap off:
1 |
|
- Comment out these lines from the file systems table in
/etc/fstab
:
1 2 |
|
- Comment out this line from the encrypted block devices table in
/etc/crypttab
:
1 |
|
- Delete the swap file and reboot:
1 2 |
|
At first I only ran swapoff
without editing the table files in /etc
. This caused some issues that added 30 seconds to the kernel boot time according to systemd-analyze
! The boot time is back to normal after editing the table files.
Configure Redshift Manually#
Redshift is great for eye comfort in the evening (I use it all day). Sadly, the internet location server it uses to determine dawn and dusk times has been retired in 2024, which makes Redshift crash at launch on Linux Mint 20 and 21.
Luckily, you can set the dawn and dusk times manually in $HOME/.config/redshift.conf
, and then redshift
and redshift-gtk
will work again:
1 2 3 4 5 6 |
|
Fix Oversized Icons in the Cinnamon Panel#
When I upgraded to Cinnamon 4.4.8, some of the panel icons like WiFi and Sound were larger than the rest. Here is a way to fix them:
- Right-click panel, select Panel settings
- Under the Panel appearance section select the Left/Center/Right Zone
- Edit the Symbolic icon size (px) value as appropriate
- Standard color icons have an auto-scale option, but symbolic icons are limited to absolute values.
Before:
After:
Battery Care with TLP#
I use TLP to set battery charge thresholds to help keep my laptop battery in good shape for longer. After some online research, it looks like starting to charge when below 75%
and stopping at 80%
is the sweet spot for battery health.
- Install TLP and the ThinkPad support package:
1 |
|
- Send the charge thresholds to the battery controller:
1 |
|
- Also write them to
/etc/tlp.conf
, so they get loaded and set at boot in case they are not persisted in the battery:
1 2 |
|
Use tlp-stat
to confirm the configured thresholds:
1 2 3 4 5 |
|
Show the Time and Checked-out Git Branch on the Shell Prompt#
I customized my Bash prompt to show the current time at the start of every line, and if inside a Git repo also the name of the current branch. This goes at the end of ~/.bashrc
(to override any previously set PS1
, the env var for the prompt's format string),
1 2 3 4 5 6 |
|
The shell prompt should look something like this now:
1 2 3 4 |
|
Convenient Single-Letter Git Command Aliases#
I also keep a few short shell aliases for the Git commands I use the most day to day. All of them are for read-only actions though... Muscle memory for repetitive things is nice, until that one time at 1am...
1 2 3 4 5 6 |
|