Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

How to clean up the Fedora root folder

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

    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

    • Tekton joins the CNCF as an incubating project

    • Federated identity across the hybrid cloud using zero trust workload identity manager

    • Confidential virtual machine storage attack scenarios

    • Introducing virtualization platform autopilot

    • Integrate zero trust workload identity manager with Red Hat OpenShift GitOps

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    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
    © 2026 Red Hat

    Red Hat legal and privacy links

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

    Chat Support

    Please log in with your Red Hat account to access chat support.