Use pacman and sort to see your largest installed packages
The fastest way to find which packages are taking up space on your Arch system is to run a single command that lists every installed package by size. Open a terminal and type:
pacman -Qi | grep 'Size' | awk '{print $4}' | paste - <(pacman -Q | awk '{print $1}') | sort -rn | head -20
This command shows your 20 largest packages in megabytes, with the biggest at the top. The output will look like a number followed by a package name — for example, "2500 linux" means the Linux kernel is using 2500 MB. If you want to see more or fewer packages, change the "20" at the end to a different number.
If that command feels too long to type, you can also use pacman -Qi by itself, which lists every package with its size. Then scroll through and look for the largest numbers. This takes longer but requires less typing.
Key Takeaways
- The pacman command with grep and sort will show your largest packages in one output, sorted from biggest to smallest.
- Package size shown by pacman is the installed size on disk, not the download size.
- The linux package (your kernel) and base-devel (build tools) are often the largest, but removing them will break your system.
- Use pacman -Sc to remove old cached package files, which often frees up more space than uninstalling packages.
- Check your home directory and /var/log separately, because user files and logs are not counted as package size.
Understanding what pacman size numbers mean
When pacman shows you a package size, it is the space that package takes up after installation — not the download size. A package that downloads as 50 MB might install as 200 MB because files are compressed during download and expanded when installed.
The size includes all the files that package puts on your disk: binaries, libraries, configuration files, and documentation. If you remove a package, you free up roughly that amount of space, though some shared libraries might stay if other packages depend on them.
Keep in mind that pacman only counts files installed by packages. Your home directory, temporary files, and log files are separate. If your disk is full, check those locations too — sometimes a single large log file or a Downloads folder uses more space than all your packages combined.
Why the cache folder holds more space than you think
Arch keeps copies of every package you have ever installed in /var/cache/pacman/pkg/. This folder can grow to several gigabytes over time, especially if you update frequently or have installed many versions of the same package.
You can safely delete old cached packages without breaking anything. Run pacman -Sc to remove all cached versions of packages you no longer have installed. If you want to be more aggressive and delete cached versions of packages you still have, use pacman -Scc — but keep at least one copy of each installed package in case you need to reinstall it without downloading.
Cleaning the cache often frees up more space than uninstalling packages, because you are removing duplicates rather than removing functionality. Many users find that running pacman -Sc once a month keeps the cache under control.
Packages you should not remove even if they are large
The linux package is almost always one of the largest, usually 100 MB or more. Do not remove it — your system will not boot without a kernel. The same applies to base and base-devel, which contain core system files and build tools that many other packages depend on.
Other large packages like gcc (the C compiler), glibc (the C library), and systemd (the init system) are also critical. Removing them will break your system or make it unbootable. Before uninstalling any large package, check whether other packages depend on it by running pacman -Qi packagename and looking at the "Required By" line.
If you want to save space, focus on optional packages you installed yourself — desktop environments, games, media players, or development tools you no longer use. These are safe to remove without affecting your system's ability to run.
Finding space used by your home directory and logs
Package sizes do not include files in your home directory or system logs. If you have a full disk, check these separately using the du command. To see the largest folders in your home directory, type:
du -sh ~/* | sort -rh | head -10
This shows your 10 largest folders. Look for Downloads, Documents, Videos, or hidden folders like .cache or .local, which often hold gigabytes of data. You can delete files from these folders without affecting your system.
System logs live in /var/log/ and can also grow large. Run sudo du -sh /var/log/* | sort -rh to see which logs are taking space. You can safely delete old log files, though it is better to use journalctl --vacuum=30d to keep only the last 30 days of system logs.
Using graphical tools if you prefer not to use the terminal
If you would rather not type commands, several graphical programs show disk usage. Baobab (also called Disk Usage Analyzer) is included in many Arch installations and shows a visual map of which folders and files are using space. Install it with pacman -S baobab if you do not have it, then open it from your applications menu.
Another option is ncdu, which runs in the terminal but is easier to navigate than typing commands. Install it with pacman -S ncdu, then run ncdu / to scan your entire disk. Use the arrow keys to move between folders and press 'd' to delete files directly from the program.
Both tools show you the same information as the command-line approach but in a format that is easier to explore. If you are new to the terminal, starting with Baobab or ncdu is a good way to understand where your space is going before you decide what to remove.
Frequently Asked Questions
Can I remove the linux package to save space?
No. The linux package is your system kernel — without it, your computer will not boot. If you want to save space, remove optional packages instead. If you have multiple kernel versions installed, you can remove older ones with pacman, but keep at least one.
What is the difference between pacman -Sc and pacman -Scc?
pacman -Sc removes cached copies of packages you have uninstalled, which is safe. pacman -Scc removes all cached packages, including ones you still have installed. Use -Sc regularly; use -Scc only if you are desperate for space and do not mind re-downloading packages if you need to reinstall them.
Why does my disk show full but pacman says my packages are small?
Packages are only part of your disk usage. Check your home directory with du -sh ~/* and your logs with du -sh /var/log/* to find the rest. Also check for large files in /tmp or /var/tmp, which can accumulate over time.
Is it safe to delete files in .cache or .local in my home directory?
Yes, but some programs will need to rebuild their cache the next time you run them. .cache usually contains temporary data that programs can recreate. .local contains application data and settings — delete it only if you are sure you do not need it, or delete specific subfolders instead of the whole directory.
How do I see which package a file belongs to?
Use pacman -Qo /path/to/file to find out which package installed a specific file. This helps you decide whether removing a package will delete something you need.