Reposync is a new feature added to TDNF package manager version 3.1.0. Since the default version of TDNF installed on Photon OS 3.0 is 2.0.0, you must upgrade the system so that the latest version of TDNF is installed.
Prerequisites
Ensure that you upgrade the TDNF version to 3.1.0. For information about upgrading the TDNF version, see Preparing Your System.
Procedure
- Install the required packages.
#tdnf install createrepo nginx
- Use the
reposync
command to synchronize the repositories of photon-updates and Photon from https://packages.vmware.com. Run the following commands:
To synchronize from
photon-updates repository:
#tdnf reposync --download-metadata --disablerepo=* --enablerepo=photon-updates --delete --download-path /photon-reps/updates
To synchronize from
photon repository:
#tdnf reposync --download-metadata --disablerepo=* --enablerepo=photon --delete --download-path /photon-reps/release
Note: The size of
photon-updates repository is about 46 GB. The size of
photon repository is about 3.7 GB. It takes two to three hours to synchronize both repositories, and the duration depends on your network bandwidth and latency.
- Update
repodata
if there are updates to any packages in the repository:
#createrepo -po /photon-reps/updates/photon-updates /photon-reps/updates/photon-updates/
#createrepo -po /photon-reps/release/photon /photon-reps/release/photon/
- Switch the ownership of the Photon repository folders after the image synchronizes.
For security reasons, do not use the Privileged User role for web services.
#chown -R nobody:nogroup /photon-reps