Updating from a local machine

The purpose of this article is to outline how to setup a local repo for YUM and to use that repo to update other machines on your network.

Why??

Typically, you would pull updates directly from the official repositories. However, in some cases, you may want to manage the updates via on repository. Or, if you have limited bandwidth, the option of sneaker netting in packages can help manage he load on your link.

The Short Overview, maybe its all you need

  1. Install a tool called createrepo --- sudo dnf install createrepo
  2. Populate the local repository with .rpm files --- there are a number of ways to accomplish this reposync
  3. Run the createrepo tool to create a local repository, this will generate the mirrorlist --- sudo mkdir /repo; sudo createrepo -d
  4. Serve the local repository over your lan --- quick and dirty, sudo python -m http.server 8500
  5. Configure machines to get updates from your local repo --- create a file.repo with baseurl=http://localip:8500

Tools

To accomplish this we are going to use a number of tools in the terminal: createrepo python3 yum nano

The longer version....

So, I live in a location where broadband internet is not available. This has some pretty big issues when it comes to downloading larger files, leading to saturating my bandwidth, burning through my data, etc. When I am in town I have better access to the internet and faster connection so the logical question arises, "Can I download my updates in town and update my home systems?"

The answer is yes, you can remotely download the newer .rpms and update your more off grid systems. To start us off we are going to need a place for these files to live. For myself I think I'm going to use my main home server to serve the packages over my lan but my laptop to initially download the files. So I made a dir /repo in my system to place all of these rpms.

Now its time to add .rpm files to that folder, this is straight forward, so don't overthink it.

  1. You can manually add .rpm files downloaded to the folder directly
  2. you can use the sudo yum update --downloadonly --distdir=/repo which will grab updates to the current system you are on
  3. you can install dnf-utils and run reposync --repoid=fedora. The last will sync the full repository to your local machine which could be good if you want all the packages but there is likely alot of packages in there that you will not use and it will be quite large.

Resources

https://jsmith.fedorapeople.org/drafts/SMG/html/Software_Management_Guide/ch08s04.html