User Tools

Site Tools


wiki:linux:installopensuse15

Configuring a Fresh OpenSuse Leap 15 Installation

This is my recipe for what to do with OpenSuse Leap 15 after a fresh, default installation. I'm using the KDE Plasma desktop -and my intention is to use mainly KDE programs where possible. I also like to do most of configuring at the command-line wherever possible (on the grounds that cutting-and-pasting a command into a terminal is a lot easier than trying to follow 'click here, then there, then that icon, no not that one, over here…' kind of instructions!!)

1.0 Update all existing packages

sudo zypper update

Note that if you were connected to a network during the original O/S installation and selected to configure online repositories, you may well find that there's nothing to update at this point, since the relevant updates would have been performed as part of the basic installation. It never hurts to be sure you're fully up-to-date, though!

2.0 Enable the Packman Repository

sudo zypper ar -cfp 90 http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_15.0/ packman
sudo zypper update

The Packman repository is the source of all good things multimedia-esque which OpenSuse cannot include in its default packages for copyright or intellectual property reasons. It nevertheless contains audio and video codecs which are pretty much compulsory these days, so adding it to the mix is important to do.

Note that when you add a repository at the command line as I'm doing here, you will be prompted whether you want to trust its package-signing encryption key: you should type 'a' as an answer to that, meaning 'always trust this key' (assuming that you do indeed think the folk behind the repository you're adding are trustworthy folk, of course!)

3.0 Add extra software packages & applications

There are lots of different ways of adding new software to OpenSuse: there's a link to the 'Discover' software store, for example, provided by default on the start menu. But getting everything with one simple command rather than a lot of mouse-pointing and -clicking seems a more sensible way of doing things to me. Therefore:

sudo zypper install stellarium darktable abcde audacity puddletag easytag \
vlc calibre filezilla flac lame cifs-utils homebank clementine \
keepassxc tilix krita digikam qbittorrent kolourpaint devede handbrake-cli \
handbrake-gtk thunderbird yakuake makemkv x264 x265 partitionmanager \
latte-dock kwrite clamav clamtk opera gcc make perl kernel-default-devel

(That could all go on a single line, but I've broken it up and added '\' line continuation markers to make it look better when formatted here).

The software packages listed make this distro work for me. You may well want to add other things to the mix, of course. A quick run-down of each listed application now follows:

Name Description
stellarium A desktop planetarium, useful for working out what's visible in the night sky
darktable A photography workflow application and RAW image developer, like Lightroom on Windows
abcde A better CD Encoder: rip music CDs to assorted audio formats at the command line
audacity An audio file editor
puddletag An audio file metadata tag editor
easytag Another audio file metadata tag editor
vlc A video and media player
calibre Somewhat quirky software that lets you manage Ebooks
filezilla An ftp client
flac A lossless audio codec
lame A lossy audio codec -allows listening, encoding and transcoding to MP3 audio
cifs-utils Tools to let you connect to Windows network shares
homebank A home finance program, so you know when you don't have money to spend on something!
clementine A KDE-native music manager and player
keepassxc An offline password manager
tilix A tiling terminal emulator: lets you ssh to 3 servers and show them side-by-side, for example
krita A KDE-native graphics editor, equivalent to GIMP or Photoshop
digikam A digital photo manager
qbittorrent A KDE-native bittorrent client
kolourpaint A simple painting application, or quick-and-dirty graphics editor
devede A tool to convert video files into DVD-format structures
handbrake-cli A command-line component for Handbrake. See below.
handbrake-gtk A tool for convering video from one format to another
thunderbird An email client
yakuake A terminate-and-stay-resident terminal which is accessed by pressing F12 at any time
makemkv A tool for ripping video from commercial DVDs and BluRay disks
x264 A library for encoding video into the H.264/MPEG-4 AVC format
x265 A library for encoding video into the High Efficiency Video Coding (HEVC/H.265) format
partitionmanager A KDE-native graphical disk partitioning tool, a bit like Gnome's Gparted
latte-dock An application dock/launcher, to replace KDE panels
kwrite An alternative text editor to the built-in Kate
clamav & clamtk Components of the ClamAV anti-virus product
opera An alternative web browser to the built-in Firefox
gcc Development libraries needed to compile software
make Further development libraries needed to compile software
perl Yet more development libraries needed to compile software
kernel-default-devel The last lot of development libraries needed to compile software!

A couple of comments on that lot:

Puddletag and Easytag both do the same job, but slightly differently. Puddletag is, essentially a Python + Qt4 application, so is a bit more native-KDE than Easytag (which is GTK+ and hence more Gnome-ish). I'd like to only need one of them (and as I'm using KDE, I'd like to do without Easytag!), but old habits die hard and I tend to find I use both of them to knock my audio metadata into shape.

Kwrite is an alternative to Kate: I find Kwrite the nicer application.

Note that I had to do a bit of a fiddle after this to get VLC working properly: at this point, I think you'll find that it claims not to be able to decode nearly all video codecs. So:

sudo zypper in libavcodec56 libavcodec57 libavcodec58 libavformat56 libavformat57 libavformat58 libavdevice56 libavdevice57 libavdevice58

Then:

sudo zypper in vlc-codecs

…and at this point, you'll be shown dire warnings about things not being installable. You are given three options:

Solution 1: Following actions will be done: [followed by a long list of applications to be installed]
Solution 2: do not install vlc-codecs-3.0.2-lp150.3.6.x86_64
Solution 3: break vlc-codecs-3.0.2-lp150.3.6.x86_64 by ignoring some of its dependencies

The correct response is to select solution 1. This causes the source of the VLC program and its associated libraries to be switched from the openSuse defaults to the Packman respository, like so:

Choose from above solutions by number or cancel [1/2/3/c] (c): 1                        
Resolving dependencies...
Resolving package dependencies...

The following NEW package is going to be installed:
  vlc-codecs

The following 10 packages are going to be upgraded:
  ffmpeg-3 libavcodec57 libavdevice57 libavfilter6 libavformat57 libavresample3 libavutil55 libpostproc54 libswresample2 libswscale4

The following 10 packages are going to change vendor:
  ffmpeg-3        openSUSE -> http://packman.links2linux.de
  libavcodec57    openSUSE -> http://packman.links2linux.de
  libavdevice57   openSUSE -> http://packman.links2linux.de
  libavfilter6    openSUSE -> http://packman.links2linux.de
  libavformat57   openSUSE -> http://packman.links2linux.de
  libavresample3  openSUSE -> http://packman.links2linux.de
  libavutil55     openSUSE -> http://packman.links2linux.de
  libpostproc54   openSUSE -> http://packman.links2linux.de
  libswresample2  openSUSE -> http://packman.links2linux.de
  libswscale4     openSUSE -> http://packman.links2linux.de
    
10 packages to upgrade, 1 new, 10  to change vendor.

…all of which is fine. Once you confirm that you want installation to continue, and once all the revised packages have been installed, you should find that VLC now works fine, no matter (almost!) what video formats you throw at it.

Once the switch to Packman's version of ffmpeg and associated libraries has been completed in this way, you can really finish things off with:

sudo zypper in shntool cuetools

Cuetools and shntools are small programs that allow you to 'cut' a giant single-file audio file into lots of separate tracks, based on the contents of an associated cue file. Not something you need to do very often, but if you do need to do it, then it's very handy. (In the past, for example, I used to rip CDs to a single file + related cue file. Breaking those monolithic rips into separate audio tracks became important to me!

4.0 Install Mega

I use Mega to store my files in 'The Cloud', so having a desktop client that automatically synchronises local content with its Cloud-based equivalent is important. Installing it is quite simple, fortunately:

sudo zypper ar -f https://mega.nz/linux/MEGAsync/openSUSE_Leap_15.0/ MEGA
sudo zypper update 
sudo zypper install megasync

You're adding another repository to your system, so once again, accept the encryption key “always” when prompted -which means you type “a”.

Once installed, you'll find the Megasync application under Start → System. Login, select to perform a full sync and choose what local folder will be paired with your existing cloud content. Note that Mega always wants to create a local folder called “MEGA” (and, indeed, does so automatically). I prefer to manually create a folder called “Mega” (i.e., mixed case), point the synchronisation at that and then manually remove the MEGA (i.e., all upper case) version afterwards. It's purely a cosmetic thing!

5.0 Install Spotify

I never thought I would use a streaming music service, given my tastes incline to the 'Classical' and I have a thumpingly large music library of my own, but Spotify does indeed include a lot of music I've never heard of and is thus worth having a desktop application for (you could always access it via a web browser instead, of course). Unfortunately, there's no dead-simple way of getting the Spotify client onto OpenSuse from the command line, but you can do the following:

Visit this website. Click to show the Community Packages for openSUSE Leap 15 and select one of the options to 1-click Install, using the latest client version (I used home:ahjolinmna's one). The 1-click install process is very straightforward, but in practice it's adding another repository to your system, so you'll need to provide root credentials at various points. The application, once installed, can be found at Start → Multimedia.

6.0 Add Virtualization

For quite a while, I've used Linux's native KVM virtualization capabilities: they are fairly straightforward and allow virtual machines to run discretely as part of your PC's normal background processes. If you want graphical bling in your guest operating systems, however, KVM is frequently not up to scratch: it simply doesn't do 3D graphics acceleration very well. Thus you can use KVM to run a highly-functional Windows 7 guest… but you won't get Aero effects running in it when you're done.

It is, of course, a bit bonkers to even want to run graphical effects in a guest machine, but I found I needed to scratch that itch regardless. I therefore have lately succumbed to using Oracle's VirtualBox hypervisor as in days of old. Installing it is a little bit involved.

First, we have to add the Oracle VirtualBox software repository to the system. To do that:

sudo nano /etc/zypp/repos.d/virtualbox.repo

That opens a blank text file in my favourite text editor (feel free to use vi, vim, emacs or whatever other text editor you prefer, of course!).

Now paste in all that follows:

[virtualbox]
name=VirtualBox for openSUSE $releasever - $basearch
baseurl=http://download.virtualbox.org/virtualbox/rpm/opensuse/$releasever/$basearch
type=yum
enabled=1
priority=99
autorefresh=1
gpgcheck=1
gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc
keeppackages=0

Save the modified file. Now you do what you always do after adding a new software repository to the system:

sudo zypper update

Don't forget to 'a'lways trust the software provider's GPG encryption key when prompted. Then, finish off with:

sudo zypper install VirtualBox-6.0
sudo usermod -a -G vboxusers hjr

The last command makes me, user hjr, a member of the “vboxusers” group that the installation of the software creates. You need to be a member of that group to be able to create and run virtual machines. Substitute in your own username instead of 'hjr', of course, when you're doing this!

Once installed, the software can be found under Start → System.

Once everything is working as expected, visit the VirtualBox website and click to download the VirtualBox Extension Pack (there's a link available to download the relevant software for 'all supported platforms'). When you click, you'll be prompted to run the program or save it: I'd suggest selecting to open it with the default program suggested (which is VirtualBox itself). Follow the prompts when it does run: your virtual machines can now use USB 2.0 and above, along with some other, more obscure, benefits.

7.0 Add Antivirus Capability

Strictly speaking, you don't really need antivirus software on a purely Linux system in a purely Linux environment. Not that Linux is immune to viruses, but they are vanishingly rare and generally require users to do stupid things before they can do much real damage.

But regardless of what OS you're using, you can be sent viruses in infected files or emails (for example) which won't do any damage on your own Linux box, but can spread to nearby Windows machines and wreak havoc there. As a sensible bit of altruism, therefore, it makes sense to run an antivirus tool on Linux to stop yourself spreading viruses to other users and operating systems that are less able to cope than your own.

ClamAV is such a product and has already been installed in the big package installation section above… but it needs configuring and updating if it's to do it's job properly. Therefore, start by issuing this command:

freshclam

That triggers an update to the product's antivirus signatures. The update will generate something that looks bad: “WARNING: Clamd was NOT notified”. But don't worry about this. It's just that the clamd daemon is not running and therefore the daemon couldn't be notified. It doesn't stop the signatures being updated, nevertheless.

Next, type:

sudo mkdir -p /root/Logs
sudo nice -n5 clamscan -r -i / --exclude-dir="^/sys" --exclude-dir="^/dev" --exclude-dir="^/proc" --max-filesize=1700M --max-scansize=1700M --bytecode-timeout=600000 >> /root/Logs/clamscan.log

This manually runs a scan of your entire system, to check it's not got any pre-existing viruses. It will likely take a long time, because “clamscan” is a single-threaded process. If you check your System Monitor (Start → System → KSysGuard), you will see one thread of your CPU constantly run at 100%, whilst the others (probably!) idle at 0%. Be patient, therefore, and let the scan do its thing (mine took 28 hours to scan 2.3TB of files!).

Once the scan has completed, type:

sudo nano /etc/freshclam.conf

You are now editing the configuration file which controls how the 'freshclam' program updates the antivirus signatures. If you search around a bit, you'll find a line which reads #Checks 12, meaning that it will update the signatures every two hours (12 times a day) by default. This seems a tad over-enthusiastic to me, so I suggest editing that line to Checks 1 (that is, remove the leading hash, so the line isn't commented out any more and then calm things down a bit to a single update every day). You can pick a frequency of update to suit yourself, of course.

Next:

sudo systemctl enable freshclam
sudo systemctl start freshclam

…which starts the freshclam background process. Freshclam will now take care of automatic signature updates without further intervention on your part.

Finish things off by becoming root and making an entry into root's crontab:

sudo -i
export EDITOR=nano
crontab -e

Make an entry such as the following in the new file that is now opened for you:

0 0 1 * *    nice -n5 clamscan -r -i / --exclude-dir="^/sys" --exclude-dir="^/dev" --exclude-dir="^/proc" --max-filesize=1700M --max-scansize=1700M --bytecode-timeout=600000 > /root/Logs/clamscan.log

Save the modified file and you've just scheduled your system to perform a full system scan (whilst not bothering with the contents of the /sys, /dev and /proc directories) once a month, on the first day of each month, at midnight. You can choose your own schedule, of course, but because it's a fairly big hit on the system (10% CPU and maybe 700MB of memory), I wouldn't do full scans very frequently.

I would however stop being root and become myself once more by typing:

exit

…and then do the following:

export EDITOR=nano
cd
mkdir Logs
crontab -e

Into the Crontab file now displayed, paste this lot:

# Perform an anti-virus scan of your home directory every day at 12 midnight
# --------------------------------------------------------------------------
0 1 2-31 * *    clamscan -r /home/hjr > /home/hjr/Logs/clamscan.log

…which is to say, run a scan just of my own home directory every day of the month except on the first (since root's full-system scan will be doing that then). For this to be a sensible way of doing things, you need to be storing most of your work in your own personal folders and not in directories hanging off root outside of /home, of course. But that's true for me, so this works for me!

Finally, note that I've not enabled nor started the “clamd” daemon. Some people seem to think this background process will do 'real-time' antivirus protection, but it doesn't. It simply provides a service that other applications can call, if they are configured to do so (such as an mail server configured to scan incoming mail). Rather than use the clamd daemon, therefore, I prefer to do as I've described above: manually schedule periodic (and relatively infrequent) scans of the system via cron, coupled with another cron job kicking off much more frequent but relatively lightweight scans of just my personal folders.

9.0 Some Cosmetics

The next few sections are even more subjective than the preceding ones! Rather than address strictly functional issues, they deal with the look, feel and overall appearance of the O/S. Your mileage is very much likely to vary!

9.1 Clear the Desktop

By default, OpenSuse's KDE desktop is supplied displaying two desktop icons: one for the Home directory and one for the Trash bin. I prefer my desktops to be icon-free, so these two have to go, as follows:

First, right-click the Home folder icon on the Desktop and then select Move to Trash. Now right-click the trash folder and select Empty Trash. That's the Home folder dealt with, nice and simply.

Unfortunately, the Trash icon is harder to get rid of. To do so, open a command prompt and type:

cd
cd Desktop
rm trash.desktop

Job done!

9.2 Specify a Hostname

The OpenSuse installer doesn't, by default, give you a chance to specify a host name during the O/S installation process (unless your network configuration is complex and necessitates manual intervention). So, probably, your PC is currently called something like linux-l41h.

To specify a host name of your own, therefore, click:

  • Start → System → Yast → System (left-hand pane) → Network Settings (right hand pane)
  • Click the Hostname/DNS tab
  • Type in a suitable hostname and domain name where appropriate.
  • Click OK.

9.3 Regional Settings

I am in a bit of a peculiar situation as regards to most operating systems' use of Regional Settings: I am a British English user and live in the United Kingdom, but all my keyboards were purchased in Australia and thus use the US English layout. So:

  • Start → System → Yast → System (left-hand pane) → Language (right hand pane)

Check that the Primary Language set here is English (UK).

  • Start → System → Yast → Hardware (left-hand pane) → System Keyboard Layout (right hand pane)

Verify that the Keyboard Layout is still set to English (US) (or set it to that now, if not). Finally:

  • Start → Settings → Configure Desktop → Regional Settings

Make sure that British English is listed in the Preferred Languages section and American English is not.

Obviously, if you are reading this in Paris or Beijing, feel free to ignore my personal selection of languages and associated regional settings!!

9.4 Startup Programs

You may want to start various programs automatically when you log in, or you may not. But you have, in particular, already installed yakuake, which is a terminal which stays resident in the background and drops down into the foreground whenever you press (by default) F12. I find it really handy (which is why I suggested you install it!), but for it to work its magic, it needs to be launched automatically at every login.

To do that, click:

  • Start → Settings → Configure Desktop → Startup and Shutdown → Autostart

Now click Add Program and add Yakuake (which can be found by expanding the System menu item displayed in the dialog at this point and then scrolling down towards the bottom).

9.5 Personalisation

By default, OpenSuse displays a rather daft 'avatar' on the main login page which always makes me think of a very sad, one-eyed cyclops:

The built-in selection of alternative avatars is equally as dismal. Fortunately, you can add a picture of your own. To do so, click:

  • Start → Settings → Configure Desktop → Account Details → User Manager

Click on the relevant username in the left-hand part of the screen. Now click the 'blank person icon' next to the username in the main part of the screen, select Load from File and then navigate to some photo or other image you want to use. Having selected a desired image, click Open → OK → Apply. Supply root credentials when required. On next login, you should see your user photo, rather than the sad-faced avatar you get by default!

10.0 Customising the Terminal

The default OpenSuse terminal looks small, cramped and rather nasty! Time to make it look a bit nicer! Everything is done by running a terminal session (i.e., launch Konsole from the Start → System menus) and then clicking Settings → Edit Current Profile.

My choice of settings, under the various available tabs, are:

  • General: 132 x 34 [Apply]
  • Appearance: Solarized → Edit → Background Transparency = 5% [Apply] [OK] [Apply]
  • Appearance: Change Font from 'Hack 9pt' to Luxi Mono B&H Regular 11pt [OK] [Apply] [OK]

After making each change, launch a new terminal window to check that it has been applied for new windows. Note that the first of the above changes won't take effect until you click:

  • Settings → Configure Konsole → uncheck 'Use current window size on next startup'

I found I had to keep on re-applying some of these changes until they properly 'stuck', but your mileage might vary as usual! Eventually, I got the look I wanted:

11.0 Theming

Again, hugely subjective, but here's how I like to theme my KDE desktops. All of what follows happens in the Start → Settings → System Settings application.

11.1 General Desktop Theme

Click the Workspace Theme launcher:

  • Look And Feel is left at the default “openSUSE”
  • Desktop Theme is set to Arezzo (click Get New Themes, search by name, click Install →Close, then select
  • Cursor Theme is set to Ecliz (click Get New Theme, search by name, Install → Close → select → Apply
  • Splash screen is left at the default “openSUSE”

11.2 Colours

Click the Colours launcher, then Get New Scheme. In the dialog that then appears, type “LuckyEyes” in the search box. Scroll around until you see the LuckyEyes KDE 5 scheme by AlexKol. Click Install, then Close. Click on the newly-installed colour scheme in the main list now presented. Then click Apply.

Finish by clicking the All Settings button at the top of the dialog to get back to the general system settings control panel.

11.3 Fonts

I have a split personality about the theme fonts used on my desktops! On the one hand, I quite like switching things to Gill Sans (which I happen to have bought years ago and thus can install the relevant .ttf files). But most people won't have that font to hand -and, in any case, on the other hand you can spend an age fiddling around with fonts to no wonderful effect!

For a fresh install, at least, I'd therefore use the default fonts -which are a mix of “Noto Sans” and “Hack”.

I do, however, switch on anti-aliasing. For my particular hardware (and eyes!). So, set the first combo-box to 'Enabled' and then click Configure. I find setting RGB and Medium works best for me, without switching on any exclude range.

11.4 Icons

Click Get New Themes and then search for “Suru”. Scroll through the resulting list until you find the item Suru 20 [Officially bug-free and 11 DEs-compatible]. Click Install then Close. Select the Suru++ 20 item in the list then displayed and click Apply.

I would also then click the Advanced tab. Under the 'Default' folder, click the Set Effect button. Select Colourise and then click the box in the main part of the screen labelled “Colour”. I then set an “HTML” value of #52498d, like so:

Finish off by clicking [OK], [OK] and then [Apply].

I have generally found that the Suru icon set doesn't get 'built' properly until you reboot your PC at this point. Until you do, you may well find some application icons display generic -and therefore meaningless- symbols rather than proper icons.

12.0 Panels and Launchers

In the past, I have tended to right-click a program item listed in the main Start menu and select 'Pin to Task Manager'. This creates a set of 'quick launch' icons that lets me run applications quickly, without having to hunt-and-peck my way through the real Start menu.

However, the task manager on the panel eats into the space used to display running programs so that if you pin more than a handful, you swiftly get to the point where you can't display many running programs meaningfully in what's left of the task manager panel. On my laptop, for example, things get as bad as this:

In this case, there are so many launchers, some have spilled over to the right-hand side of the system clock -and there are no indicators of running programs at all, because there simply isn't space to display them!

So, rather than put up with this, here's my (rather drastic!) workaround.

First, right-click the bottom panel and click Panel Options → Panel Settings. Hover over the Screen Edge button and watch your cursor turn into a sort-of crossed arrows pointer. Whilst it's in that state, click and drag upwards, until what was your 'bottom' panel becomes your 'top' panel. Click the 'X' icon at the extreme right of the panel when you've moved it correctly into its new position.

Second, click Start → Utilities → Latte. Latte is an application dock, so it will (eventually!) appear in the middle of the bottom of your screen complete with a set of icons representing any programs which are already running. If no applications are running when it's launched, it nevertheless starts with a couple of icons (program launchers, in fact) representing the Dolphin file manager and your web browser.

Your job now, therefore, is to click the Start menu and find each of the applications you want to be able to launch quickly and click-and-drag them down to the Latte launcher. It can be a bit tricky to do: if you just click a program item and don't remember to hold, you'll just launch that program rather than copy its launch icon around the screen! Once you are in click-and-drag mode, though, just hover over the Latte launcher area (which greys out a bit as you hover it) and then let go of the mouse. The application icon should then be added to the list of launchers 'held' in the Latte dock. Do it often enough, and you'll end up with something like this:

Basically, everything I would have pinned to the ordinary task manager panel, I've now dropped into the Latte dock. By clicking-and-dragging within the dock, you can re-arrange the order in which each of the application icons appear, too. Once an application launcher is in the dock, you can remove it from the pinned icons on the top panel (if they were there).

So you end up with a panel at the top of your screen showing what programs are running (but no quick launchers); and a dock at the bottom of the screen containing program launchers. The dock actually also indicates what programs are running, because they'll have little dots under their icons if they are -but I don't rely on that, as the dots are so small, I rarely notice them!

Naturally, the dock isn't large enough to contain launchers for every single program you'll likely want to use! For those programs you use infrequently, therefore, you still have the standard Start menu -only now, tucked away in the top-left of your screen rather than the bottom! You can also right-click any icon already in the dock, select the Latte Settings menu option, select the Appearance tab and then set the icon size to something smaller than the default (I generally get away with an icon size of 40 pixels).

Anyway: if you fiddle around long enough, you'll end up with something looking a bit like this:

Again, back in the Latte Settings menu, you can to control whether, for example, the dock should auto-hide or remain permanently visible, along with other settings which control its aesthetics. I, for example, select the 'Dodge Active' option. This means that if all my application windows are not running maximised, the dock is always visible, as in the previous screenshot.

But if I ever maximise an application so that it starts using the very bottom of my screen, the dock hides itself:

Docks aren't for everyone, I accept. I hated them for a long time: but this ability to separate the display of running applications from their launchers is something I find very useful these days, and I've grown used to the overall aesthetic effect. Curiously, I think the idea of areas top and bottom of your screen, each containing distinct but useful information is something I grew used to in the good old days of Gnome 1.4! I guess this setup therefore appeals to me because it's KDE sort-of configured to behave as ye ancient Gnome layout of things did!

To finish things off, you just need to make sure Latte starts automatically every time you log on. That's done by again right-clicking a Latte launch icon, selecting Latte Settings and then clicking on the Tweaks tab. There, you'll find an item labelled “Enable autostart during startup” -and that needs to be clicked 'on' to take effect.

13.0 Performance Tweaks

I generally do a couple of performance optimizations on my main PC, regardless of which distro, it's running, as follows.

13.1 File System Optimizations for SSDs

OpenSuse enables the fstrim.timer service by default: this triggers the fstrim.service to work once a week to perform a periodic trim of all mounted SSDs. As such, there's nothing you need do manually to get trim working, but you should just check it's all working as expected:

sudo systemctl status fstrim.timer

That should return something that looks like:

 fstrim.timer - Discard unused blocks once a week
   Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled)
   Active: active (waiting) since Sun 2019-01-20 17:02:48 GMT; 17h ago
 Trigger: Mon 2019-01-28 00:00:00 GMT; 6 days left
     Docs: man:fstrim

Jan 20 17:02:48 britten systemd[1]: Started Discard unused blocks once a week.

…which does mean that the timer service is active and able to do its work. Next, just check what the timer is set to trigger:

sudo systemctl list-timers

…which will list something like:

NEXT                         LEFT                LAST                         PASSED     UNIT                         ACTIVATES
Mon 2019-01-21 11:00:00 GMT  14min left          Mon 2019-01-21 10:00:34 GMT  44min ago  snapper-timeline.timer       snapper-timeline.service
Mon 2019-01-21 17:12:54 GMT  6h left             Sun 2019-01-20 17:12:54 GMT  17h ago    snapper-cleanup.timer        snapper-cleanup.service
Mon 2019-01-21 17:17:49 GMT  6h left             Sun 2019-01-20 17:17:49 GMT  17h ago    systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Tue 2019-01-22 00:00:00 GMT  13h left            Mon 2019-01-21 00:00:34 GMT  10h ago    logrotate.timer              logrotate.service
Tue 2019-01-22 00:53:58 GMT  14h left            Mon 2019-01-21 01:43:05 GMT  9h ago     backup-rpmdb.timer           backup-rpmdb.service
Tue 2019-01-22 01:11:38 GMT  14h left            Mon 2019-01-21 01:25:50 GMT  9h ago     backup-sysconfig.timer       backup-sysconfig.service
Tue 2019-01-22 01:59:42 GMT  15h left            Mon 2019-01-21 01:28:34 GMT  9h ago     check-battery.timer          check-battery.service
Mon 2019-01-28 00:00:00 GMT  6 days left         Mon 2019-01-21 00:00:34 GMT  10h ago    btrfs-balance.timer          btrfs-balance.service
Mon 2019-01-28 00:00:00 GMT  6 days left         Mon 2019-01-21 00:00:34 GMT  10h ago    fstrim.timer                 fstrim.service
Fri 2019-02-01 00:00:00 GMT  1 weeks 3 days left Thu 2019-01-17 17:54:06 GMT  3 days ago btrfs-scrub.timer            btrfs-scrub.service

The last-but-one line there tells me that fstrim.timer will indeed kick off the fstrim.service in 6 days' time.

If your system has been running for a while, such that the fstrim service could conceivably have run by now, you can check its work as follows:

sudo systemctl status fstrim 

…which will output something like:

fstrim.service - Discard unused blocks
 Loaded: loaded (/usr/lib/systemd/system/fstrim.service; static; vendor preset: disabled)
 Active: inactive (dead) since Mon 2019-01-21 00:01:06 GMT; 10h ago
Process: 22395 ExecStart=/usr/sbin/fstrim -av (code=exited, status=0/SUCCESS)
Main PID: 22395 (code=exited, status=0/SUCCESS)

Jan 21 00:00:34 britten systemd[1]: Starting Discard unused blocks...
Jan 21 00:01:06 britten fstrim[22395]: /multimedia: 735.9 GiB (790123704320 bytes) trimmed
Jan 21 00:01:06 britten fstrim[22395]: /home: 762.6 GiB (818836107264 bytes) trimmed
Jan 21 00:01:06 britten fstrim[22395]: /boot: 14.9 GiB (15933288448 bytes) trimmed
Jan 21 00:01:06 britten fstrim[22395]: /: 126.7 GiB (136012554240 bytes) trimmed
Jan 21 00:01:06 britten systemd[1]: Started Discard unused blocks.

…which neatly shows which file systems get trimmed (and how much trimming was done on each). That output also tells me that the fstrim timer service kicks off at midnight every Sunday, which suits me just fine.

Note that with periodic trims thus enabled, there's no need to alter your file system mount options to trigger continual trimming.

13.2 Fstab Optimizations

Although the presence of periodic trim is good and rules out the need to switch on continual trim, there are still issues with OpenSuse's default configuration of file systems that are less than optimal for SSDs. Here's my default /etc/fstab:

UUID=8d49cf5d-ddbb-479d-80f4-2d72122e9c30  /            ext4  acl,user_xattr               0  1
UUID=5108c85d-4c07-4cea-a0bb-574764da57ec  /boot        ext4  data=ordered,acl,user_xattr  0  2
UUID=C9B2-AEE7                             /boot/efi    vfat  defaults                     0  0
UUID=86617863-b7a3-4387-94e3-1a3bad5eebb6  /multimedia  xfs   defaults                     0  0
UUID=abafe908-1834-4bb2-a023-793d3671e183  /home        xfs   defaults                     0  0

I don't really mind most of them -but “defaults” is a bit sub-par as far as SSDs are concerned. Here's my revised /etc/fstab:

UUID=8d49cf5d-ddbb-479d-80f4-2d72122e9c30  /            ext4  acl,user_xattr,noatime               0  1
UUID=5108c85d-4c07-4cea-a0bb-574764da57ec  /boot        ext4  data=ordered,acl,user_xattr,noatime  0  2
UUID=C9B2-AEE7                             /boot/efi    vfat  defaults,noatime                     0  0
UUID=86617863-b7a3-4387-94e3-1a3bad5eebb6  /multimedia  xfs   defaults,noatime                     0  0
UUID=abafe908-1834-4bb2-a023-793d3671e183  /home        xfs   defaults,noatime                     0  0

Which is to say: I switch on the “noatime” mount option for every file system. This means that openSuse won't keep writing the latest 'access time' to the file system every time I read a file from disk, which it otherwise would do. This reduces the amount of file metadata updating that goes on -and that improves SSD endurance a little.

13.3 Kernel Optimizations

I make two alterations to the kernel parameters. They don't make dramatic difference to performance, but they are useful nevertheless.

First, swappiness. By default, OpenSuse ships with swappiness set to 60 (verify this by cat /proc/sys/vm/swappiness). That's quite high and means that the operating system will be quite aggressive in swapping programs and associated data out of RAM back to disk -which, because it's SSD, will mean reduced endurance for my disks overall. I therefore want to set my swappiness to a value of 1 -the O/S will very rarely swap out of memory to disk.

Of course, this is a two-edged sword in some respects: if you have a memory hog of an application, you may well want it paged to disk rather than block other applications loading and running. But with 96GB of RAM at my disposal, I think I can afford the risk!

In OpenSuse, you configure this setting by doing the following:

sudo nano /etc/sysctl.d/99-swappiness.conf

…and pasting into the new file:

vm.swappiness=1

Save the file, and then issue the command:

sudo systemctl restart systemd-sysctl

This is the “modern” way of getting changes to sysctl re-loading in your running O/S. The rather cruder alternative is simply to reboot, of course!

Here's an example of me checking the swappiness value -in another terminal, half-way through, I save the 99-swappiness.conf file with its new value for the swappiness setting:

[email protected]:~> cat /proc/sys/vm/swappiness
60
       -- modified file is saved at this point --
[email protected]:~> sudo systemctl restart systemd-sysctl
[sudo] password for root: 
[email protected]:~> cat /proc/sys/vm/swappiness
1

So, I can be confident the new value “sticks”.

The second kernel parameter I tweak is one that's actually set by installing the Megasync client (as I did above, in Section 4. It involves setting a value for max_user_watches, which are in-memory structures used to keep tabs on which files have been modified. Obviously, Mega needs to know what's been altered in the folders it uses as its “synchronization home”, so that it can trigger appropriate upload and download activity necessary to keep the local hard drive and its cloud equivalent in sync.

If you check the contents of the /etc/sysctl.d directory now, you'll find the outcome of Mega's previous installation:

[email protected]:~> ls -ltr /etc/sysctl.d
total 8
-rw-r--r-- 1 root root 37 Sep 14 14:07 100-megasync-inotify-limit.conf
-rw-r--r-- 1 root root 16 Jan 21 11:26 99-swappiness.conf

The new 99-swappiness file is there -unsurprisingly, since we just created it! But the 100-megasync one was not of our making!

Open that file up with suitable permissions, and you'll see this sort of thing:

sudo nano /etc/sysctl.d/100-megasync-inotify-limit.conf

fs.inotify.max_user_watches = 524288

Your mileage might well vary, but I think that setting is way too low, by at least an order of magnitude. However, when you're setting this parameter, keep in mind the following:

  • Each used inotify watch takes up 1 kB on a 64-bit operating system
  • The memory used by inotify watches is kernel memory and thus unswappable
  • If the entire set of 524288 watches thus far configured was used, you'd therefore consume 0.5GB of RAM

Well, I don't particularly care about whether things get swapped out of RAM or not: I've just configured swappiness to try to stop that happening after all! So then the question for me is: do I care about “consuming” up to 0.5GB RAM just for these 'file watchers'?

My main PC is happily equipped with 96GB of RAM in all -so, for me, the answer to that question is a definite “no”. In fact, I'd quite happily lose 5GB of RAM -and with at least one 2TB file system on which I store many hundreds of thousands of files, I think I'd prefer to do so!!

So, for me, I'd edit the above line to read:

fs.inotify.max_user_watches = 5242880

…which makes the setting 10 times what it was, and thus potentially means I end up consuming 5GB of kernel memory. It's a maximum that can be used, though: it doesn't mean 5GB takes an instant walk from your grasp!!

However, regardless of the value that you set in this file, there's one bit of OpenSuse-specific configuration which Mega gets wrong anyway: the value is meaningless because it's over-ridden by another configuration of the same parameter in a different file tucked away elsewhere!

So, you can see that my altering this file has no effect whatsoever:

[email protected]:~> cat /proc/sys/fs/inotify/max_user_watches
65536
          -- modified file is saved at this point --
[email protected]:~> sudo systemctl restart systemd-sysctl
[sudo] password for root: 
[email protected]:~> cat /proc/sys/fs/inotify/max_user_watches
65536

I'm somehow picking up a value of 65,536 user watches even though the Mega configuration file says we should be talking 500,000 or more! To get your Mega-value picked up correctly, you therefore now need to do:

sudo nano /usr/lib/sysctl.d/50-default.conf

Around line 27 of that file, you'll find a line reading “fs.inotify.max_user_watches = 65536” -and it's clearly this line which is giving the value shown in the earlier output. So, stick a hash in front of that line to comment it out, then:

sudo systemctl restart systemd-sysctl

…after which:

cat /proc/sys/fs/inotify/max_user_watches
5242880

…which shows my new value has successfully been applied from the modified 100-megasync configuraiton file after all. Take this as a more general warning, too, that setting modified kernel parameters on openSuse needs to be done carefully and with lots of double-checking, since a proliferation of configuration files scattered around your file system could over-ride any settings you think you're making!

14.0 Firefox Tweaks

My default browser is Firefox and it mostly runs without me needing to do much to it. However, I make three alterations to it that make it run just a little better for me:

14.1 Disable Adverts and Tracking

There are numerous adblockers you could use at this point, by my preference is to use uBlock Origin. That's easily do-able by visiting the Firefox Add-ons site and searching for the phrase “ublock origin”. Click on appropriate search result, then click Add to Firefox and the Add button when prompted. Job done!

14.2 Integrate with KeePassXC

Back in Section 3, we installed a lot of new software. One of the applications added to your system was KeePassXC, which is a off-line password manager. You run that program, add lots of websites and their associated passwords to it, and you can then manually consult it in future as you visit those websites and need to log in to them.

To make things even more functional, however, you can also tie your browser and your password manager together by installing the KeePassXC extension for Firefox and telling KeePassXC about it.

So, first, go back to the Firefox Add-ons page. Search this time for keepassxc. “KeePassXC-Browser” should be the first result. Click the option to Add it to Firefox and confirm when prompted.

Once that's done, launch KeepassXC (Start → Utilities → KeePassXC). Select Tools → Settings once it's launched and you've logged in to your password database. Select Browser Integration from the left-hand panel and in the right-hand part of the screen select to Enable KeePassXC browser integration whilst also switching on whichever browsers you want to integrate with. Although I have Opera installed, I don't need it integrated, so I just switch on the options like so:

Once this is enabled, visits to a URL which match any of thosestored in your KeePass database will enable you to right-click inside a username/password dialog box and fetch the entries direct from the database, no manual typing needed.

14.3 Disable Video Auto-Play

The last tweak I make to Firefox is to make sure web pages that contain embedded video don't play those video files automatically (the Independent newspaper is really bad for doing this! Click on any of their news stories and, if there's a video, it will start playing -usually at hideously high volume levels- just as you're half-way through reading the second or third paragraph. No!!!)

Type this into Firefox's address bar:

about:config?filter=autoplay

…which will trigger this warning:

Click the I accept the risk! warning. You'll then be looking at this:

By default, as you can see, “media autoplay” is enabled. Double-click that first item, however, and it will flip to being disabled (that is, the value in the final column will be set to false). You can now close down this tab: the value takes effect immediately and future visits to the Independent's website will no longer be accompanied by ear-splitting blasts of video soundtrack without warning!

15.0 Conclusion

It's a long-ish ride, and it may take some time to work your way through every one of these steps, but if you do, I am fairly confident that you'll have a rather attractive desktop operating system on which you can be reasonably productive!

wiki/linux/installopensuse15.txt · Last modified: 2019/01/28 15:46 by dizwell