Relativity new to Raspberry Pi and Linux in general, but essentially I'm trying to create an update repository for my Raspberry Pis via a separate Linux server, how would I go about doing this? On the Raspberry Pi website I've only seen so far that it allows me to download the entirety of Raspbian when I just need the update files in order to push updates out to my other Pis. Hope this questions makes sense and thanks in advance for the assist!
2 Answers
On the assumption that you're trying to save bandwidth, whilst updating several Pis, then apt-cacher-ng
may be what you're looking for. It's quite simple to set up:
On your server (this could actually be one of the Pis) install it with:
sudo apt-get install apt-cacher-ng
Then on the clients run the following as root:
echo 'Acquire::http { proxy "http://ServerIP:3142"; };' >> /etc/apt/apt.conf.d/02proxy
Be sure to change ServerIP
to the correct IP.
Now if you install something with apt
on one of the clients the package and dependencies will be cached on the server, so when you install the same package on client 2 it will download from the server instead of the online repo.
Raspbian is a derivate from Debian and it also uses Debians infrastructure. As far as I understand you want to setup your own package repository like that one used by Raspbian and Debian. First of all: the used repositories are configured in /etc/apt/sources.list
and in files in directory /etc/apt/sources.list.d/
. On Raspbian there are two files by default:
rpi ~$ cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
rpi ~$ cat /etc/apt/sources.list.d/raspi.list
deb http://archive.raspberrypi.org/debian/ stretch main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ stretch main ui
You can browse the repositories with http://raspbian.raspberrypi.org/raspbian/ and with http://archive.raspberrypi.org/debian/
The former repository is mainly the Debian repository http://ftp.de.debian.org/debian/ just compiled for armhf. The latter repository is from the Raspberry Pi Foundation and contains specific software to run the Raspberry Pi hardware, e.g. the kernel, firmware and drivers. This could be an example for your setup.
I do not have made a Debian repository before so I can give only some pointers. Here I have fond an entry for a Debian Repository Setup. You also can google for "how to make a debian repository".
-
You may want to copy paste this to here: raspberrypi.stackexchange.com/questions/99984/… (Which is a clearer and more focused version of the question, although this may not be an answer to it).– goldilocks ♦Jun 26, 2019 at 14:53
apt
), which does exactly what you are asking for (it only downloads what is required to update).