Install duf on Raspberry Pi

Install duf on Raspberry Pi

The duf is a tool for displaying disk space usage of the system via command line. The duf can be used as an alternative to the df command. The duf allows to show results in the table or in JSON format.

This tutorial demonstrates how to install duf on Raspberry Pi.

Install duf

Use SSH to connect to Raspberry Pi. Retrieve the latest version tag of duf release and assign it to variable:

DUF_VERSION=$(curl -s "https://api.github.com/repos/muesli/duf/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')

Run the following command to download Debian package (.deb) from releases page of the duf repository:

curl -Lo duf.deb "https://github.com/muesli/duf/releases/latest/download/duf_${DUF_VERSION}_linux_armv7.deb"

Next, install duf:

sudo apt install -y ./duf.deb

When installation is finished, we can check version of duf:

duf -version

The .deb file can be removed because no longer needed:

rm -rf duf.deb

Testing duf

Execute the duf command without any arguments to view all mounted filesystems:

duf
Get list of all mounted filesystems using duf on Raspberry Pi

Uninstall duf

If you decided to completely remove duf, run the following command:

sudo apt purge --autoremove -y duf

The 2 Comments Found

  1. Avatar
    Tony Reply

    Earlier models of the Raspberry Pi need ARM6 code rather than ARM7. Change the second command to :

    curl -Lo duf.deb "https://github.com/muesli/duf/releases/latest/download/duf_${DUF_VERSION}_linux_armv6.deb"

    if the ARM7 version won't work on your older model.

Leave a Comment

Cancel reply

Your email address will not be published.