Dissappearing drive space

Just recently started using Fedora Linux on a cheap notebook (32gb hd, 1.4 ghz cherry trail Quad core, 4gb memory). Fedora itself works fine, but installing apps takes horrendous amounts of drive space - four shell extension and gnome tweaks all at 400 kb or less after install took 500 mb of space, a sudo dnf install @xfce-desktop-environment (on top of gnome) said 67 mb but after install 1gb of space was gone. And various other apps usually take 200 ~ 300 mb on top of the size they are supposed to use.
sudo dnf clean all usually gives me back about 100 mb - nowhere near the excess size taken though. Does anyone know what’s going on or how I can reclaim the hard drive space?
Thanks in advance.

1 Like

Hi @bpinjp! Welcome to the community! Please have a look at the introductory posts in the #start-here category if you haven’t had a chance to do so.

That will clean dnf cache only, nothing else – and that’s not very large. ~ 100 mb seems about right.

Generic advice I can give is to use Disk usage analyzer (also known as baobab) to see which files/directories eat up space on your disk. With it you can easily find the biggest spacehogs on you drive and decide if you need them or can you part with them.

Baobab is installed by default in Fedora workstation.

Similar tool but with ncurses interface (i.e. interactive cli application) is called ncdu and can be installed with

sudo dnf install ncdu

You may consider the following to utilize limited free space more effectively:

  • Use a single LV or partition for root and home file systems.
  • Use minimal system installation with only basic components.
  • Use only one DE and do not install the applications which depend on anther DE components.
  • Install the packages selectively and do not use DNF group install.
  • Leave only the packages you need and remove everything else.
  • Disable weak dependencies for DNF.

Thanks nightromantic, I’ll check out both of those. (And yes I did check out the starthere section and duck duck go, but searches proved useless.)

Hi vgaetera, LV and LVM partition are the same, correct? I’m already set as a single root/home partition using LVM. A reinstall doesn’t bother me, so how would I go about selecting a minimal system install (I’m installing from the live workstation 30 image via usb) would a different spin be better? I assume it is somewhere in Fedora docs? Do you have a recommendation for a low power notebook like mine?
Do not use DNF group install is a good tip.

1 Like

On a 32GB disk I suppose that’s a necessary evil, but normally I wouldn’t recommend it because it makes the process of doing something like a reinstall so much more destructive when you can’t protect your /home from being wiped out in the process. Though I suppose if it’s a just-set-up machine, it’s not so bad. (And you said you’re already running that way, @bpinjp, so moot point.)

The growth you’re seeing in disk space consumed sounds unusual, and almost certainly has something to do with metadata because the disk files you mentioned don’t actually take up nearly as much space.

I don’t install Shell extensions using dnf (I install them via extensions.gnome.org for my local user), but you can run sudo du -sch /usr/share/gnome-shell/extensions to find out how large the ones you installed are. That directory on my machine is 168 KB because it only has two extensions in it.

My $HOME/.local/share/gnome-shell/extensions/, with 12 extensions in it, is 7 MB.

As for gnome-tweaks, installed that’s only…

$ rpm -q --queryformat="[\"%{FILENAMES}\"\n]" gnome-tweaks|xargs -n1000 du -sch
1.8M	total

So, I’m thinking the growth you’re seeing is in collection of one-time data, such that subsequent installs wouldn’t consume nearly as much. But, because you’re hyper-aware of space consumption, you notice it the first itime. (And take steps to clean it out, which is just going to cause it to build up again on the next run.) My suspicion is that every run of dnf wouldn’t consume so much extra space. But there is a certain amount of metadata that gets stored locally, and it is rather large.

One question that pops to mind: Do you ever run dnf as non-root? That is, from your user account without using sudo? dnf doesn’t share its metadata store between users, so running it as a regular user will create a second entire copy of the metadata store in /var/tmp/dnf-$username-$random: Mine is currently 250 MB. That’s in addition to the system stores at /var/cache/dnf (797 MB), /var/lib/dnf (535 MB), and /var/lib/rpm (384 MB). If /var/tmp/dnf-anything exists, you can blow it away completely to reclaim that space. (And make sure not to run dnf as a regular user, ever.)

It’s also possible you’re getting hit with the dnf debug logging issue: Check the sizes of sudo du -sch /var/log/dnf* /var/log/hawkey*. On my system that’s only 19M, because I installed very aggressive log rotation. But users have, at times, reported sizes in the gigabytes.

Finally, you can see the size of your system journal with sudo journalctl --disk-usage, reduce it one-time with something like sudo journalctl --vacuum-size=1G, and adjust the maximum permitted size by editing SystemMaxUse in /etc/systemd/journald.conf. (You’ll still have to run a sudo journalctl --vacuum-size=NEWVAL after, to actually shrink it.)

(ETA: Oh, a word of warning: Whatever you do when clearing out dnf data (and, really, there’s nothing it stores that can’t be wiped, at the expense of probably just having to download it again for the next update), never mess with /var/lib/rpm. That’s your installed package database, break it and both dnf and rpm lose all ability to update or remove existing packages.)


To provide some perspective, dnf/rpm metadata isn’t always that huge. On my work machine (granted not very much packages installed and not many install/remove operations):

  • /var/tmp/dnf-$username-$random – 1.7 M
  • /var/cache/dnf – 202 M
  • /var/lib/dnf – 7.2 M
  • /var/lib/rpm – 106 M
  • sudo du -sch /var/log/dnf* /var/log/hawkey* – 254 M

For this one there’s a note in Common F30 bugs, can be useful to check it. Also they promised to fix it “in a future libdnf update” but it’s unclear to me if it really was (related bug is closed as ERRATA).

Live images don’t provide the ability for a custom/minimal install, they sort of copy the image of the system as it is to your hard drive. I assume (I don’t know for sure as I haven’t used it myself) netinstall image should give you this ability.

Fedora installation guide says:

The netinstall image boots directly into the installation environment, and uses the online Fedora package repositories as the installation source. With a netinstall image, you can select a wide variety of packages to create a customized installation of Fedora.

The Fedora Server netinstall image is a universal one, and can be used to install any Fedora Edition or your own set of favorite packages.

As far as I understand it, strict minimal install won’t put any graphical DE on your machine, you’ll have either choose some during installation or add it afterwards. But as I’ve said, I’ve never done it with Fedora (but did with CentOS and a couple other distros).

Links to download netinstall images are in the bottom-right of the download page, and here’s one for 64bit image:


I can offer only generic stuff I’ve heard, most of it I haven’t tried myself. Also it’s a widely known information, there’s a big chance I won’t say anything new to you. Basically on a scale from full-featured and (relatively) easy to use with small learning curve to simple/plain, with lower resource consumption but harder to get used to they are:

  • sort of flagmans are Gnome and KDE, and they say that on a lower-end hardware KDE is much more responsive than the Gnome – that I’ve heard recently from Fedora users.
  • Cinnamon should be quite close to Gnome on this scale – as far as I know.
  • Mate is very full-featured but lighter than Gnome (don’t know about KDE).
  • Lighter still – and much simpler – is XFCE.
  • And even more light and quite simple/plain is LXDE and LXQT. The latter is sort of more modern continuation of LXDE ideas, but they say it’s not quite ready yet.
  • Even more light are something like openbox and other tiling window managers. That’s not even a full-featured DEs. Still quite a few people like and use them. I’ve tried one of them for a short period of time, but never used them seriously.
    You can read a bit about them in this and this Fedora Magazine articles.

Disk space requirements should generally go down as you move down the scale as well – though I can’t say how Gnome, KDE, Cinnamon and Mate compares between them. You can have some idea by looking at iso sizes for various respins here, for example, – and size differences there aren’t huge. Though again, I’m quite sure that all these isos share a basic set of applications (such as Firefox and LibreOffice) on the top of their respective DEs to be useful.


Just to offer personal experience, I run LXDE on the remote desktop session of my headless fileserver (with the local GDM / display server disabled completely), and it’s very lightweight. It’s not even remotely what I’d call “modern” or “comfortable” to use as a primary desktop — though it serves well enough for my remote-access needs, in a “Windows 2000 flashbacks” sort of way.

Don’t know that I’d want to run it every day or try to be genuinely productive in it unless I really, really had no other option, though…


Thanks ferdnyc and nightromantic, that was a lot of useful infomation!
I/ve done a complete reinstall after further research and the tip leading me to use the Disk Usage Analyser. PackageKit was using a huge amount of space (nearly 2 gb) and I found so researching that I ran
sudo gsettings set org.gnome.software download-updates false
sudo pkcon refresh force
bringing PackageKit down to 208 mb and dnf down to 209 mb /var is now only at 605 mb after a complete dnf update. So I’m happy with that
Running the commands you gave me, gnomeshells is 224k with 5 extension and gnome tweaks is 1.8mb. So no problem there.

Right now my largest disk space usage is usr/lib64 at 2.8 gb (1 gb is from firefox, thunderbird and libreoffice), usr/share at 2.5 gb (locale 590 mb and fonts 397 mb), and lib at 1.2 gb (firmware at 325 mb, locale 227 mb and slack 209 mb). So those can’t be helped.

And yes this is a secondary computer, my main computer is a macbook, but I haven’t liked the way the company has been going for the last decade or so and since my macbook is almost dead I’m looking to go another way, but I despise windows os.

Thanks again for the info it has really helped delve further into thist.

1 Like

My use case is almost a netbook and most apps run as web services.
The base system and the minimal GNOME desktop take less than 1000 packages and about 5-6 GiB of disk space on the root file system.


Ahhhhh! I totally forgot about PackageKit’s auto-downloads, I always turn those off since I use dnf for all my updates. Should’ve thought of that. Sounds like you’re in good shape now, though, glad to hear it!

One tip to add to those du -sch commands, BTW (though Baobab is a handy tool as well) — piping the output to sort -h will arrange everything in ascending order by human-readable size units. So, e.g. the biggest space-hogs in my /var/lib/:

$ sudo du -sch /var/lib/*|sort -h|tail -n15 
3.6M	/var/lib/pcp/
5.3M	/var/lib/samba/
7.8M	/var/lib/PackageKit/
16M	/var/lib/texmf/
29M	/var/lib/selinux/
30M	/var/lib/sss/
76M	/var/lib/systemd/
113M	/var/lib/mlocate/
181M	/var/lib/mysql/
382M	/var/lib/mock/
384M	/var/lib/rpm/
535M	/var/lib/dnf/
808M	/var/lib/clamav/
1.3G	/var/lib/flatpak/
3.8G	total

(Looks like there are months-old temp directories in that clamav dir, not sure why but guess I have some cleanup to do.)

No matter how you slice it, 32GB is tight for any graphical OS as soon as you start installing a few applications. (I set up a Windows 7 VM once with “only” a 40G volume, and boy did I regret that. Turns out, especially with all the duplication from the WOW64 stuff, Windows 7 x86_64 has a hell of a time squeezing itself into less than 25G, and that was before I’d managed to install even one useful thing on it!)

One issue you may encounter in the future is not having enough space to perform online OS upgrades. The simplest and easiest way to upgrade from one Fedora release to the next is dnf system-upgrade, but that requires that you have enough free space in /var to download the entire updated package set (which is applied in an offline update), plus the working space to unpack it all during the upgrade process. Basically, you can need nearly twice the size of all the packages installed on your system in free space available.

How much that is will depend on how much is installed, of course. My desktop is a pretty heavily loaded machine, there are currently 6499 packages installed (which explains the RPM and DNF metadata store sizes I listed earlier), and in total my system partition is over 42 GB in size. Upgrading to Fedora 30, I had to have something like 5–6GB of space free, in order to download and install the 3.4GB of new RPMs for the upgrade.

All of which is to say, that might not be feasible in your situation, if your install grows significantly. So worst-case scenario you may have to just abandon the dnf system-upgrade approach and content yourself with downloading and attaching external upgrade media as the upgrade package source, if at all possible. But you’ve got a couple of months left before that comes up. :wink:

1 Like

Hi @vgaetera - I’m going to try a minimal\net install with a DE, but I don’t really like web based apps as I spend very little time actually online nor to I have moble interent access. Thanks for the optional idea, though.


@ferdnyc yes, this notebook drives me up the wall sometimes because of it’s limitations (I really wish at least the drive space was upgradeable). But it is a netbook and it will have suffice I can learn the OS so when my main machine dies I can buy another computer and be ready to migrate from Mac OS to linux.
Have a good one!

1 Like

Same here!

One more tip I’ve encountered in a good verified source – though I’ve never used it myself – it to remove PakageKit and gnome-software. It can be useful – but only if you’re ready to use dnf and online search for applications you need. In the original document it was presented as a way (one of steps) to reduce RAM consumed by GNOME DE:

sudo dnf remove PackageKit gnome-software

In fact, Linux is flexible enough to be used from the external HDD, for example. That’s not a very convenient solution, but it can work if you really need more space (and don’t move your notebook much). Just so you knew it’s possible.