Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

How to clean up the Fedora root folder

December 10, 2020
Aurélien Pupier
Related topics:
Open sourceLinux

Share:

    When upgrading a package or the Fedora release version, I sometimes hit the error:

    Disk Requirements: At least XXX more space needed on the / filesystem.

    This message tells me that the disk space is inadequate. I need to clean the Fedora root folder space before performing the upgrade.

    When browsing to learn more about this issue, I can easily find many people who have the same problem, as well as many different cases where it occurs. In addition, the possible ways to fix this issue are typically spread over various forums, making it complicated to choose the right path.

    In this article, I grouped together several interesting sources that describe different ways to address this issue, even when my case wasn't the root cause. I hope my experience and understanding of this issue helps save you time in resolving it.

    Search the largest folders

    To start, I perform a local search to help guide my next actions. One search shows the 30 larger folders outside of "/home". It is important to exclude /home as it is usually a partition of data mounted outside of the root partition, as shown in the following command. In case there are also several data partitions that I need to exclude:

    sudo du --exclude="/home" -x -h -a / | sort -r -h | head -30

    (Kudos to CabSud for proposing the command in this thread.)

    After that, I check the largest folders to determine their size and use. Then I can safely remove these folders or use the safe command if available. Check through the list of common stuff that requires a large space and the command used to clean them safely.

    Common cleanable folders

    During these searches, I found several recommended ways to resolve the inadequate disk space warning. Each is described as follows.

    Docker

    Docker stocks all images and containers in the root partition. For a heavy user, there is a good chance a lot of the stored images are no longer used. When I ran this command it cleaned 27GB:

    docker system prune -a

    The Docker command demonstrates the most efficient results.

    Kernel previous version

    By default, three kernel versions are kept. You can remove one to free up space and keep only two using this command:

    dnf remove $(dnf repoquery --installonly --latest-limit=-2 -q)

    Don't expect the dnf command to provide too much size cleaning. It won't free up several gigabytes, but it remains an option for cleaning out some space. For more details, take a look at this article.

    Fedora version cache

    When upgrading to a new version of Fedora, a cache is created. In theory, the cache is cleaned after the upgrade. If not, cleaning can be forced using the following command:

    dnf system-upgrade clean

    Journal log

    The journal log can take up a fair amount of space. In my case, running this command cleared 1.5GB:

    sudo journalctl --vacuum-size=100M

    However, I noticed some people mentioning that it saved them as much as 5GB. More options are explained in this blog post.

    Dnf package cache

    I mention this last option because it was often the first recommendation shown in the forums I reviewed, and therefore worthy of note. In my case, this command didn't clean anything:

    dnf clean packages

    Learn about more options in the command documentation.

    Increase the root partition size

    If you still don't have space, you can increase the root partition size. Several people say this tutorial worked for them. I didn't use it myself because it requires you to unmount the home folder. As a newbie in Fedora usage, I preferred to investigate again to reduce the size before attempting this manipulation, and I finally found success.

    Hopefully, sharing my experience helps you find the right solution to your root partition space problems.

    Last updated: December 20, 2020

    Recent Posts

    • Cloud bursting with confidential containers on OpenShift

    • Reach native speed with MacOS llama.cpp container inference

    • A deep dive into Apache Kafka's KRaft protocol

    • Staying ahead of artificial intelligence threats

    • Strengthen privacy and security with encrypted DNS in RHEL

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue