Author Topic: Configure PeppermintOS and Maintenance Tips  (Read 1064 times)

Offline cavy

  • Trusted User
  • Member
  • *****
  • Posts: 477
  • Karma: 97
  • Caveman
    • View Profile
  • Peppermint version(s): Peppermint Ten
Configure PeppermintOS and Maintenance Tips
« on: April 29, 2020, 04:54:08 pm »
How to configure a fresh install in UEFI, (SecureBoot) using a sata3 HDD, SSD, M.2 sata or NMVE drive and post maintenance tips

Updated 29 April 2020
 
Update and Upgrade
Code: [Select]
sudo apt update && sudo apt upgrade -y
sudo apt dist-upgrade -y
systemctl reboot

Upon restart follow commands below

Check grub
Code: [Select]
sudo update-grub
Identifying if your Peppermint: has been installed in UEFI mode or Legacy mode
Code: [Select]
[ -d /sys/firmware/efi ] && echo "Installed in UEFI mode" || echo "Installed in Legacy mode"
efi boot order Warning: The command efibootmgr -b xxxx -B DELETES code permanently, use with caution
The efibootmgr command displays current boot order i.e a clean install will be at '0000'
Code: [Select]
sudo efibootmgr -v
sudo efibootmgr -b xxxx -B
Replace x's with i.e '0003' to remove obsolete entry

MOK codes for SecureBoot
Note: March 2020, if you enter a MOK password and confirm with password on initial reboot, you are able to add third party repos, if not, limited to Peppermint only repos
Code: [Select]
bootctl status
mokutil --sb-state
mokutil --list-enrolled

Check current kernel
Code: [Select]
uname -a
uname -n
uname -o
uname -r
dpkg --list | grep linux-image

Version
Code: [Select]
cat /etc/*release
cat /etc/*version

Check Memory Usage
Code: [Select]
free
free -m

Check partitions
Code: [Select]
df -a
df -h
df -k
df -l
df -m
df -P
df –help

Troubleshooting
Code: [Select]
dmesg | more
dmesg | grep Memory
dmesg | grep eth
dmesg -c

dmesg -c will clear the buffer on next restart

Hardware and System
Code: [Select]
sudo lshw | head
sudo lshw -short
sudo lshw -businfo
Specific class
Code: [Select]
sudo lshw -class address
sudo lshw -class bridge
sudo lshw -class bus
sudo lshw -class communication
sudo lshw -class disk
sudo lshw -class display
sudo lshw -class generic
sudo lshw -class input
sudo lshw -class memory
sudo lshw -class multimedia
sudo lshw -class network
sudo lshw -class power
sudo lshw -class printer
sudo lshw -class processor
sudo lshw -class storage
sudo lshw -class system
sudo lshw -class tape
sudo lshw -class volume

inxi codes
Code: [Select]
inxi -Fxz         posting on forums
inxi -c 5         snaphot
inxi -c 5 -b      basic info
inxi -p           harddrive partitions
inxi -r           repos
inxi -F           full info
inxi -AG          sound and graphics info
inxi -ni          network

Speed up the boot time
Single boot ONLY
Code: [Select]
sudo nano /etc/default/grubEdit this line by changing the delay value to 0 seconds, to GRUB_TIMEOUT=0
Save file, sudo update-grub and systemctl reboot

Disable the write action "access time stamp" Warning: always double-check and proceed with caution
Code: [Select]
sudo nano /etc/fstabAdd "noatime" to /, /var and /home partitions: But not swap or the /boot/efi entries
Code: [Select]
UUID=f0ae2c59-83d2-42e7-81c4-2e870b6b255d /               ext4    noatime,errors=remount-ro 0       1
UUID=2468-A1A2  /boot/efi       vfat    umask=0077      0       1
UUID=f0ae2c59-83d2-42e7-81c4-2e870b6b255d /home           ext4    noatime,defaults        0       2
UUID=f0ae2c59-83d2-42e7-81c4-2e870b6b255d /var            ext4    noatime,defaults        0       2
UUID=f0ae2c59-83d2-42e7-81c4-2e870b6b255d none            swap    sw              0       0
Save file, update-grub and systemctl reboot

Manual trim
Depending on your partition scheme
Code: [Select]
sudo fstrim -v /
sudo fstrim -v /var
sudo fstrim -v /home
Allow to finish, i.e returns amount trimmed, plus initial trim tends to be slow

Reduce Swappiness, cache pressure and Torrent Error message (share same file)
Code: [Select]
sudo nano /etc/sysctl.confAdd following text to bottom of sysctl file
Code: [Select]
#Reduce swappiness and cache pressure
vm.swappiness=10
vm.vfs_cache_pressure=50

#########################################################################
# Torrent Error message: Unable to save resume file. Too many open files.
fs.file-max=200000
Save file, sudo update-grub, sudo sysctl -p and systemctl reboot

Clear thumbnail cache
Code: [Select]
rm -v -f ~/.cache/thumbnails/*/*.png ~/.thumbnails/*/*.png
Then
Code: [Select]
rm -v -f ~/.cache/thumbnails/*/*/*.png ~/.thumbnails/*/*/*.png
Clear Recent Files
Code: [Select]
cat /dev/null > .local/share/recently-used.xbel
Then
Code: [Select]
open dconf-editor
click on org → gnome → desktop → thumbnail-cache
click on maximum-age and set it to 30 days
click once on maximum-size and set it to 50Mb

Install Libre Office
Note English GB language defaults are missing
Code: [Select]
sudo apt install libreoffice
sudo apt install libreoffice-l10n-en-gb hunspell-dictionary-en-gb hyphen-en-gb libreoffice-help-en-gb
Final check: open Libre Office -> Tools → Options → Language Settings → Language: to see if the “tick and abc” default symbol is NOW shown

How to remove an app
Example:
Code: [Select]
sudo apt remove rhythmbox --purge && sudo apt autoremove
This removes the app and all its dependencies.
There are occasions when the app name is NOT recognised by apt, due to naming nuances, use Synaptic software package manager to search and uninstall.

DVD playback
Code: [Select]
sudo apt install libdvd-pkg
sudo dpkg-reconfigure libdvd-pkg
To agree to licence, use the tab and enter keys to move or confirm

Check boot up time
Code: [Select]
systemd-analyze time
systemd-analyze blame
systemd-analyze critical-chain

Disable network service (if it retards boot up time)
Code: [Select]
sudo systemctl disable NetworkManager-wait-online.service
Check file and filesystem
Code: [Select]
sudo apt autoclean && sudo apt autoremove
sudo dpkg --configure -a
sudo apt clean

Code: [Select]
dpkg -l | grep ^..r
sudo apt install -f

Code: [Select]
uptime
ls -ld /var/log/installer
ls -ld /lost+found


FireFox Tweaks
Click on this symbol |||\ to add the Bookmark star symbol and the toolbar bookmark.

Cleanse Firefox automatically upon quitting
-> Firefox menu button (the three horizontal dashes on it) -> Preferences -> tab Privacy & Security

a. change the setting to: Firefox will: Use custom settings for history

b. Now tick the following setting: Clear history when Firefox closes

c. Then, click the button Settings..."Clear history when Firefox closes" and tick everything, except for Site Preferences. Click OK.

d. Item Cookies and Site Data: Change the "Accept cookies (...)" setting to: Keep until: Firefox is closed

e. Item Address Bar: remove the tick for: Browsing history

f. Item Tracking protection: leave those settings at their defaults, because otherwise some websites might function less well.

g. Close the Preferences tab and you're done with optimizing the settings for privacy.

Limit the storage
a. Type in the URL bar of Firefox:  about:config  Enter.

b. Now you're being presented with a warning. Ignore it and click on the blue button "I accept the risk!".

c. Type as search term: cache

d. Double-click on browser.cache.disk.smart_size.enabled which is currently set to the boolean value true, so that it changes into false.

e. Then double-click on browser.cache.disk.capacity and change the value into 102400.

By doing that you've set the storage maximum to 100 MB, which is more than enough.

Disable spam by Web Push notifications
a. Type in the URL bar of Firefox:  about:config   Enter.

b. Now you're being presented with a warning. Ignore it and click on the blue button "I accept the risk!".

c. Type as search term: webnotif

d. Double-click on dom.webnotifications.enabled from its boolean value true, to false.

Graphics cards: disable hardware acceleration in Firefox
If you experience graphics problems in Firefox: delay when typing text, problems with displaying video's etc, try:

-> Preferences -> Tab General: remove the tick for: Use recommended performance settings and then remove it for: Use hardware acceleration when available

Close Firefox and launch it again.

Optimize the Places database
Helps speed up Firefox by optimising by vacuuming this database.

Type the following in the URL bar of Firefox:  about:support  Press Enter.

Near the bottom of the page you see it, called Places Database. Click on the button called Verify Integrity.

Repeat monthly, for optimum speed.

Clean slate
Troubleshooting purposes it can be useful to store or even wipe FireFox to its default settings.

a. Launch a terminal window.

b. To disable your current Firefox profile by renaming it. Enter this command:

Code: [Select]
mv -v ~/.mozilla ~/.mozillabackupc. Check if default Firefox profile is present in your user folder. Enter this command:

Code: [Select]
cp -v -r /etc/skel/.mozilla ~/.mozillad. Close Firefox and launch it again. It should have a clean slate now.

e. Test.

Once satisfied restore your old profile like this:

f. Delete newly created profile folder. Enter this command:

Code: [Select]
rm -v -r ~/.mozillag. Restore the old profile: Enter this command:

Code: [Select]
mv -v ~/.mozillabackup ~/.mozilla

Close Firefox and launch it again. A fully restored browser.


“We know what we are, but not what we may be.”

Various machines to sample the delights of Linux

Offline Johan

  • Member
  • ***
  • Posts: 193
  • Karma: 46
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 10
Re: Configure PeppermintOS and Maintenance Tips
« Reply #1 on: April 30, 2020, 06:14:44 am »
I read that for SSD's swappiness should be set to 5 always, but why I don't know :-\
Once Peppermint, always Peppermint.

Online Slim.Fatz

  • Global Moderator
  • Veteran
  • *****
  • Posts: 2344
  • Karma: 616
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: Configure PeppermintOS and Maintenance Tips
« Reply #2 on: April 30, 2020, 08:08:42 am »
Hi Johan,

Five is simply less "aggressive" than 10 and will perform even less use of your swap area/file. For more info see this article;)

Regards,

-- Slim
« Last Edit: April 30, 2020, 11:13:16 am by Slim.Fatz »
Respect science, respect nature, respect each other.

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Offline cavy

  • Trusted User
  • Member
  • *****
  • Posts: 477
  • Karma: 97
  • Caveman
    • View Profile
  • Peppermint version(s): Peppermint Ten
Re: Configure PeppermintOS and Maintenance Tips
« Reply #3 on: April 30, 2020, 08:15:46 am »
I read that for SSD's swappiness should be set to 5 always, but why I don't know :-\

Hi Johan,

In the last five years, I have noticed many tends, but this article by Frank Hoffmann: https://linuxhint.com/understanding_vm_swappiness/  should clarify your assumption.

regards cavy   :D
“We know what we are, but not what we may be.”

Various machines to sample the delights of Linux

Offline The Omen

  • Member
  • ***
  • Posts: 131
  • Karma: 31
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9 respin
Re: Configure PeppermintOS and Maintenance Tips
« Reply #4 on: April 30, 2020, 01:38:19 pm »
Hi @cavy, I love your tutorial.

Wish there was a way to incorporate/merge, yours and mine together.

It would be a "super" list of terminal command "fix-it;s".

https://forum.peppermintos.com/index.php/topic,8828.msg90325.html#msg90325

Warm regards,

The Omen

Online Slim.Fatz

  • Global Moderator
  • Veteran
  • *****
  • Posts: 2344
  • Karma: 616
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: Configure PeppermintOS and Maintenance Tips
« Reply #5 on: April 30, 2020, 01:57:59 pm »
Well, you two could get together online and collaborate to create a single tutorial ... and then after publishing it here each of you could request that a Moderator delete/merge the (current) other two threads & responses so that there is just the one tutorial and relevant responses.  ;)

Regards,

-- Slim
Respect science, respect nature, respect each other.

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Online VinDSL

  • Administrator
  • Hero
  • *****
  • Posts: 5846
  • Karma: 1132
  • Team Peppermint
    • View Profile
  • Peppermint version(s): Developmental Builds
Re: Configure PeppermintOS and Maintenance Tips
« Reply #6 on: April 30, 2020, 05:52:49 pm »
For what it's worth, here's how I setup my rigs:

Code: [Select]
╭─vindsl@Boogaloo-6 ~
╰─$ cat /proc/sys/vm/swappiness
1

Offline cavy

  • Trusted User
  • Member
  • *****
  • Posts: 477
  • Karma: 97
  • Caveman
    • View Profile
  • Peppermint version(s): Peppermint Ten
Re: Configure PeppermintOS and Maintenance Tips
« Reply #7 on: May 01, 2020, 02:42:19 am »
Hi @cavy, I love your tutorial.

Wish there was a way to incorporate/merge, yours and mine together.

Thank you for the compliment, sounds good.

regards cavy   :D
“We know what we are, but not what we may be.”

Various machines to sample the delights of Linux

Offline cavy

  • Trusted User
  • Member
  • *****
  • Posts: 477
  • Karma: 97
  • Caveman
    • View Profile
  • Peppermint version(s): Peppermint Ten
Re: Configure PeppermintOS and Maintenance Tips
« Reply #8 on: May 01, 2020, 02:53:06 am »
For what it's worth, here's how I setup my rigs:

Code: [Select]
╭─vindsl@Boogaloo-6 ~
╰─$ cat /proc/sys/vm/swappiness
1

Alas, you are not the target audience, my friend. As you have a wealth of experience to differentiate between these settings. Plus being able to self-rectify your system.

It is a learn to walk, before you run lesson.

regards cavy   :D
“We know what we are, but not what we may be.”

Various machines to sample the delights of Linux

Offline rayzer

  • Trusted User
  • Member
  • *****
  • Posts: 389
  • Karma: 154
  • Graphics n Stuff
    • View Profile
  • Peppermint version(s): 10 Respin
Re: Configure PeppermintOS and Maintenance Tips
« Reply #9 on: May 01, 2020, 03:28:04 am »
some nice tips there, dont forget to 'man' all the things :D
For wallpapers ive made you can download them here

Offline Johan

  • Member
  • ***
  • Posts: 193
  • Karma: 46
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 10
Re: Configure PeppermintOS and Maintenance Tips
« Reply #10 on: May 01, 2020, 05:27:27 am »
On Peppermint default swappiness is 60. Should I leave it at 60 or keep 5 or set it to 10? :-\
Once Peppermint, always Peppermint.

Offline cavy

  • Trusted User
  • Member
  • *****
  • Posts: 477
  • Karma: 97
  • Caveman
    • View Profile
  • Peppermint version(s): Peppermint Ten
Re: Configure PeppermintOS and Maintenance Tips
« Reply #11 on: May 01, 2020, 05:44:41 am »
On Peppermint default swappiness is 60. Should I leave it at 60 or keep 5 or set it to 10? :-\

Your current setting is the default server setting of 60.

I would recommend the swappiness value of 10.

While you are there include pressure cache and torrent error message values or copy and paste my example into your /etc/sysctl.conf file.

Then Save file, sudo update-grub, sudo sysctl -p and systemctl reboot

Depending on how much ram memory you have in your system, this should make your system and browsing experience crisper.

regards cavy
“We know what we are, but not what we may be.”

Various machines to sample the delights of Linux

Online Slim.Fatz

  • Global Moderator
  • Veteran
  • *****
  • Posts: 2344
  • Karma: 616
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: Configure PeppermintOS and Maintenance Tips
« Reply #12 on: May 01, 2020, 09:16:05 am »
On Peppermint default swappiness is 60. Should I leave it at 60 or keep 5 or set it to 10? :-\
Hi Johan,

It depends on several factors: one is how much RAM you have and the other is how much of that RAM do you tend to use when working/playing. If you have say 4 GB RAM but never do much more than have only three or four browser tabs open and perhaps a Libre Office Writer document then a swappiness value of 10 should be just fine. If you find that you are filling your RAM so much that things start getting swapped out (to your swap file/partition) -- you will notice a dramatic slow-down when the swapping is taking place -- then you should go to a swappiness value of 5 or even 1 to avoid swapping until it is really necessary. Or, of course, you could buy and install more RAM !!  ;)

So, as you can see, there is no simple answer that everyone can use. People who do lots of RAM-intensive work really should simply buy more RAM, but until then they might get by with a very low swappiness value.

Regards,

-- Slim
Respect science, respect nature, respect each other.

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Online VinDSL

  • Administrator
  • Hero
  • *****
  • Posts: 5846
  • Karma: 1132
  • Team Peppermint
    • View Profile
  • Peppermint version(s): Developmental Builds
Re: Configure PeppermintOS and Maintenance Tips
« Reply #13 on: May 01, 2020, 12:24:28 pm »
For what it's worth, here's how I setup my rigs:

Code: [Select]
╭─vindsl@Boogaloo-6 ~
╰─$ cat /proc/sys/vm/swappiness
1

Alas, you are not the target audience, my friend. As you have a wealth of experience to differentiate between these settings. Plus being able to self-rectify your system.

It is a learn to walk, before you run lesson.

regards cavy   :D


Heh! Does this make more sense?   :)


Code: [Select]
###################################################################
# Protected links
#
# Protects against creating or following links under certain conditions
# Debian kernels have both set to 1 (restricted)
# See https://www.kernel.org/doc/Documentation/sysctl/fs.txt
#fs.protected_hardlinks=0
#fs.protected_symlinks=0

# Improve cache management
vm.vfs_cache_pressure=50

# Improve vm.swappiness
# Relative weight given to the swapping out of runtime memory
# 0=disable (WARNING!!! WARNING!!! NEVER DO THIS)
# 1=allows for a minimum amount of swapping without disabling it entirely
# 10=recommended value to improve performance when sufficient memory exists
# 60=compromise value that works well for modern desktop operating systems
# 100=aggressive swapping
vm.swappiness=1

Offline Johan

  • Member
  • ***
  • Posts: 193
  • Karma: 46
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 10
Re: Configure PeppermintOS and Maintenance Tips
« Reply #14 on: May 01, 2020, 12:28:46 pm »
Okay thanks for all the answers. I have 8G, but my Pepp and browsing is fast enough. It has always been ;)
Once Peppermint, always Peppermint.