Score:0

creating a linux local update mirror (cache) and automating it

de flag

Hi i run a few different linux distributions and architectures and have some from server so slow that they update in KB/s for example with ubuntu on ARM. I'm learning up automation, how would i go about

  • creating a local only linux mirror/cache
  • updating that mirror/cache regularly automatically
  • automating the router to wake up the file server to update that cache and shutting it down when finished
  • additionally if possible, update other VMs/devices after the file server updates.

I have access to my router to create static DNS entries as well and i have a file server that consumes a lot of power when turned on but it is very fast (does gzip close to 1GB/s which is the raid's peak performance). It takes more than 200W just keeping it on and no matter what i do cant reduce the wattage to under 100W so i decided to just have it at max performance and only turn it on when i need it.

I bricked one of the ARM boards OS and cant open it up to access the SD card, as one of the ubuntu upgrades went too slow that it timed out and messed up the firmware update as an example. I figured since i use a few distros very often that i might as well have the update process done from a local cache as an exercise to learning ansible.

I would like help in learning how to do this be it here or links to resources in how to do what i'd like.

Score:1
za flag

For Debian and Ubuntu based systems is it more benefit able when you use apt-cacher-ng instad of apt mirror imho

the reason for this decision is that you only and really only only hold requested packages without taking the time to jeep anything up2date

Myself using this for around 10+ years to reduce the cost and traffic. It supports any kind of proxy supporting distribution which should be mostly all.

Ok one point is that you need to catch onwtimes a package but if its required one times more it will be delivered by the cache.

de flag
The issue i have is that some distributions/libraries or in some cases closest locations can be slow. In this case it is better to download the entirety of the repository automatically everyday and update against that. When i say slow, i mean dialup speeds due to slow servers (for example odroid hardware). Updating any odroid official distributions is super slow but unavoidable as every ARM board requires its own implementation, cant just grab a binary and expect it to work.
djdomi avatar
za flag
well even in this case will apt cacher work
de flag
nope, There needs to be a fast and reliable source to download from. This is because on the first try it will be so slow, so if another device can take its time to download first before running the upgrade and that it can download from it, then it should work, but my question was setting up this cache device to download something not from it as this is a different CPU architecture.
Score:0
cn flag

This is potentially a bit off topic due to the recommendation rule, but anyways...

There's a fair amount to unpack here, but I'd start with looking at:

  1. CentOS - reposync tool, Ubuntu - apt-mirror tool.
  2. cron for the scheduling
  3. Not sure you can easily automate the router, unless you can have something else send a wake-on-LAN packet to the server
  4. You could try and schedule the updates on other VMs/servers, but otherwise just having a local copy of packages is helpful.

More generally, you may want to look at things like Bash scripting or Python scripting to automate small tasks. I tend to use Bash for stuff initially, then Python if it's getting too complex, then Golang if it really needs static types or I'll be distributing the tool.

de flag
Thanks. I use mikrotik as my router so it supports scripts, triggers and wake on lan. I can configure it to send a wake on lan packet on traffic but that would be too much, but rather i can set scripts to trigger based on time as well. Mikrotik also has an API for remote communication as well.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.