This question already has an answer here:
I am looking at setting up several Centos machines in my network and would like to have them update from a centralised server on the network. I am hoping to save bandwidth by not having to update each OS from the internet.
The solutions I have found require me to mirror the entire centos repository, which I find to be a terrible waste of storage considering that I would only ever be using a fraction of the packages available.
The solution I am looking for would allow all machines to point to a local yum server for packages and if the latter doesn't have the requested package, get it from the www and cache it for the next request.