How to Clean Up /var/tmp on Linux

Remove unnecessary files from /var/tmp on Linux and reclaim disk space with Kudu.

By Kudu Team

Fix this automatically with Kudu

Run a free system scan to detect and resolve this issue automatically — no manual steps required.

Download Kudu Free →

Meta description: Remove unnecessary files from /var/tmp on Linux and reclaim disk space with Kudu.

What Causes This?

The /var/tmp folder stores temporary files that programs want to keep between reboots. Over time, installers, package managers, scripts, browsers, and other apps can leave behind old temp files that are no longer needed. If cleanup does not happen automatically, these files build up and waste disk space. Large log fragments, cached downloads, and abandoned temp data are common causes.

Common Symptoms

  • Your Linux system is low on disk space for no obvious reason
  • The / or /var partition keeps filling up
  • You see very large or very old files inside /var/tmp
  • Software updates or app installs fail because there is not enough free space
  • The system feels slower during file operations

How to Fix It Manually

  1. Check how much space /var/tmp is using.

    • Open a terminal.
    • Run:
      sudo du -sh /var/tmp
    • If you want to see which files or folders are taking the most space, run:
      sudo du -ah /var/tmp | sort -h | tail -20
  2. Review the contents before deleting anything.

    • List files with details:
      sudo ls -lah /var/tmp
    • Look for old archives, installer leftovers, cache folders, or files from apps you no longer use.
    • Avoid deleting files that belong to programs currently running.
  3. Remove old files safely.

    • To delete files in /var/tmp older than 7 days, run:
      sudo find /var/tmp -type f -mtime +7 -delete
    • To remove empty folders left behind after cleanup, run:
      sudo find /var/tmp -type d -empty -delete
    • If you want to inspect first instead of deleting immediately, replace -delete with:
      -print
  4. Delete specific large items manually if needed.

    • If you found a large file or folder you know is safe to remove, delete it directly:
      sudo rm -f /var/tmp/filename
      sudo rm -rf /var/tmp/foldername
    • Be careful with rm -rf. Double-check the path before pressing Enter.
  5. Recheck free disk space.

    • Confirm the cleanup worked:
      df -h
      sudo du -sh /var/tmp
    • If space is still low, check other common locations such as /tmp, /var/cache, and large log files in /var/log.
  6. Set up regular cleanup if this keeps happening.

    • Many systems already manage temp files with systemd-tmpfiles.
    • To see current temp file cleanup rules, run:
      systemd-tmpfiles --cat-config
    • If /var/tmp is not being cleaned often enough, adjust your distro’s temp file policy carefully or use a maintenance tool to automate safe cleanup.

Fix It Automatically with Kudu

Kudu can scan your system for oversized temp folders, leftover cache files, and other junk that builds up over time, including data similar to what fills /var/tmp. Instead of checking directories by hand and guessing what is safe to remove, Kudu helps you reclaim space with a faster, simpler cleanup process.

Download Kudu Free →

Fix this automatically with Kudu

Run a free system scan to detect and resolve this issue automatically — no manual steps required.

Download Kudu Free →