How to Install Duf on Ubuntu 26.04, 24.04 and 22.04

Last updated Sunday, March 22, 2026 12:09 pm Joshua James 5 min read

Disk usage is easier to read when Duf turns the usual df output into a color-coded table, and you can install Duf on Ubuntu from the Universe repository on every supported LTS release. It works just as well in a desktop terminal as it does over SSH on servers and minimal installs.

Ubuntu 26.04 (Resolute Raccoon), 24.04 (Noble Numbat), and 22.04 (Jammy Jellyfish) all package Duf, so the same APT workflow handles installation, a few useful command examples, updates, and removal. If Universe is missing on your system, enabling it is the only extra setup step.

Update Ubuntu Before Installing Duf

Refresh APT first so Ubuntu pulls the current package metadata before you install anything new.

sudo apt update && sudo apt upgrade

These commands use sudo for package-management tasks. If your account does not have sudo access yet, follow the guide on add a new user to sudoers on Ubuntu first.

Install Duf on Ubuntu Using APT

Duf comes from Ubuntu’s Universe repository, which keeps the package in the normal APT update path instead of forcing a manual download. The packaged version differs by release, but the install command stays the same.

Ubuntu releaseDefault Duf versionRepository component
Ubuntu 26.04 (Resolute Raccoon)0.9.xUniverse
Ubuntu 24.04 (Noble Numbat)0.8.xUniverse
Ubuntu 22.04 (Jammy Jellyfish)0.6.xUniverse

Desktop installs usually have Universe enabled already. Some server, cloud, and minimal images do not, which is when apt starts reporting that it cannot find the package.

If APT returns Unable to locate package duf, enable Universe first, then rerun the install command. The guide on enable Universe and Multiverse in Ubuntu covers the broader Ubuntu component layout if your system is missing more than Universe.

Install the package with Ubuntu’s standard package manager:

sudo apt install -y duf

Verify the install with apt-cache policy so you can see both the installed revision and the repository source:

apt-cache policy duf
duf:
  Installed: 0.9.1-1
  Candidate: 0.9.1-1
  Version table:
 *** 0.9.1-1 500
        500 http://au.archive.ubuntu.com/ubuntu resolute/universe amd64 Packages
        100 /var/lib/dpkg/status

Ubuntu 24.04 currently reports 0.8.1-1ubuntu0.24.04.3 from noble-updates and noble-security, while Ubuntu 22.04 reports 0.6.2-1ubuntu0.1 from jammy-updates and jammy-security. The official Ubuntu package index for Duf tracks the same package across all three LTS releases.

Use Duf Commands on Ubuntu

The package name and the command name are the same, duf. These Duf commands stick to options that work across Ubuntu 26.04, 24.04, and 22.04.

Run Duf on Ubuntu

Start with the default view when you want a quick check of mounted filesystems and available space.

duf
╭───────────────────────────────────────────────────────────────────╮
│ 2 local devices                                                   │
├────────────┬────────┬───────┬────────┬────────┬──────┬────────────┤
│ MOUNTED ON │   SIZE │  USED │  AVAIL │  USE%  │ TYPE │ FILESYSTEM │
├────────────┼────────┼───────┼────────┼────────┼──────┼────────────┤
│ /          │ 122.0G │ 11.9G │ 103.8G │   9.8% │ ext4 │ /dev/sda3  │
│ /boot/efi  │ 512.0M │  6.1M │ 505.9M │   1.2% │ vfat │ /dev/sda2  │
╰────────────┴────────┴───────┴────────┴────────┴──────┴────────────╯

Duf usually follows the local-device table with additional sections for tmpfs, udev, and other special mounts, so the full output is often longer than this first block.

Filter Filesystem Types With Duf on Ubuntu

Use a filesystem filter when you want to focus on real storage volumes instead of every temporary mount.

duf --only-fs ext4

This keeps the output centered on ext4 volumes, which is useful when you only care about root or data partitions.

Sort and Trim Duf Output on Ubuntu

Sort the table and limit the columns when you want a cleaner health check or something easier to paste into notes.

duf --sort size --output size,used,avail,usage,mountpoint

The --output list controls both which fields appear and the order they are shown in the final table.

Check Inode Usage With Duf on Ubuntu

Switch to inode mode when free space still looks healthy but a filesystem may be running out of file entries.

duf --inodes
╭──────────────────────────────────────────────────────────────────────╮
│ 2 local devices                                                      │
├────────────┬─────────┬────────┬─────────┬────────┬──────┬────────────┤
│ MOUNTED ON │  INODES │   USED │   AVAIL │  USE%  │ TYPE │ FILESYSTEM │
├────────────┼─────────┼────────┼─────────┼────────┼──────┼────────────┤
│ /          │ 8159232 │ 201947 │ 7957285 │   2.5% │ ext4 │ /dev/sda3  │
│ /boot/efi  │       0 │      0 │       0 │        │ vfat │ /dev/sda2  │
╰────────────┴─────────┴────────┴─────────┴────────┴──────┴────────────╯

Ubuntu 26.04 and 24.04 label the inode columns as IUSED, IAVAIL, and IUSE%, while Ubuntu 22.04 keeps the older USED, AVAIL, and USE% labels.

Export Duf Data as JSON on Ubuntu

Use JSON output when you want to pass filesystem data into another script or monitoring tool.

duf --json

The JSON output starts like this on a typical Ubuntu system:

[
 {
  "device": "sysfs",
  "device_type": "special",
  "mount_point": "/sys",
  "fs_type": "sysfs",
  "type": "sysfs",
  "opts": "rw,nosuid,nodev,noexec,relatime",
  "total": 0,
  "free": 0,
  "used": 0
 }

If you need per-directory totals instead of mounted-filesystem totals, learn the du command in Linux as well. Duf and du solve different storage questions.

Review Duf Help on Ubuntu

Check the built-in help when you want to confirm which flags your Ubuntu release actually supports.

duf --help

Ubuntu 26.04 and 24.04 include newer options such as --only-mp, --hide-mp, and threshold flags, while Ubuntu 22.04 ships an older build without those switches. The upstream Duf documentation on GitHub is useful for release notes, but duf --help on your own system is the safest source before you copy newer flags into a script.

Update or Remove Duf on Ubuntu

Duf stays in the normal Ubuntu package workflow, so updates and removal do not need a separate repository or manual binary cleanup.

Update Duf on Ubuntu

Use APT’s single-package upgrade path when you want the newest Duf build available for your Ubuntu release without upgrading unrelated packages.

sudo apt update && sudo apt install --only-upgrade -y duf

If your system is already current, APT reports that Duf is already the newest version for that release.

Remove Duf on Ubuntu

Remove the package first, then let APT clean up any dependencies it no longer needs.

sudo apt remove --purge -y duf

Run the cleanup step separately so you can review APT’s removal list before it deletes older auto-installed packages that may no longer be tied to Duf.

sudo apt autoremove --purge

Verify the package is gone and that Ubuntu still sees the repository candidate correctly:

apt-cache policy duf
duf:
  Installed: (none)
  Candidate: 0.9.1-1
  Version table:
     0.9.1-1 500
        500 http://au.archive.ubuntu.com/ubuntu resolute/universe amd64 Packages

Ubuntu 24.04 and 22.04 show their own package revisions in the Candidate field, but the success state is the same: Installed: (none). A basic package install and one normal Duf run also do not create dedicated ~/.config/duf, ~/.cache/duf, or ~/.local/share/duf directories, so package removal is usually the only cleanup needed.

Duf on Ubuntu FAQ

Why do some Duf flags work on Ubuntu 26.04 and 24.04 but not on Ubuntu 22.04?

Ubuntu 22.04 ships an older Duf package, so newer options such as --only-mp, --hide-mp, and threshold flags are not available there. Check duf --help on the local system before you copy a command from newer upstream examples or from a newer Ubuntu release.

Why does Duf show built from source instead of a version number on some Ubuntu releases?

Ubuntu 24.04 and 22.04 package Duf in a way that makes duf --version print duf (built from source) instead of the package revision. The package is still installed correctly. Use apt-cache policy duf or dpkg -s duf when you need the exact Ubuntu package version.

Should you replace the default df command with Duf on Ubuntu?

Duf is easier to read for interactive checks because it adds clearer columns, color, filtering, and JSON export. The default df command is still useful for scripts and older documentation that expect the traditional output format, so most Ubuntu users keep both tools available.

Conclusion

Duf on Ubuntu is ready to give you a cleaner filesystem view than the default df output across desktop terminals, servers, and SSH sessions. For process monitoring in the same shell workflow, install htop on Ubuntu. For live throughput checks, install Bmon on Ubuntu next.

Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffee Buy me a coffee

Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Got a Question or Feedback?

We read and reply to every comment - let us know how we can help or improve this guide.

Let us know you are human: