Ubuntu 22.04 or 23.10. Reducing disk journal usage

Left unfettered, the disk journal files can consume multiple GB of disk space. In mini systems with smaller SSDs this can lead to warnings that the disk is running out of space.

To find amount of disk space in use: journalctl –disk-usage Sudo is not needed

If you decide to delete journal files, first close and archive all active journal files:
sudo journalctl –rotate

You can delete log files by age, disk space used or number of files to remain:
sudo journalctl –vacuum-size=150M leaves 150MB of journal files
sudo journalctl –vacuum-files=6 leaves 6 files
sudo journalctl –vacuum-time=3days leaves the last 3 days of files

The amount of space taken up by journal files can be limited by editing the journald.conf file:
sudo gedit /etc/systemd/journald.conf
Uncomment line 25 SystemMaxUse and set a value.
SystemMaxUse=150M
A different editor is used in Ubuntu 23.04 but the configurations are the same.

Reload the configuration
sudo systemctl restart systemd-journald