Linux

Where Does pacman Store Cache and Databases?

pacman keeps downloaded packages in /var/cache/pacman/pkg. Sync databases live in /var/lib/pacman/sync and settings in /etc/pacman.conf.

Last updated

Downloaded package files stay in /var/cache/pacman/pkg for reinstall and downgrade use. The folder can grow large on long lived installs.

Repository metadata lives under /var/lib/pacman. Cache location and repos are set in /etc/pacman.conf, with mirrors in /etc/pacman.d/mirrorlist.

Where pacman stores this, by platform

Linux
/var/cache/pacman/pkg/

Package cache. Needs root to clean. Use paccache or pacman clean actions to trim old versions. Keep at least one prior version for easy rollback.

Linux
/var/lib/pacman/sync/

Per repo sync databases. Refreshed on sync operations. A lock file db.lck appears here during transactions. Remove it only when no pacman process runs.

Linux
/etc/pacman.conf

Main config with CacheDir, HookDir and repo sections. Mirror list is included from /etc/pacman.d/mirrorlist. Back up before changing cache or signature settings.

Frequently asked questions

How do I safely free space in the pacman cache?

Use paccache to keep recent versions and remove uninstalled package files. Use pacman clean actions only when low on space because full clears force fresh downloads.

Can I move the pacman cache elsewhere?

Yes. Set CacheDir in pacman.conf to the new path with a trailing slash. Avoid symlinking the default cache path because self upgrades can replace the link.

Notice an outdated path? Let us know.