Red Hat Training

A Red Hat training course is available for Red Hat Satellite

Chapter 3. Red Hat Satellite Proxy Information

This is a section on using Red Hat Satellite Proxy with the Red Hat Network Package Manager.

3.1. Using the Red Hat Network Package Manager and Serving Local Packages through the Red Hat Network Proxy

The Red Hat Network Package Manager is a command line tool that allows an organization to serve local packages associated with a private Red Hat Network channel through the Red Hat Network Proxy Server. To update only official Red Hat packages for the Red Hat Network Proxy Server, do not install the Red Hat Network Package Manager.
To use the Red Hat Network Package Manager, install the spacewalk-proxy-package-manager package and its dependencies.
Only the header information for packages is uploaded to the Red Hat Network Servers. The headers are required so that Red Hat Network can resolve package dependencies for the client systems. The actual package files (*.rpm) are stored on the Red Hat Network Proxy Server.
The Red Hat Network Package Manager uses the same settings as the Proxy, defined in the /etc/rhn/rhn.conf configuration file.
Here is a summary of all the command line options for Red Hat Network Package Manager rhn_package_manager:

Table 3.1. rhn_package_manager options

Option Description
-v, --verbose Increase verbosity.
-dDIR, --dir=DIR Process packages from directory DIR.
-cCHANNEL, --channel=CHANNEL Manage this channel - may be present multiple times.
-nNUMBER, --count=NUMBER Process this number of headers per call - the default is 32.
-l, --list List each package name, version number, release number, and architecture in the specified channel(s).
-s, --sync Check if local directory is in sync with the server.
-p, --printconf Print the current configuration and exit.
-XPATTERN, --exclude=PATTERN Exclude files matching this glob expression - can be present multiple times.
--newest Push only the packages that are newer than packages already pushed to the server for the specified channel.
--stdin Read the package names from stdin.
--nosig Push unsigned packages. By default the Red Hat Network Package Manager attempts to push only signed packages.
--username=USERNAME Specify your Red Hat Network username. If you do not provide one with this option, you will be prompted for it.
--password=PASSWORD Specify your Red Hat Network password. If you do not provide one with this option, you will be prompted for it.
--source Upload source package headers.
--dontcopy In the post-upload step, do not copy the packages to their final location in the package tree.
--test Only print the packages to be pushed.
--no-ssl Not recommended - Turn off SSL.
-?, --usage Briefly describe the options.
--copyonly Copies the file listed in the argument into the specified channel. Useful when a channel on the proxy is missing a package and you don't want to reimport all of the packages in the channel. E.g., rhn_package_manager-cCHANNEL--copyonly/PATH/TO/MISSING/FILE
-h, --help Display the help screen with a list of options.

Note

These command line options are also described in the rhn_package_manager man page: man rhn_package_manager.
In order for Red Hat Network Package Manager to be able to serve the local packages, the following steps need to be followed:
  1. Create a private channel.
  2. Upload the local packages into the channel.
The steps will be further discussed in the next sections.

3.1.1. Creating a Private Channel

Before local packages can be provided through the Red Hat Network Proxy Server, a private channel is needed to store them. Perform the following steps to create a private channel:
  1. Log in to the Red Hat Network Web interface at https://rhn.redhat.com or to the local Red Hat Satellite server in the network.
  2. Click Channels on the top navigation bar. If the Manage Channels option is not present in the left navigation bar, ensure that this user has channel editing permissions set. Do this through the Users category accessible through the top navigation bar.
  3. In the left navigation bar, click Manage Software Channels and then the create new channel button at the top-right corner of the page.
  4. Select a parent channel and base channel architecture, then enter a name, label, summary, and description for the new private channel. The channel label must: be at least six characters long, begin with a letter, and contain only lowercase letters, digits, dashes (-), and periods(.). Also enter the URL of the channel's GPG key. Although this field is not required, it is recommended to enhance security. For instructions on generating GPG keys, see the Red Hat Network Channel Management Guide.
  5. Click Create Channel.

3.1.2. Uploading Packages

Note

You must be an Organization Administrator to upload packages to private Red Hat Network channels. The script will prompt you for your Red Hat Network username and password.
After creating the private channel, upload the package headers for the binary and source RPMs to the Red Hat Network Server and copy the packages to the Red Hat Network Proxy Broker Server. To upload the package headers for the binary RPMs, issue the following command:
 rhn_package_manager -c "label_of_private_channel" pkg-list
This command will upload the header of the package to the channel name specified, and the package itself to /var/spool/rhn-proxy/rhn.
pkg-list is the list of packages to be uploaded. Alternatively, use the -d option to specify the local directory that contains the packages to add to the channel. Ensure that the directory contains only the packages to be included and no other files. Red Hat Network Package Manager can also read the list of packages from standard input (using --stdin).
To upload the package headers for the source RPMs:
 rhn_package_manager -c "label_of_private_channel" --source pkg-list
If you have more than one channel specified (using -c or --channel), the uploaded package headers will be linked to all the channels listed.

Note

If a channel name is not specified, the packages are not added to any channel. The packages can then be added to a channel using the Red Hat Network web interface. The interface can also be used to modify existing private channels.
After uploading the packages, you can immediately check the Red Hat Network Web interface to verify their presence. Click Channels in the top navigation bar, Manage Software Channels in the left navigation bar, and then the name of the custom channel. Then click the Packages subtab. Each RPM should be listed.
Also check to see if the local directory is in sync with the Red Hat Network Server's image of the channels at the command line:
 rhn_package_manager -s -c "label_of_private_channel" 
The -s option will list all the missing packages (packages uploaded to the Red Hat Network Server not present in the local directory). You must be an Organization Administrator to use this command. The script will prompt you for your Red Hat Network username and password.
If you are using the Red Hat Network Package Manager to update local packages, you must go to the Red Hat Network website to subscribe the system to the private channel.