Fedora Linux Server useful one liners

By | April 10, 2024

While running the blog server on Fedora Linux I found out that some one liners are either very important to be executed once or very useful periodically.

Here are some of my most used one-liners

Updating packages

Note that I allow dnf to skip broken packages and delete if necessary. Sometimes if using other than the officials repos you get into all kind of issues.

dnf update -y --allowerasing --skip-broken

Updating to a new version

This is the command to update to Fedora 39. Note again I allow dnf to try to fix stuff.

dnf system-upgrade download --refresh --releasever=39 --allowerasing --skip-broken

Clean all logs

Logs are good but sometimes on a server they tend to eat up a lot of space. Sometimes doing upgrades is difficult due to lack of space caused by the huge system logs (tens of GB). To clean all logs up to the last second execute this.

journalctl --vacuum-time=1s

Disable suspend and hibernation

You really do not want suspend or hibernate on a server !!!

systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.