Can I Transfer .deb Files Between Debian Machines to Save Bandwidth?

0
13
Asked By CuriousExplorer97 On

I'm trying to minimize the bandwidth used for updating and upgrading my Debian systems because my Internet access is limited to the hotspot on my phone, and it's pretty pricey. I have three Debian machines that I've been updating separately. If I copy the .deb files from the /var/cache/apt/archives directory of one machine to the other two, will those machines recognize that the .deb files are already there and skip the download? Or does Linux keep a record of the downloaded packages in some database?

I found out about a tool called apt-clone that could potentially replicate the apt cache across machines, but it looks like the package has been removed and isn't available in any repositories anymore due to reported bugs. So now I'm wondering if simply copying .deb files is enough.

Also, I noticed there are certain files like pkgcache.bin and srcpkgcache.bin in /var/cache/apt and a bunch of files in /var/lib/apt/lists. These total over 300MB and seem crucial for apt's functioning; they might contain important dependency information. Is it safe to assume that dependencies are handled within the .deb files themselves?

I've managed to get it working for one file eventually. I had some issues at first, but it turns out that the .deb files in /var/cache/apt/archives need to match up with the files in /var/lib/apt/lists. After running an apt update, it started working. I've hit my bandwidth limit for now, so I haven't tried the upgrade command yet.

1 Answer

Answered By TechieTinker On

Yeah, you can definitely do that! Just make sure to use the full path when you run 'apt install' on those packages. It should allow you to install them directly without needing to download them again. If your goal is to avoid downloads altogether, that’s a solid approach.

BandwidthSaver101 -

Since there are hundreds of files involved, it would be ideal if I could just run the upgrade commands and have it skip the download step altogether, directly unpacking, installing, and configuring the files.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.