The software described in this documentation is either no longer supported or is in extended support.
Oracle recommends that you upgrade to a current supported release.

2.6.3 Synchronizing Software Channels Using spacewalk-repo-sync

You can use the spacewalk-repo-sync utility to synchronize software channels. Using this command requires that you are root or that you have been granted permission in /etc/sudoers. You can run spacewalk-repo-sync manually or in a cron job. If you run the command in a cron job, include the -q or --quiet option to prevent large email messages from being sent to root.

You can use the spacewalk-repo-sync -l command to display the channel label and the URL of the repository, for example:

# spacewalk-repo-sync -l | grep ksplice
ksplice-ol7-x86_64 | uln:///ol7_x86_64_ksplice
ksplice-ol6-i386 | uln:///ol6_i386_ksplice
ksplice-ol6-x86_64 | uln:///ol6_x86_64_ksplice

# spacewalk-repo-sync -l | grep addons
oraclelinux7-x86_64-addons | https://yum.oracle.com/repo/OracleLinux/OL7/addons/x86_64/
oraclelinux6-x86_64-addons | https://yum.oracle.com/repo/OracleLinux/OL6/addons/x86_64/

To synchronize a channel with either a yum or a ULN repository, use the -c option to specify the channel label, for example:

# spacewalk-repo-sync -c ksplice-ol6-x86_64
#### Channel label: ksplice-ol6-x86_64 ####
Repo URL: uln:///ol6_x86_64_ksplice
The download URL is: https://linux-update.oracle.com/XMLRPC/GET-REQ/ol6_x86_64_ksplice
Packages in repo:              1296
Packages already synced:          0
Packages to sync:              1296
1/1296 : ksplice-snmp-plugin-0.1.0-2.el6-0.x86_64
2/1296 : uptrack-updates-2.6.39-400.210.2.el6uek.x86_64-20150206-0-0.noarch
...
1295/1296 : uptrack-updates-2.6.32-220.el6.x86_64-20150130-0-0.noarch
1296/1296 : uptrack-updates-2.6.32-200.20.1.el6uek.x86_64-20141216-0-0.noarch
Linking packages to channel.
Repo uln:///ol6_x86_64_ksplice has 0 errata.
Sync completed.
Total time: 1 day, 8:56:47

In this example, all the packages were downloaded as the channel had not previously been synchronized with ULN. The total time taken was nearly 33 hours.

You can use the same form of the command to synchronize a channel with an Oracle Linux yum server repository, for example:

# spacewalk-repo-sync -c oraclelinux6-x86_64-addons
#### Channel label: oraclelinux6-x86_64-addons ####
Repo URL: https://yum.oracle.com/repo/OracleLinux/OL6/addons/x86_64/
Packages in repo:               308
No new packages to sync.
Repo https://yum.oracle.com/repo/OracleLinux/OL6/addons/x86_64/ has 6 errata.
Sync completed.
Total time: 0:01:09

In this example, there were no new packages available to download.

The -p option allows you to synchronize a parent channel and all of its children in one operation:

# spacewalk-repo-sync -p parent_channel

For example:

# spacewalk-repo-sync -p oraclelinux7-x86_64

If you additionally specify the --latest option, the server synchronizes only the latest packages that are available.

 spacewalk-repo-sync -p oraclelinux7-x86_64 --latest
#### Channel label: oraclelinux7-x86_64 ####
Repo URL: https://yum.oracle.com/repo/OracleLinux/OL7/optional/latest/x86_64/
Packages in repo:             10133
Packages already synced:          0
Packages to sync:              5845
1/5845 : bind-lite-devel-9.9.4-18.el7_1.3-32.i686
2/5845 : bind-sdb-chroot-9.9.4-18.el7_1.2-32.x86_64
...

In this example, only the 5,845 latest packages needed to be downloaded of the 10,133 packages in the repository.

Note

The --latest option downloads the latest packages that are available at the time of synchronization. It does not remove older packages from the channel. If the synchronization interval is large, you might miss a particular version of a package. This can have implications for errata handling, where errata are associated with specific package versions. If errata consistency is important to you, Oracle recommends that you do not use --latest. However, using --latest with a Ksplice channel is an exception because its packages are always cumulative.

For more information, see the spacewalk-repo-sync(8) manual page.