Skip to content

Instantly share code, notes, and snippets.

@mh-firouzjah
Last active September 30, 2025 11:57
Show Gist options
  • Save mh-firouzjah/967b2fb8cba238cc060b6d8ed27fcc1a to your computer and use it in GitHub Desktop.
Save mh-firouzjah/967b2fb8cba238cc060b6d8ed27fcc1a to your computer and use it in GitHub Desktop.
General recommendations for post-installation

Kubuntu Post Installation Steps

This document is an annotated index of popular articles and important information for improving and adding functionalities to the installed Kubuntu system.

  1. configure ufw firewall
  2. remove snap and reboot
  3. update/upgrade
  4. install graphic driver
  5. disable crash-reporter that spams logs (apport.service)
  6. install proprietary media codecs
  7. improve Battery by installing TLP for Linux
  8. install additional packages
  9. configure journalctl log size
#!/bin/bash
# Kubuntu Post-Installation Script

# --- 1. Configure Firewall ---
echo "Configuring UFW firewall..."
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable
sudo ufw status

# --- 2. Remove Snap ---
echo "Removing Snap packages and snapd..."
if snap list | grep -q "."; then
    # Dynamically find and remove all installed snaps
    for snap in $(snap list | awk 'NR>1 {print $1}'); do
        sudo snap remove --purge "$snap"
    done
fi
sudo apt-get remove --purge -y snapd plasma-discover-backend-snap
sudo rm -rf ~/snap /snap /var/snap /var/lib/snapd
echo "Snap removal complete. A REBOOT IS REQUIRED."
# reboot

# --- After rebooting ---

# --- 3. System Update & Package Installation ---
echo "Updating system and installing all packages..."
sudo apt-get update
sudo apt-get upgrade --fix-missing -y

# Consolidated package list
sudo apt-get install -y \
    kubuntu-restricted-extras \
    build-essential curl wget git gnupg lsb-release \
    rar unrar zip unzip p7zip-full \
    rsync net-tools dnsutils iputils-ping \
    htop smartmontools lm-sensors \
    tlp tlp-rdw powertop \
    acpi pciutils usbutils

# --- 4. Install Graphic Drivers ---
echo "Installing graphic drivers..."
sudo ubuntu-drivers autoinstall
# Optional: Nvidia suspend/resume fix
# Consider applying only if you experience issues.
sudo systemctl disable --now nvidia-hibernate.service nvidia-resume.service nvidia-suspend.service
# The following command forcefully prevents the script from running.
# Use with caution as it modifies a system file.
# sudo sed -i '2i exit 0' /usr/bin/nvidia-sleep.sh
echo "Driver installation complete. A REBOOT IS REQUIRED."
# reboot

# --- After rebooting ---

# --- 5. System Optimizations ---
echo "Applying system optimizations..."

# Disable Apport crash reporter
sudo systemctl disable --now apport.service
sudo systemctl mask apport.service
sudo rm -rf /var/crash/*

# Enable power management and hardware monitoring
sudo systemctl enable --now tlp.service
sudo systemctl enable --now smartd.service

# Persist powertop tunings
sudo tee /etc/systemd/system/powertop.service > /dev/null <<EOF
[Unit]
Description=Powertop tunings

[Service]
Type=oneshot
ExecStart=/usr/sbin/powertop --auto-tune

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now powertop.service

echo "Post-installation tasks complete."

sudo vim /etc/systemd/journald.conf
-----------------------------------
[Journal]
#Storage=auto
#Compress=yes
#Seal=yes
#SplitMode=uid
#SyncIntervalSec=5m
#RateLimitIntervalSec=30s
#RateLimitBurst=10000
SystemMaxUse=200M
SystemKeepFree=50M
SystemMaxFileSize=50M
#SystemMaxFiles=100
#RuntimeMaxUse=
#RuntimeKeepFree=
#RuntimeMaxFileSize=
#RuntimeMaxFiles=100
MaxRetentionSec=2week
MaxFileSec=1week
#ForwardToSyslog=no
#ForwardToKMsg=no
#ForwardToConsole=no
#ForwardToWall=yes
#TTYPath=/dev/console
#MaxLevelStore=debug
#MaxLevelSyslog=debug
#MaxLevelKMsg=notice
#MaxLevelConsole=info
#MaxLevelWall=emerg
#LineMax=48K
#ReadKMsg=yes
#Audit=yes

Extra Sources To Read

  1. https://www.kubuntuforums.net/forum/currently-supported-releases/kubuntu-24-04-nitpick-noble-lts/post-installation-az/678534-essential-and-strongly-recommended-things-to-do-directly-after-a-kubuntu-24-04-lts-installation

Thanks to:

  1. Schwarzer Kater aka "The Black Kitten" | Apr 25, 2024
  2. Silver Moon | June 5, 2023
  3. bkanhu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment