Stop Apt from trying to download packages you already have

Package Management (Apt/Dnf/Pacman Internals)

Stop Apt from trying to download packages you already have

🧩 The Challenge

You ever run an apt update on a dozen remote boxes over a slow link and watch it waste minutes fetching metadata for packages you already have cached? It drives me up the wall when I’m just trying to verify a single binary.

💡 The Fix

Just point your local apt config to a folder on your workstation that acts as a partial mirror. This saves you from burning bandwidth and stops your package manager from constantly hitting the mirrors.

echo 'Dir::Cache::Archives "/home/user/apt-cache/";' | sudo tee /etc/apt/apt.conf.d/99localcache

⚙️ Why It Works

Setting this directory forces apt to look locally before it ever fires off an HTTP request. It’s a total lifesaver when you’re working off a tethered phone or a crowded satellite connection.

🚀 Pro-Tip: Use symlinks if you want to keep the cache folder on a separate mount point without breaking the config path.

Linux Tips & Tricks | © ngelinux.com | 11/23/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted