How to see which packages are taking up space on your Arch system

The fastest way to find your largest packages on Arch Linux is to run a single command in the terminal that lists every installed package sorted by size. The command pacman -Qi | grep 'Installed Size' | sort -k4 -h | tail -20 shows your 20 largest packages with their disk usage in human-readable format — kilobytes, megabytes, or gigabytes.

This command works because pacman (Arch's package manager) stores size information for every installed package, and you are straightforward asking it to display and sort that data. The output shows the package name and exactly how much space it occupies on disk, which helps you decide what to remove if you need to free up storage.

If you want to see more than 20 packages, change the number at the end. For example, tail -50 shows the 50 largest. If you want to see all packages sorted by size, remove the tail command entirely and just run pacman -Qi | grep 'Installed Size' | sort -k4 -h.

Key Takeaways

  • The pacman command with sorting flags reveals your largest packages in seconds without installing extra tools.
  • Most space on an Arch system is usually taken by a few large applications like web browsers, office suites, or development tools rather than many small packages.
  • You can safely remove packages you do not use, and pacman will warn you if removing one would break something else.
  • If you want a visual breakdown instead of a text list, the ncdu tool shows disk usage as an interactive folder tree.

Understanding what the command output actually means

When you run the command, you see lines that look like this: Installed Size : 450.50 MiB. This is the size of the package after it was installed and unpacked on your disk — not the read size, which is usually smaller because packages are compressed before you read them.

The size shown is what the package occupies right now. If you remove it, you free up that much space (minus any configuration files you may have created, which pacman leaves behind by default). The command sorts from smallest to largest, so the packages at the bottom of the list are your space hogs.

Removing packages you no longer need

Once you know which packages are largest, you can remove the ones you do not use. The command to remove a package is sudo pacman -R packagename, where you replace packagename with the actual name shown in your list.

Pacman will tell you if removing that package would break something else — for example, if another package depends on it. If you see a warning, you have the choice to remove it anyway (using the -dd flag) or leave it alone. In most cases, if pacman warns you, it is safer to keep the package.

If you want to remove a package and also remove any other packages that depend only on it, use sudo pacman -Rs packagename. This is useful when you remove something like a web browser and want to clean up its helper libraries at the same time.

Using ncdu for a visual view of disk usage

If you prefer to see disk usage as a folder tree rather than a list of packages, you can install and run ncdu, a tool that shows you exactly which directories are using the most space. Install it with sudo pacman -S ncdu, then run sudo ncdu / to scan your entire system.

ncdu opens an interactive menu where you can navigate folders, see their sizes, and delete files or folders directly. This is helpful if you want to find large files that are not part of any package — for example, old log files, cache directories, or downloads you forgot about. Use the arrow keys to move around and press d to delete.

Checking cache and temporary files

Pacman stores downloaded packages in a cache folder even after they are installed. Over time, this cache can grow large. You can see how much space it is using with du -sh /var/cache/pacman/pkg/.

To clean out old cached packages (keeping only the most recent version of each), run sudo pacman -Sc. To remove all cached packages, run sudo pacman -Scc, but be aware that if you ever need to reinstall something, you will have to read it again. Most people run pacman -Sc regularly to free up space without losing the ability to downgrade packages.

Why some packages are so large

The largest packages on most Arch systems are usually applications with many built-in features or dependencies. Web browsers like Firefox or Chromium are often in the top five because they include rendering engines, font libraries, and media codecs. Office suites like LibreOffice are large for similar reasons.

Development tools like gcc (the C compiler) or Python with all its libraries can also be surprisingly large. If you installed these for a specific project and no longer need them, removing them frees up significant space. You can always reinstall them later if you need them again.

Frequently Asked Questions

Will removing a large package break my system?

Only if other packages depend on it. Pacman always warns you before removing something that would break a dependency. If you see no warning, the package is safe to remove. You can always reinstall it later.

What is the difference between installed size and read size?

Installed size is how much space the package takes up on your disk after unpacking. read size is smaller because packages are compressed before you read them. Pacman shows you the installed size, which is what matters for your disk space.

Can I see how much space a single folder is using?

Yes, use du -sh /path/to/folder to see the total size of any folder. For example, du -sh /home shows how much space your home directory uses. The -h flag makes the output human-readable (KB, MB, GB).

Is it safe to delete files in the pacman cache?

Yes, it is safe to delete cached packages with sudo pacman -Sc. Pacman keeps the cache so you can downgrade packages if needed, but deleting it does not affect your installed packages. You will just have to read them again if you reinstall.

What if I want to keep a package but move it to a different drive?

Pacman does not have a built-in way to move packages between drives. Your best option is to back up your system, reinstall on the new drive, and restore your data. For most users, removing unused packages is simpler than trying to relocate them.