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
sudogroup. By default the root account has no usable password. The first user the installer creates is a member of thesudogroup and runs administrative commands withsudo4. - 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.
- Refresh the package index:
sudo apt updateThe 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.listinstead2. - Install the available upgrades:
sudo apt upgrade - Install a package. The documentation uses
nmapas its example. You can list several names separated by spaces:sudo apt install nmap - Remove a package:
sudo apt remove nmapAdd
--purgeto remove its configuration files too. The docs warn this may not be what you want2. - List installed packages, or find the package that owns a file, with
dpkg:dpkg -l | grep apache2 dpkg -S /etc/host.conf - Install a downloaded
.debfile only when no repository offers it:sudo dpkg -i zip_3.0-4_amd64.debUbuntu advises against
dpkg -rfor removal because it does not handle dependencies. Useapt removeinstead2. - To review what
aptdid, read/var/log/dpkg.log2. Kubuntu’s release notes say APT 3.2 in 26.04 also addsapt history-listandapt history-rollback5. I did not find a step-by-step official guide for these, so checkapt helpbefore 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
- List all local usernames:
cat /etc/passwd | cut -d : -f 1 - List only regular users (UID 1000 and above, plus
nobodyat 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.
- Add a user and answer the prompts for password and full name:
sudo adduser usernameThe home directory is created from
/etc/skel. On Ubuntu 21.10 and later it gets private0750permissions4. - Give that user administrator rights by adding them to the
sudogroup:sudo adduser username sudoThis is the documented method: “To give any other account full root access through
sudo, add them to thesudogroup”4. - Create or remove a custom group:
sudo addgroup groupname sudo delgroup groupname - Temporarily lock or unlock a password:
sudo passwd -l username sudo passwd -u username - Delete a user and its primary group:
sudo deluser usernameThe 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
- View a user’s current policy:
sudo chage -l username - 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 usernameThe docs’ example also sets an account expiry date with
-E. Add it only if you want the account to expire4. - To raise the minimum password length from the default 6, edit
/etc/pam.d/common-passwordand appendminlen=8to thepam_unix.soline. This check does not apply when an administrator creates an account withsudo4.
Restrict SSH to chosen users
- Open
/etc/ssh/sshd_configand addAllowGroups sshlogin. - 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.
- 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 22You can use the service name instead of the number if it is in
/etc/services, for examplessh3. - Optionally preview a rule without applying it:
sudo ufw --dry-run allow http - Enable the firewall:
sudo ufw enable - Check the result:
sudo ufw status verbose - 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 - Use an application profile instead of port numbers. List the profiles, then allow one:
sudo ufw app list sudo ufw allow SambaProfiles live in
/etc/ufw/applications.d. To see the ports a profile opens, runsudo ufw app info Samba3. - To remove a rule, list them with numbers, then delete by rule:
sudo ufw status numbered sudo ufw delete deny 22sudo ufw insert 1 allow 80places a rule at position 13. To close a port,sudo ufw deny 22is the documented form. Turn the firewall off entirely withsudo ufw disable3.
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.
- Apr 202424.04 LTSNoble Numbat; standard support to May 2029 (Ubuntu)8
- Oct 202525.10sudo-rs becomes the default sudo4
- 23 Apr 202626.04 LTSUbuntu and Kubuntu release; Plasma 6.6, kernel 7.057
- Apr 2027Kubuntu 24.04 endsSupport date on kubuntu.org9
Prepare
- Read the release notes for the version you are moving to17.
- 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 - Check whether a reboot is needed. If this file exists, reboot first1:
ls /run/reboot-required - Confirm there is enough free disk space, and set aside time. The upgrade is interactive and may take hours1.
- Back up your data. Third-party repositories and PPAs are disabled during the upgrade, and they are the most common cause of problems1.
- 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
- Start the tool:
sudo do-release-upgrade - Read the summary of packages to be removed, installed and upgraded, plus the download size, then answer
yto continue. After the download finishes, the process cannot be cancelled1. - When asked about a modified configuration file, press
Dto 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. - When asked, choose whether to remove obsolete packages.
- Answer
yto 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:
- Open System Settings, then choose Colors & Themes.
- Reapply your preferred global theme.
- 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,Uandgkeys2. - IP masquerading with ufw: needs edits to
/etc/default/ufwand/etc/ufw/sysctl.conf3. 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.