Announcement

Collapse
No announcement yet.

Kubuntu 26.04 LTS - important things to do after an installation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Post-Install] Kubuntu 26.04 LTS - important things to do after an installation

    You can always find the most recent version of this guide on my GitLab page.

    Kubuntu 26.04 LTS - essential and advisable things to do directly after an installation

    I always perform (and strongly recommend) the following 6 (7) steps directly after any Kubuntu 26.04 LTS desktop installation. These steps usually take 5 to 10 minutes (including restart) if you have at least a little experience with these kinds of things:

    To do so
    -> open the Konsole terminal emulator from your -> Application Launcher -> System.
    Please copy and paste the following commands one by one into Konsole - e.g. with your mouse or with
    [Ctrl] [c] and [Ctrl] [Shift] [v] - and execute them with [Return].
    Double-check that you did not miss a character or two. ;-)

    Everything with a grey background behind a single "" is a whole command and has to be copied as a whole - even if it is longer than one line.

    - Preliminary remark: I consider the following step 1. important, but - as far as I could test - it is only necessary for a new installation on specific targets such as SATA HDDs, SATA SSDs and certain virtual machines - and all with ext4 file systems.
    The bug does not seem to occur if the installation target is an ext4 file system e.g. on an NVMe SSD connected to an M.2 port - as used by the majority of computers produced in recent years.

    1. Please correct a possible installation bug for ext4 file systems in the /etc/fstab file first
    (= replace the "discard" option with "defaults" because a systemd timer for fstrim is already running)!

    - Technical background: To not do both is recommended by e.g. Red Hat and the ArchWiki (and openSUSE, Debian or Ubuntu's main distribution also do not do it)!
    Furthermore Red Hat and SUSE (openSUSE) also recommend in general to use a timer/fstrim instead of the "discard" option (and Fedora, Debian or Ubuntu's main distribution also use fstrim.timer instead) - except for special cases.
    If you are unlucky, using the "discard" option in /etc/fstab may decrease the SSD's lifetime and can lead to performance degradation. Also fstrim can behave unpredictably when the "discard" option is additionally set…

    In case you don't know whether you chose the ext4 file system during installation (the chance you did is quite high as it is the default for Kubuntu 26.04 LTS), in case the installation bug did not occur, or if the bug has been corrected in the meantime:
    The following cp command in step 1. a) and b) will just make a backup copy of your /etc/fstab file, and neither the following sed command in step 1. a) nor in b) will do anything at all.

    a) either
    • sudo cp /etc/fstab /etc/fstab.orig
      (this makes a backup of your /etc/fstab​ file first)
    • sudo sed -i '/ext4/ s/discard/defaults/g' /etc/fstab
      (this replaces the wrong option with the right one - only if applicable)
    I would even suggest the additional option "noatime" if you don't run any programs (such as certain servers) that specifically need information about when a file or folder was accessed (= opened or read) and therefore to use b).
    This makes old HDDs run a tiny little bit faster because it reduces write actions - and thus also wear on SSDs:

    OR

    b) alternatively
    • sudo cp /etc/fstab /etc/fstab.orig
      (this makes a backup of your /etc/fstab​ file first)
    • sudo sed -i '/ext4/ s/discard/defaults,noatime/g' /etc/fstab
      (this replaces the wrong option with the right ones - only if applicable)
    For safety reasons don't use the sed commands of step 1. a) or b) in any other context than a fresh Kubuntu 26.04 LTS installation!
    Instead check and modify your /etc/fstab file by hand if need be - and back it up first.


    The change will be applied with the reboot after step 6. (7.)

    2. Reduce swappiness for desktop installations like it is suggested for *Ubuntu and like e.g. TUXEDO OS also does it
    (= the system will use the physical memory modules longer and use the swap file or partition later).

    If you are curious you can check the setting before and after the reboot with sudo sysctl vm.swappiness.
    • echo -e "# Reduce swappiness for desktop installation (default = 60)\nvm.swappiness=10" | sudo tee /etc/sysctl.d/99-sysswappiness.conf
      (this writes the modified value to your system)
    The change will be applied with the reboot after step 6. (7.)

    3. Reduce systemd timeouts for desktop installations like KDE suggests for Plasma in their Distribution/Packaging Recommendations
    (= the system will not "hang" for 90 seconds - which is the default value - from time to time when logging out, rebooting or shutting down).

    I am still quite conservative here and use 15 seconds because on older machines it has seldom taken as long as 10–14 seconds for certain processes to quit gracefully by themselves (for example: KDE neon uses 16 seconds, TUXEDO OS and Garuda KDE use 10 seconds).
    • sudo mkdir -p /etc/systemd/system.conf.d && echo -e "# Reduce timeout (default = 90s)\n\n[Manager]\nDefaultTimeoutStopSec=15s" | sudo tee /etc/systemd/system.conf.d/99-systemtimeout.conf
      (this writes the modified value for the system processes to your system)
    • sudo mkdir -p /etc/systemd/user.conf.d && echo -e "# Reduce timeout (default = 90s)\n\n[Manager]\nDefaultTimeoutStopSec=15s" | sudo tee /etc/systemd/user.conf.d/99-usertimeout.conf
      (this writes the modified value for the user processes to your system)
    The change will be applied with the reboot after step 6. (7.)

    4.a) Change GRUB (the boot loader) to show the boot menu for 1 second in single-boot setups
    (= only Kubuntu is installed - this makes the boot menu much easier to access whenever you might need it).
    • sudo cp /etc/default/grub /etc/default/grub.orig
      (this makes a backup of your /etc/default/grub​ file first)​
    • sudo sed -i 's/GRUB_TIMEOUT_STYLE=hidden/GRUB_TIMEOUT_STYLE=menu/' /etc/default/grub
      (this makes GRUB show the boot menu)
    • sudo sed -i 's/GRUB_TIMEOUT=0/GRUB_TIMEOUT=1/' /etc/default/grub
      (this writes the timeout value to your system)
    • echo -e "\n# Match RECORDFAIL_TIMEOUT to TIMEOUT\nGRUB_RECORDFAIL_TIMEOUT=​\$GRUB_TIMEOUT" | sudo tee -a /etc/default/grub
      (this keeps the timeout value if GRUB has "problems" with a partition - could be e.g. Btrfs or LVM)
    • sudo update-grub
      (this updates your GRUB boot loader with the new values)
    OR

    4.b) Change GRUB to show the boot menu with all installed systems for 5 seconds in multi-boot setups
    (= Kubuntu and another Linux or/and Windows are installed - and make sure to definitely disable Windows fast startup if you intend to access the "C:" drive from Linux).
    • sudo cp /etc/default/grub /etc/default/grub.orig
      (this makes a backup of your /etc/default/grub​ file first)
    • sudo sed -i 's/GRUB_TIMEOUT_STYLE=hidden/GRUB_TIMEOUT_STYLE=menu/' /etc/default/grub
      (this makes GRUB show the boot menu)
    • sudo sed -i 's/GRUB_TIMEOUT=0/GRUB_TIMEOUT=5/' /etc/default/grub
      (this writes the timeout value to your system)
    • echo -e "\n# Match RECORDFAIL_TIMEOUT to TIMEOUT\nGRUB_RECORDFAIL_TIMEOUT=​\$GRUB_TIMEOUT" | sudo tee -a /etc/default/grub
      (this keeps the timeout value if GRUB has "problems" with a partition - could be e.g. Btrfs or LVM)
    • sudo sed -i 's/#GRUB_DISABLE_OS_PROBER=false/GRUB_DISABLE_OS_PROBER=false/' /etc/default/grub
      (this makes other systems visible in the boot menu)
    • sudo update-grub
      (this updates your GRUB boot loader with the new values)
    The change will be visible during the reboot after step 6. (7.)

    5. Update your system and your programs for the first time
    (this is generally one of the first things you should do after installing any operating system).
    • sudo snap refresh && sudo systemctl daemon-reload
      (this updates the Snaps - not necessary if you have chosen the "Minimal Installation" option)
    • sudo apt update && sudo apt full-upgrade
      (this updates your installation - except for the Snaps)
    • sudo apt autopurge && sudo apt autoclean
      (this removes remaining packages from the installation process - if there are any)
    In case this is not a fresh Kubuntu 26.04 LTS installation, be careful with the autopurge in step 5. and thoroughly read and understand the output in Konsole !

    6. Install missing essential software for desktop installations like
    • multimedia codecs etc.
    • Microsoft Web and replacement fonts.
    You can select with [Tab] and confirm with [Return] in the following dialogues - select "Ok" and "Yes" to install.
    • sudo apt install kubuntu-restricted-extras gstreamer1.0-vaapi fonts-crosextra-carlito fonts-crosextra-caladea
      (this installs all of the above listed)


    7. If you have a DVD or Blu-ray drive, install libdvdcss to be able to play back e.g. encrypted video DVDs.

    You can select with [Tab] and confirm with [Return] in the following dialogues - select "Ok" and "Yes" to install.
    • sudo apt install libdvd-pkg
      (this installs the play back for encrypted media)
    • sudo dpkg-reconfigure libdvd-pkg
      (this activates the play back for encrypted media)

    • reboot and enjoy Kubuntu 26.04 LTS !
    Now it is time to begin thinking about a backup strategy for your future user data, e.g. with KUP (-> System Settings -> Backups) or with something more versatile like Back In Time (as in Kubuntu Focus) - or may it even only be regularly "by hand" to an USB stick…





    Bonus - 5 individual and potentially less important things to do:

    Everything with a grey background behind a single "" is a whole command and has to be copied into Konsole as a whole - even if it is longer than one line.

    a. It is possible to remove Snap from Kubuntu 26.04 LTS and/or use the "traditional" Firefox and Thunderbird instead of or additionally to the Snaps
    (you could use the following shell scripts).


    b. Enable Flatpak instead of or additionally to Snap
    (e.g. to increase your pool of available programs).​
    • sudo apt update && sudo apt install flatpak plasma-discover-backend-flatpak kde-config-flatpak
      (this installs Flatpak for your system, Flatpak support for Discover and Flatpak permission management for System Settings)
    • flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
      (this adds Flathub, currently the largest repository for Flatpaks)
    You will have to log out and in again or reboot to apply the change.

    If need be, you now have the possibility to adjust the permissions of installed Flatpaks
    in -> System Settings -> Application Permissions (section: Security & Privacy) -> “Flatpak name” -> [Manage Flatpak Settings] (this is a button at the top).

    Also see Flatpak Kubuntu Quick Setup.

    c. Enable the X11 session additionally to Wayland - like openSUSE Tumbleweed does and like TUXEDO OS offers during installation
    (e.g. because you encounter problems in Wayland or use certain programs that require a “real” X11 session).
    • sudo apt update && sudo apt install plasma-session-x11
      (this installs the X11 session)
    Next be sure that “Automatically log in:” is off
    in -> System Settings -> Colours & Themes (section: Appearance & Style) -> Login Screen (SDDM) -> [Behaviour…] (this is a button at the top).
    Now
    • reboot
    and choose "Desktop Session: Plasma X11" in the lower left corner of the log in screen to use X11 instead of Wayland.

    From now on you can always switch back and forth between X11 and Wayland simply by logging out and choosing the desired session.

    d. Always start with an empty session
    (e.g. for stability, performance or security reasons).

    Go to -> System Settings -> Session (section: System) -> Desktop Session -> Session Restore
    and set “On login, launch apps that were open:
    to “Start with an empty session”.
    Click [Apply].

    You will have to log out and in again or reboot to apply the change.

    e. Disable fast user switching
    (e.g. for security or performance reasons in multi-user setups).
    • sudo mkdir -p /etc/xdg && echo -e "\n[KDE Action Restrictions] [\$i]\naction/switch_user=false\naction/start_new_session=false" | sudo tee -a /etc/xdg/kdeglobals
      (this writes the modified values for all users to your system)
    You will have to log out and in again or reboot to apply the change.
    Last edited by Schwarzer Kater; Today, 04:55 AM. Reason: added claydoh's suggestion to step 4.
    Debian LXQt • Kubuntu • openSUSE KDE • Linux Mint • Windows • macOS
    Desktop: HP Elite SFF 805 G9 • Laptop: Apple MacBook Pro 13" • and others

    important things to do after installation (24/26.04)get rid of Snap script (20.04 +)
    install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04 +)

    #2
    Concerning step 1. (before anybody asks):

    Since the Beta came out I have fresh-installed Kubuntu 26.04 LTS about 45-50 times on different targets:
    - (legacy) BIOS PC with SATA HDD
    - (legacy) BIOS PC with SATA SSD​
    - UEFI PC with SATA SSD
    - UEFI PC with NVMe M.2 SSD
    - virtual machines with UEFI.

    And I also have to say that if I compare Kubuntu 26.04 LTS to Kubuntu 16.04 (10 years ago): It has evolved beautifully and come a long way.
    So thank you very, very much to all the developers!
    Last edited by Schwarzer Kater; Yesterday, 10:51 AM. Reason: typos et al.
    Debian LXQt • Kubuntu • openSUSE KDE • Linux Mint • Windows • macOS
    Desktop: HP Elite SFF 805 G9 • Laptop: Apple MacBook Pro 13" • and others

    important things to do after installation (24/26.04)get rid of Snap script (20.04 +)
    install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04 +)

    Comment


      #3
      Thank you very much for preparing this once again! I was reading your 24.04LTS article this morning and I was wondering if you would write something relevant. Cheers! 🍻

      Comment


        #4
        A random observation, regarding #2:

        After many years of editing swappiness, I realize that I have not done so since as far back as 2024, I think. Even on my high-ram gaming system, I'd either set it to 10, or in the end run with zero swap.
        I wonder if recent kernel upgrades have alleviated this problem? In particular, my 2017 HP mini PC never hits swap much at all, like it used to, and I have used this hardware since the 22.04 era.
        My new "gaming" build has no issues, like that last rig did but I have no past experience there to compare to.

        Now, I am just curious. Times change, things sometimes improve.

        My 2022 Chromebook I don't recall ever having swapiness issues, but I may have just never noticed.


        I do propose adding a 4c, for btrfs and LVM users and the perpetual 30 second grub timeout that has been around forever. Which is not a bug, but the intended action/yucky hack for file systems that Grub cannot write to.

        There are a number of ways to fix this
        • add a GRUB_RECORDFAIL_TIMEOUT=​xx to /etc/default/grub , set to the desired time
        • Add this to /etc/default/grub: GRUB_RECORDFAIL_TIMEOUT=​$GRUB_TIMEOUT​ to make it match the GRUB_TIMEOUT value (probably the recommended method) (what I do on my Kubuntu systems)
        • Edit the grub script that causes the setting to be implemented: sudo sed -i "/recordfail_broken=/{s/1/0/}" /etc/grub.d/00_header​ (What I did on my PC)
        https://nelsonslog.wordpress.com/202...il-30-seconds/
        https://forums.linuxmint.com/viewtopic.php?p=1588204&sid=e42562d2cbd961e6658f1e 727effc0ec#p1588204
        https://askubuntu.com/questions/1123...-time-with-lvm
        https://discourse.ubuntu.com/t/grub-timeout/61168

        And many more links, plus numerous launchpad bug reports.
        Self-built: Asus PRIME B550M-K/Ryzen 5600GT/32Gb/Intel ARC B580 12Gb/KDE neon
        HP Elitedesk 800 G3 Mini: i5-7500T(35w)/32Gb/Kubuntu LTS
        HP Chromebook 14: i5-1135G7/8Gb/512Gb SSD/KDE Linux

        Comment


          #5
          Thank you claydoh - this is a good idea (completely have forgotten about it, IIRC I had last used it with a BIOS PC…).

          I think it does no harm to generally add this to step 4. a) and b) - there may be other partitions on a user's system that GRUB has "problems" with.
          So I did.
          Last edited by Schwarzer Kater; Today, 04:40 AM. Reason: typos
          Debian LXQt • Kubuntu • openSUSE KDE • Linux Mint • Windows • macOS
          Desktop: HP Elite SFF 805 G9 • Laptop: Apple MacBook Pro 13" • and others

          important things to do after installation (24/26.04)get rid of Snap script (20.04 +)
          install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04 +)

          Comment

          Users Viewing This Topic

          Collapse

          There is 1 user viewing this topic.

          Working...
          X