Optimising my Linux Mint installation

 Thu, 13 Oct 2022 08:08 UTC

Optimising my Linux Mint installation
Linux Mint logo: Linux Mint | This image: CC BY 4.0 by cybrkyd


I upgrade my system quite often and when I do, I have a handy checklist that I use to get me setup and running in less than one hour.

I prefer a clean install as opposed to an upgrade; I find that it keeps my system fresh and I like it working as new. Here are my steps to go from installation to production.

A quick note on Firefox: I do not use the Firefox that comes with Linux Mint or any other OS for that matter. I run my own copy from a local folder (which is backed up) to ensure I can keep my profiles, etc. See this post.

1. Restore Backups

Regular backups are a big must. My backups comprise of only the files that I have created and so do not include any system files. For example, I will backup Documents, Downloads, Music, Photos, as well as some of my personal configuration files like .bash_aliases, .thunderbird, et cetera.

Once my install has completed, I start restoring my backups to their original place.

2. Make password for root

It is beyond me why Ubuntu / Linux Mint do not insist upon root account password setting during install. Debian does, so not quite sure what the issue is with these two chaps. A huge security gap but never mind, it is easily fixed.

Open a terminal and run this command to set a good, strong root password:

$ sudo passwd root

3. Enable UFW

Turn on the firewall. This can be easily achieved via the gufw application or the command line:

$ sudo ufw enable

4. Install preferred applications

Here are mine:

$ sudo apt install conky gedit audacity geany filezilla darktable ffmpeg \ 
potrace kid3 simplescreenrecorder sct audacious flac pass gimp mpv \ 
pavucontrol telegram-desktop inkscape imagemagick virtualbox goldendict \ 
chromium geany-plugin-spellcheck

5. Remove the applications I don’t need

Apparently, new Linux users have recommended to them that they should not remove any of the applications shipped with their distribution in case something breaks. I have never heard a more ridiculous recommendation!

$ sudo apt purge rhythmbox celluloid firefox hexchat xed timeshift thingy \
mintbackup warpinator mintwelcome mintreport webapp-manager redshift \
firefox-locale-en baobab

Let me explain my rationale.

  • Firefox: replaced by my own version that I update locally.
  • Timeshift: a backup application that I don’t use as I have my own backup routine.
  • mintbackup: another backup tool? We need two, right?
  • mintwelcome: a nice screen that says ‘Hi’. Delete.
  • mintreport: a troubleshooting tool to analyse crash reports and browse through important information.
  • webapp-manager: an application to run websites as if they were apps.
  • redshift: nice, really nice but I prefer to use an application called xsct.
  • xed: Linux Mint’s text editor. I prefer gedit.
  • rhythmbox, celluloid, hexchat, warpinator, baobab, thingy: I don’t need or use.

6. Update and clean

First, let’s upgrade everything:

$ sudo apt update -qq && sudo apt upgrade

Once my system is updated, give it a clean:

$ sudo apt autoremove

7. Reduce swap

Add to bottom of /etc/sysctl.conf:

First:

$ sudo gedit /etc/sysctl.conf

Second, add to bottom of file:

vm.dirty_background_ratio = 5
vm.dirty_ratio = 10
vm.swappiness = 10

Third, save and close, then run this command to load the new settings:

$ sudo sysctl -p

8. Tame systemd

Reduce journal size:

$ sudo gedit /etc/systemd/journald.conf

un-comment SystemMaxUse then set to:

SystemMaxUse=100M

Add more if you need to. Save and close.

Reduce wait at shutdown:

$ sudo gedit /etc/systemd/system.conf

un-comment DefaultTimeoutStopSec then set to:

DefaultTimeoutStopSec=5s

Save and close.

Run this command to load the new settings:

$ systemctl daemon-reload

9. Reboot.

Finished. Linux Mint is production ready. Note: this may also work with Ubuntu and Debian, obviously with some slight variations.