By the end of this guide you will have brought an Ubuntu or Kubuntu 26.04 LTS machine up to date, created and managed user accounts, turned on the ufw firewall, and know how to move to the next LTS release safely. It is written for anyone administering a single desktop, laptop or server from a terminal. Kubuntu is Ubuntu with the KDE Plasma desktop, so the commands are identical. Where Kubuntu differs, the guide says so.

Before you start

  • A supported release. These steps follow the documentation for Ubuntu 26.04 LTS “Resolute Raccoon”, released 23 April 20267. Kubuntu 26.04 LTS shipped the same day with Plasma 6.6 and kernel 7.05. Most commands also work on 24.04 LTS.
  • An account in the sudo group. By default the root account has no usable password. The first user the installer creates is a member of the sudo group and runs administrative commands with sudo 4.
  • A terminal. On Kubuntu this is Konsole. On Ubuntu Desktop it is Terminal. Over SSH it is your shell.
  • A working internet connection, and free disk space for the release upgrade (several gigabytes)1.
  • A backup of anything you cannot afford to lose, before the upgrade stage in particular1.
  • If you use SSH: a second open session before you touch the firewall (see Stage 3).

Support windows at a glance

Release Standard support ends Notes
Ubuntu 26.04 LTS May 2031 Ubuntu Pro ESM to May 20368
Ubuntu 24.04 LTS May 2029 Upgrade path to 26.04 LTS8
Ubuntu 22.04 LTS May 2027 Must go to 24.04 first8
Kubuntu 26.04 LTS April 2029 Flavour support is shorter than Ubuntu main59
Kubuntu 24.04 LTS April 2027 9

Ubuntu’s own table and Kubuntu’s page give different end dates for the same-numbered release. Kubuntu’s three-year window is stated by the Kubuntu team5. Do not assume the Ubuntu date applies to the flavour.

Stage 1: Update and manage packages

apt is the recommended tool for installing .deb packages2. Run all commands in a terminal.

  1. Refresh the package index:
    sudo apt update

    The index is built from the repositories listed in /etc/apt/sources.list.d. Ubuntu’s own are in /etc/apt/sources.list.d/ubuntu.sources. Releases before 24.04 use /etc/apt/sources.list instead2.

  2. Install the available upgrades:
    sudo apt upgrade
  3. Install a package. The documentation uses nmap as its example. You can list several names separated by spaces:
    sudo apt install nmap
  4. Remove a package:
    sudo apt remove nmap

    Add --purge to remove its configuration files too. The docs warn this may not be what you want2.

  5. List installed packages, or find the package that owns a file, with dpkg:
    dpkg -l | grep apache2
    dpkg -S /etc/host.conf
  6. Install a downloaded .deb file only when no repository offers it:
    sudo dpkg -i zip_3.0-4_amd64.deb

    Ubuntu advises against dpkg -r for removal because it does not handle dependencies. Use apt remove instead2.

  7. To review what apt did, read /var/log/dpkg.log 2. Kubuntu’s release notes say APT 3.2 in 26.04 also adds apt history-list and apt history-rollback 5. I did not find a step-by-step official guide for these, so check apt help before relying on rollback.

Scripts and automatic updates

apt is meant for interactive use. In scripts, use apt-get (optionally with --quiet). The basic syntax is the same2. Ubuntu Server applies security updates automatically by default2.

Repositories

Universe and multiverse are enabled by default. Packages there get no security patches except through Ubuntu Pro’s ESM, which is free for personal use on up to five machines2. To disable them, edit /etc/apt/sources.list.d/ubuntu.sources and remove universe and multiverse from the Components: line2.

On Kubuntu, Plasma Discover also shows updates in the system tray, but the commands above work the same.

Stage 2: Manage users, groups and sudo

  1. List all local usernames:
    cat /etc/passwd | cut -d : -f 1
  2. List only regular users (UID 1000 and above, plus nobody at 65534):
    cat /etc/passwd | cut -d : -f 1,3 | grep -E ':[0-9]{4,}'

    System users use UIDs 0–99 (pre-installed) and 100–999 (created by services). Regular users start at 10004.

  3. Add a user and answer the prompts for password and full name:
    sudo adduser username

    The home directory is created from /etc/skel. On Ubuntu 21.10 and later it gets private 0750 permissions4.

  4. Give that user administrator rights by adding them to the sudo group:
    sudo adduser username sudo

    This is the documented method: “To give any other account full root access through sudo, add them to the sudo group”4.

  5. Create or remove a custom group:
    sudo addgroup groupname
    sudo delgroup groupname
  6. Temporarily lock or unlock a password:
    sudo passwd -l username
    sudo passwd -u username
  7. Delete a user and its primary group:
    sudo deluser username

    The home folder is not removed. To keep it but stop a future user with the same UID from reading it, the docs give these steps4:

    sudo chown -R root:root /home/username/
    sudo mkdir /home/archived_users/
    sudo mv /home/username /home/archived_users/

Password ageing

  1. View a user’s current policy:
    sudo chage -l username
  2. Set the policy. This example, from the docs, sets a 5-day minimum age, 90-day maximum, 30 inactive days and a 14-day warning:
    sudo chage -m 5 -M 90 -I 30 -W 14 username

    The docs’ example also sets an account expiry date with -E. Add it only if you want the account to expire4.

  3. To raise the minimum password length from the default 6, edit /etc/pam.d/common-password and append minlen=8 to the pam_unix.so line. This check does not apply when an administrator creates an account with sudo 4.

Restrict SSH to chosen users

  1. Open /etc/ssh/sshd_config and add AllowGroups sshlogin.
  2. Add each permitted user to that group, then restart SSH4:
    sudo adduser username sshlogin
    sudo systemctl restart ssh.service

Root account

The docs say you can set a root password with sudo passwd, and disable it again with sudo passwd -l root 4. Most people should leave root disabled.

Stage 3: Turn on the firewall with ufw

ufw is Ubuntu’s default firewall front end and is disabled by default 3.

  1. If you are connected over SSH, allow SSH first so you are not locked out. Open a second session as a safety net:
    sudo ufw allow 22

    You can use the service name instead of the number if it is in /etc/services, for example ssh 3.

  2. Optionally preview a rule without applying it:
    sudo ufw --dry-run allow http
  3. Enable the firewall:
    sudo ufw enable
  4. Check the result:
    sudo ufw status verbose
  5. Allow SSH only from one host, or a whole subnet by changing the address to 192.168.0.0/24:
    sudo ufw allow proto tcp from 192.168.0.2 to any port 22
  6. Use an application profile instead of port numbers. List the profiles, then allow one:
    sudo ufw app list
    sudo ufw allow Samba

    Profiles live in /etc/ufw/applications.d. To see the ports a profile opens, run sudo ufw app info Samba 3.

  7. To remove a rule, list them with numbers, then delete by rule:
    sudo ufw status numbered
    sudo ufw delete deny 22

    sudo ufw insert 1 allow 80 places a rule at position 13. To close a port, sudo ufw deny 22 is the documented form. Turn the firewall off entirely with sudo ufw disable 3.

Stage 4: Upgrade to the next release

This is different from routine updates. The upgrade tool moves you to the next major release1.

Know your path

You can upgrade from one LTS only to the next sequential LTS. You cannot skip one1. Ubuntu’s 26.04 notes add that anyone on 22.04 or 25.04 must first move to 24.04 LTS or 25.107. LTS-to-LTS upgrades are normally offered only after the first point release. The -d flag forces an earlier upgrade but is not recommended for production1. Kubuntu 26.04.1 is already published9, so the normal route is open.

  1. Apr 202424.04 LTSNoble Numbat; standard support to May 2029 (Ubuntu)8
  2. Oct 202525.10sudo-rs becomes the default sudo4
  3. 23 Apr 202626.04 LTSUbuntu and Kubuntu release; Plasma 6.6, kernel 7.057
  4. Apr 2027Kubuntu 24.04 endsSupport date on kubuntu.org9

Prepare

  1. Read the release notes for the version you are moving to17.
  2. Fully update the current system. Phased packages can block the release upgrade, so include them1:
    sudo apt update
    sudo apt dist-upgrade -o APT::Get::Always-Include-Phased-Updates=true
  3. Check whether a reboot is needed. If this file exists, reboot first1:
    ls /run/reboot-required
  4. Confirm there is enough free disk space, and set aside time. The upgrade is interactive and may take hours1.
  5. Back up your data. Third-party repositories and PPAs are disabled during the upgrade, and they are the most common cause of problems1.
  6. Kubuntu only: back up your KDE settings. This command comes from a third-party guide, not Kubuntu’s own10:
    tar -czf ~/kde-config-backup-$(date +%Y%m%d).tar.gz ~/.config ~/.local/share

Run the upgrade

  1. Start the tool:
    sudo do-release-upgrade
  2. Read the summary of packages to be removed, installed and upgraded, plus the download size, then answer y to continue. After the download finishes, the process cannot be cancelled1.
  3. When asked about a modified configuration file, press D to see the differences. The default, N, keeps your version. The docs say accepting the maintainer’s version is sometimes required, for example /boot/grub/menu.lst, for the system to boot with the new kernel1.
  4. When asked, choose whether to remove obsolete packages.
  5. Answer y to the restart prompt. The system is not considered upgraded until it reboots1.

On Kubuntu, a third-party guide says the 24.04 to 26.04 upgrade also uses do-release-upgrade, and says NVIDIA driver 470 and older are incompatible with kernel 7.010. That claim is not in Kubuntu’s own notes, so check your driver before upgrading.

After the upgrade (Kubuntu)

Kubuntu warns that upgraders may see visual glitches, broken panel layouts or misbehaving themes. Its fix5:

  1. Open System Settings, then choose Colors & Themes.
  2. Reapply your preferred global theme.
  3. When prompted, tick both Desktop Layout and Window Layout.

If that fails, Kubuntu’s last resort is to back up and remove ~/.config, which resets all Plasma settings5. Also note that the Plasma Wayland session is the default, and plasma-session-x11 is available but not installed by default and not supported by the Kubuntu team5.

Common problems

Problem Fix
apt upgrade says “packages have been kept back” Usually phased updates. The docs say you can safely ignore this and the update arrives automatically. Security updates are never phased6.
Release upgrade refuses or stalls Run sudo apt update and the dist-upgrade command in Stage 4 again. Check /run/reboot-required 1.
Software from a PPA vanished after upgrade PPAs are disabled during upgrade. Re-enable them or find newer versions1.
Release upgrade says no new release LTS upgrades are offered after the first point release. The -d flag forces it but is not for production1.
Config-file prompt during upgrade Use D to compare. Keep yours by default, but accept the maintainer’s file where it is needed to boot1.
Locked a user’s password but they still log in over SSH Locking the password does not stop key-based SSH login. Remove or rename ~/.ssh/ and kill live sessions4.
Deleted user’s files are exposed to a new user with the same UID deluser leaves the home folder. Use the chown and mv steps in Stage 24.
Someone else’s files are readable on an older install Pre-21.10 homes were 0755. Run sudo chmod 0750 /home/username and set DIR_MODE=0750 in /etc/adduser.conf 4.
sudo behaves differently from old tutorials 25.10+ uses sudo-rs. Switch back with update-alternatives --config sudo, though this is not recommended4.
Broken Plasma panels or themes after upgrading Kubuntu Reapply the global theme as in Stage 4. Only then consider resetting ~/.config 5.
Spectacle OCR gives no text in your language Install the Tesseract language pack, for example sudo apt install tesseract-ocr-deu 5.
Alternatives not covered here
  • Aptitude: a text-menu front end. Install it with sudo apt install aptitude. The docs describe +, -, u, U and g keys2.
  • IP masquerading with ufw: needs edits to /etc/default/ufw and /etc/ufw/sysctl.conf 3. It is not a routine task.
  • Kubuntu graphical upgrade: I saw a Kubuntu community wiki snippet for an older release (pkexec do-release-upgrade -m desktop -f DistUpgradeViewKDE) but could not open the page, and no current Kubuntu 26.04 page confirms it. It is not included as a step.

Checked against

  • Ubuntu 26.04 LTS (Resolute Raccoon) release notes, dated 23 April 20267, and Kubuntu 26.04 LTS release notes, dated 23 April 2026 (Plasma 6.6, kernel 7.0, APT 3.2)5.
  • Ubuntu Server documentation pages for package management, firewalls, user management and release upgrades, as live on 13 October 2026. Search results dated two of them 26 June 2026 and the upgrade page 6 July 20261234.
  • Ubuntu’s release-cycle page8 and the Kubuntu download page, which lists 26.04.19. One third-party guide10 was used only for the KDE backup command and the NVIDIA warning, which are marked as such.
  • Commands were taken from the pages above. I did not run them on a live system.