System hacks for advanced Linux Mint users


Back to the home page

Below you'll find some advanced hacks for Linux Mint, only meant for users with a lot of Linux experience. Not for beginners!

Contents of this page:

Enable the frozen Guest session (guest account) and customize it to your liking

1. Note: this feature currently only works well in Linux Mint 19.x. In Linux Mint 20 this feature has some bugs that still need to be ironed out. If you still want 20: in the Xfce edition this feature has the least bugs.

Present by default in a cleanly installed Linux Mint: an idiot-proof guest account that automatically reverts to the default settings upon reboot (or upon logout).

This frozen guest account runs in kiosk mode (full confinement), so all changes in the guest session are being deleted at reboot or logout. It's a nice and handy feature of display manager LightDM.

Unfortunately its confinement currently isn't as complete as it should be, in combination with the systemd of Linux Mint. So it has been disabled by default. If you're willing to take that incomplete confinement onto the bargain, you can enable it as follows:

a. Menu button - Administration - Login Window

Tab Users: Allow guest sessions: switch it on.

b. Reboot your computer.

c. The guest session has default settings which might not suit you. You can adapt the default settings of the guest account by means of a trick: you can create a "skeleton" account with the right settings, and then configure the Guest session to copy those settings from the "skeleton" account.

This is how you do that:

d. Create a new user account, called Framework. You can do that by launching "Users and Groups" from the menu. This new account should be a normal user account with no special privileges.

Note: the "Full Name" of this new user should begin with a capital letter! Not the "Username", because user names have to be all lowercase. But in "Users and Groups" the new "Full Name" should begin with a capital letter, because otherwise a malfunction might occur.

Ensure that a password is required for logging into this new user account. It's best to set the same password as the one for the account of the system administrator (your personal account), because only the system administrator should be able to log into it.

e. Log out and then log into the new user account Framework, and configure it the way you want the Guest session to become. For example with a nicer wallpaper instead of Mint's default eternal night, and with different settings for Firefox and Libre Office.

In the next step you'll ensure that the Guest session will copy all of its settings from the new account Framework. You can change those settings later on as well: later changes in Framework will also land automatically in the Guest session.

f. Log out from the Framework account and log into the account of the system administrator (your personal account).

g. Launch a terminal window.
(You can launch a terminal window like this: *Click*)

h. Then in the terminal (use copy/paste to avoid typing errors):

sudo ln -v -s /home/framework /etc/guest-session/skel

Press Enter.

(note that framework doesn't begin with a capital letter in the command)

i. Log out from your account and log into the Guest session. Now it should have the same settings as the new user account Framework.

The only disadvantage is, that you now have an extra "useless" user account in the login window.

Do you want to make new changes later on? That's simple: later changes in the Framework account, will also land automatically in the Guest session.

Use Conky to monitor your system

2. Conky is a very useful and versatile tool for checking what's going on in your system. You can find a how-to with screenshots on this page.

Automatic shutdown when closing laptop lid (all desktop environments)

3. It's useful when closing the laptop lid invokes an automatic shutdown, even when Power Manager doesn't allow for that option in your desktop environment. In all desktops that can be achieved like this:

a. Copy/paste the following command line into the terminal:

xed admin:///etc/systemd/logind.conf

Press Enter.

b. In that text configuration file, find the following line:

HandleLidSwitch=ignore

in some cases this line looks a bit different, namely: #HandleLidSwitch=suspend

Delete it and replace it by this line:

HandleLidSwitch=poweroff

Save the modified text file and close it.

c. Reboot your computer. Closing the laptop lid should now evoke an automatic shutdown of your computer.

Note (1): in the lightweight Xfce edition of Linux Mint, sometimes (not always) Xfce's Power Manager needs to be configured to allow systemd (or rather: logind) to perform a full shutdown of your laptop upon closing the lid, when you've configured logind to do so.

That can be achieved like this:

- Menu button - Settings - Settings Editor. Make it full screen, so you can operate it easily.

- In its left panel, click on xfce4-power-manager.

In its right panel, tick (enable) the value for:
logind-handle-lid-switch

Is there no such value? Then create it as a new Boolean value (and set it to TRUE).

- Close Settings Editor.

- Reboot (or log out and in again).

Note (2): on some laptops an undesirable side effect might occur, namely a CPU that becomes very hot, causing its cooling fan to start blowing full speed all the time.

In that case I advise to undo this hack.

Disable IPv6 (when you can't establish internet connection)

4. Some old modems and routers can't deal properly with modern IPv6. This might cause a bad unstable connection or even a complete failure to establish any connection at all. In that case, disable IPv6 like this:

Menu - Preferences - Network Connections

Click on the name of your current connection - click the button Edit...
Tab IPv6 Settings - Method: change it into Ignore

Click the button Save... and then click the button Close

Disconnect and reconnect, or simply reboot your computer.

Problems with Libre Office? Install a newer Libre Office

5. If you experience problems with your current version of Libre Office, you can install a later version of Libre Office with a PPA.

This is how to do it (item 8).

How to manually install a non-free driver for your Nvidia video card

6. Do you have a graphics card from Nvidia, which is so new that the proprietary restricted driver version in the software repositories of Mint is too old? Then you can proceed like this.

Install the latest iwlwifi driver for your Intel wireless card

7. In certain circumstances you may need a newer iwlwifi driver for your Intel wireless card, than the one that's available by default. For getting that, see this how-to (*click*).

Install a brand-new unsupported kernel

8. Sometimes, when you have a very new computer, you have a problem: the drivers in the Linux kernel of Linux Mint, aren't recent enough. In that case, you can do the following:

a. First of all, you can try whether a newer officially supported kernel suffices:
From the menu, launch Update Manager. In the toolbar of Update Manager: View - Linux kernels

Install the very latest kernel in the list.

Then reboot your computer.

b. If that kernel still isn't new enough, you can install an even newer and wholly unsupported kernel by means of a non-official (and therefore theoretically less safe) software source: the canonical-kernel-team PPA.

The Canonical Kernel Team PPA has a good reputation, because the Canonical Kernel Team consists out of the people that create the official Ubuntu/Mint kernels as well.

Note 1: The newer kernel you're about to install is unsupported in your version of Linux Mint, so there's an increased risk of malfunctions and errors. This should therefore only be done as emergency measure.

Note 2: If you're currently using the closed non-free Nvidia driver or the amdgpu driver from AMD, the newer kernel from this PPA might not support it.

The method is as follows:

Launch a terminal window.
(You can launch a terminal window like this: *Click*)

Then in the terminal (use copy/paste to avoid typing errors):

sudo add-apt-repository ppa:canonical-kernel-team

Press Enter. Type your password when prompted. In Ubuntu this remains entirely invisible, not even dots will show when you type it, that's normal. In Mint this has changed: you'll see asterisks when you type. Press Enter again.

With this, you add the software source to your sources list.

c. Then in the terminal (use copy/paste):

sudo apt-get update

Press Enter. With this, you inform your system about the contents of the newly added software source.

d. From the menu, launch Update Manager. In the toolbar of Update Manager: View - Linux kernels
Install the very latest kernel in the list.

e. Reboot your computer.

f. After this reboot your computer should run on the latest kernel. Check it by means of the following terminal command:

uname -r

Press Enter.

Even more risky: a bleeding edge kernel from the cowboys

8.1. Do you want to try an even newer unsupported kernel than the already risky "ordinary" unsupported kernel from Canonical Kernel Team? Then you can get a bleeding edge high-risk kernel from the cowboys: the unstable branch of Canonical Kernel Team. In this way:

First:
sudo add-apt-repository ppa:canonical-kernel-team/unstable

Secondly:
sudo apt-get update

Thirdly:
Launch Update Manager and use its kernel tool.

Finally:
Reboot and pray for the best. Yeehaw!

Quicker updates for Firefox

9. Updates for your web browser Firefox come from Mint's own repository, not straight from the Ubuntu sources. In some cases, this might mean a delay of several days before you get the latest Firefox.

If you don't want to wait, you can instruct your Mint to prefer the Ubuntu version of Firefox. Like this:

a. Launch a terminal window.
(You can launch a terminal window like this: *Click*)

b. Then create a certain new file by means of this terminal command (use copy/paste to avoid typing errors):

sudo touch /etc/apt/preferences.d/firefox-ubuntu

Press Enter. Type your password when prompted. In Ubuntu this remains entirely invisible, not even dots will show when you type it, that's normal. In Mint this has changed: you'll see asterisks when you type. Press Enter again.

Then copy/paste this line into the terminal, in order to edit the new file:

xed admin:///etc/apt/preferences.d/firefox-ubuntu

Press Enter.

c. In that empty text file, copy/paste the following blue text:

Package: firefox*
Pin: release o=Ubuntu
Pin-Priority: 800


d. Save the modified text file and close it.

e. Launch Update Manager, refresh it and install the updates for Firefox (if any).

f. Close Firefox and launch it again.

Lost localization in the Ubuntu Firefox?

9.1. When you have a non-English Firefox, the Ubuntu Firefox that you've just installed might have lost its localization and turned fully English. This is how to fix that:

In the address bar of Firefox, type:

about:config

Press Enter and then click to accept the risk.

Then right-click anywhere on that page - New - String

Give the new string this name:

intl.locale.requested

Leave the value empty; this forces Firefox to follow the system locale.

Click OK.

Close Firefox and restart it.

Install the latest CPU microcode from upstream

10. By way of emergency measure you can install the latest CPU microcode from upstream, like this.

How to add booting from an ISO file to the Grub bootloader menu

11. Do you want to test an iso from a particular Linux, and don't you have a USB thumb drive or DVD at hand? No worries: you can boot directly from an ISO file in the Grub bootloader menu, simply by creating a menu entry for it.

Proceed like this:

a. Launch a terminal window.
(You can launch a terminal window like this: *Click*)

b. Use copy/paste to transfer the following command line into the terminal:

xed admin:///etc/grub.d/40_custom

Press Enter. Type your password when prompted (it will be asked twice).

c. Delete the current contents of the text file that you've just opened and copy/paste the following blue code block into it:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'ISO from Linux Mint 20 Cinnamon' {
set isofile='/home/pjotr/Downloads/linuxmint-20-cinnamon-64bit.iso'
loopback loop (hd0,gpt1)$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=${isofile} quiet splash
initrd (loop)/casper/initrd.lz
}

Note: don't omit the last line with the accolade } !

The three important variable parts of that code block, which you need to adapt to your own situation, are the following:

I. The menu entry name. In the code block it's now:
ISO from Linux Mint 20 Cinnamon

II. The file path including the filename. In my case I had downloaded the iso file of Linux Mint 20 Cinnamon with my web browser, so I just left it in the default Downloads folder in my personal folder and created that file path directly to it:
/home/pjotr/Downloads/linuxmint-20-cinnamon-64bit.iso

III. The hard disk indicator (hd0,gpt1). In my case this points to the first hard drive and the first partition, which is the partition containing the .iso file. This hard disk indicator might be without the gpt indication on your computer, so: (hd0,1).

Check what the exact hard disk indicator is on your own computer, with the following terminal command (use copy/paste to transfer it to the terminal):

cat /boot/grub/grub.cfg | grep root=

Press Enter.

Sidenote: mark the annoyingly confusing hybrid way of numbering: the first hard disk is 0 (the nerd way of counting which starts with 0), but the first partition on that disk is 1 (the normal way of counting which starts with 1). It beats my imagination, but the guys in charge apparently actually thought that implementing such irritating hybrid numbering confusion was a good idea...

d. Save and close the modified text file.

e. Now you're going to inform your boot loader about the changes you've just made. Use copy/paste to transfer the following command line into the terminal:

sudo update-grub

Press Enter. Type your password when prompted. In Ubuntu this remains entirely invisible, not even dots will show when you type it, that's normal. In Mint this has changed: you'll see asterisks when you type. Press Enter again.

f. Reboot and test.

How to execute a root command automatically on startup

12. If you wish to execute a root command, for which you need "sudo" permissions, automatically on startup, this is how to do it.


Want more tips?

Do you want more tips and tweaks? There's a lot more of them on this website!

For example:

Speed up your Linux Mint!

Clean your Linux Mint safely

Avoid 10 fatal mistakes


To the content of this website applies a Creative Commons license.

Back to the home page

Disclaimer