How to Clean Up the Fedora Root Folder
OK, so you’re running Fedora and you’re getting warnings that you’re running out of disk space on the root folder. What are your options?
The first thing to consider is resizing the root partition size. For that you can find instructions here
If that is not an option, then the next thing you probably should do
is find out which folders/directories are causing the issue. You can use
the du
command and some piping to figure this out:
Search the largest folders
$ sudo du --exclude="/home" -x -h -a / | sort -r -h | head -30
Common cleanable folders
Sometimes the issue is found in the docker cache:
$ docker system prune -a
or previous kernel versions:
$ sudo dnf remove $(dnf repoquery --installonly --latest-limit=-2 -q)
Journal logs
$ sudo journalctl --vacuum-size=100M
Caches
The dnf package cache can be cleaned up too:
$ sudo dnf clean packages
You can also try cleaning up the Fedora version cache:
$ sudo dnf system-upgrade clean
Tags: cli, fedora, disk-space, clean, resize, sysadmin, motd
Speed Up DNF Package Manager
You can increase the download speed for installing packages using DNF by updating the maximum number of simultaneous package downloads.
Start by editing the /etc/dnf/dnf.conf
file:
$ sudo nano /etc/dnf/dnf.conf
Add the following line to enable DNF parallel downloads:
max_parallel_downloads=10
Another option is to select the fastest mirror from the Fedora public mirrors by adding the following line:
fastestmirror=True
Tags: cli, dnf, fedora, rhel, package-managers, motd
How to List Installed Packages in Fedora, RHEL, CentOS
Listing installed packages with YUM:
$ sudo yum list installed
To display details about a package:
$ yum info nginx
You can cat all installed packages to a file, copy the file to another machine and duplicate the system:
$ sudo yum list installed > installed-packages.txt
$ sudo yum -y install $(cat installed-packages.txt)
List installed packages with RPM:
$ sudo rpm -qa
List them by installation date:
$ sudo rpm -qa --last
Display information about a package:
$ rpm -qi nginx