Chapter 6. Uploading and Maintaining Custom Packages

Depending upon which Red Hat Network service is used, there are two different mechanisms for uploading packages to private channels.
Customers of RHN Proxy Server use the RHN Package Manager application, which sends package header information to the central Red Hat Network Servers and places the package itself into the local repository of the Proxy that invoked RHN Package Manager.
Customers of RHN Satellite Server use the RHN Push application, which sends package header information to the local RHN Satellite Server and places the package into the local repository of the Satellite that invoked RHN Push.
This chapter discusses both of these tools in detail.

Warning

If you use both RHN Proxy Server and RHN Satellite Server, use only RHN Push. The Proxy-Satellite combination requires custom packages and channels be uploaded to the Satellite only. From there, the Proxy servers obtain the packages and distribute them to client systems.

6.1. Uploading Packages to RHN Proxy Server

RHN Package Manager allows an organization to serve custom packages associated with a private RHN channel through the RHN Proxy Server. If you want the RHN Proxy Server to serve only official Red Hat Enterprise Linux packages, you do not need to install RHN Package Manager.
To use the RHN Package Manager, install the rhns-proxy-package-manager RPM package and its dependencies. This package is available to registered RHN Proxy Server systems and is installed by running up2date rhns-proxy-package-manager.

Note

Only the header information for the packages is uploaded to the RHN Servers. The headers are required so that RHN can resolve package dependencies for the client systems. The actual package files (*.rpm) are stored on the RHN Proxy Server. For this reason, custom packages cannot be downloaded through the RHN website, although they are listed. They must be retrieved by the client system using up2date.

6.1.1. Configuring and Using the RHN Package Manager

Before you can use RHN Package Manager to upload packages into RHN, you need to first manually copy the packages to the Proxy server itself. For example, from a development host you can use scp:
scp foo.rpm root@rhnproxy.example.com:/tmp

When using RHN Package Manager to upload the packages into Red Hat Network, point at the files you previously copied to the server.

Note

Create at least one private channel to receive custom packages prior to upload into Red Hat Network, since a channel is required for systems to obtain the packages.
The following command uploads the package headers to the RHN Servers and copies the packages to the RHN Proxy Server repository:
rhn_package_manager -c label_of_private_channelpkg-list
The label_of_private_channel is the custom channel created to receive these packages. Be sure you use the precise channel label specified during its creation. If you have one or more channels specified (using -c or --channel), the uploaded package headers are linked to all the channels identified. If you do not specify a channel, the packages are deposited in the No Channels section of the Package Management page. Refer to Section 4.6, “Assigning Packages to Software Channels” for instructions on reassigning packages.
The pkg-list reference represents the list of packages to be uploaded. These packages must already be physically copied to the Proxy host. Alternatively, use the -d option to specify the local directory that contains the packages to be added to the channel. RHN Package Manager can also read the list of packages from standard input (using --stdin).
Other options are specified in a configuration file, such as the Red Hat Network Server URL, the HTTP proxy username and password (if your HTTP proxy requires authentication), and the top directory where packages live. This special configuration must not be edited and is located at /etc/rhn/default/rhn_proxy_package_manager.conf. You can override the choices in that default configuration file with settings in the main configuration file /etc/rhn/rhn.conf or via command line options passed to RHN Package Manager.
Parameters not set in this file are read from .rhn_package_manager in the home directory of the user currently logged in and finally from /etc/rhn/rhn_package_manager.conf. Make sure all of these files have the appropriate permissions to prevent others from reading them.
After uploading the packages, check to see if the local directory is in sync with the RHN Server's image of the channels:
rhn_package_manager -s -c name_of_private_channel
This -s option lists all the missing packages, which are packages uploaded to the RHN Server but not present in the local directory. You must be an Organization Administrator to use this option. The application prompts you for your RHN username and password.
The --copyonly option copies the file listed in the argument into the specified channel without uploading to the Satellite. This is useful when a channel on a RHN Proxy Server is missing a package and you don't want to reimport all of the packages in the channel.
rhn_package_manager -c channel-name --copyonly /path/to/missing/file
You can also use RHN Package Manager to retrieve a list of packages in a channel, as they are stored by the RHN Server:
rhn_package_manager -l -c name_of_private_channel
The -l option lists the package name, version number, release number, architecture, and channel name for each package in the specified channel(s). Refer to Table 6.1, “rhn_package_manager options” for additional options.
Table 6.1, “rhn_package_manager options” is a summary of all the command line options for RHN Package Manager (rhn_package_manager):

Table 6.1. rhn_package_manager options

Option Description
-v, --verbose Increase verbosity of standard output messages.
-d, --dir DIRECTORY_NAME Process packages from this directory.
-c, --channel CHANNEL_NAME Specify the channel to receive packages. Multiple channels may be specified using multiple instances of -c (e.g.: -c channel_one -c channel_two)
-n, --count NUMBER Process this number of headers per call — the default is 32.
-l, --list List the packages 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.
--newest Push only the packages that are newer than those on the server. Note that source packages are special in that their versions are never compared to each other. Their newness is dependent on their associated binary packages. Using this option with RHN Package Manager and just a source package does upload the package, but the source package does not appear in the RHN Web interface until the associated binary package has been uploaded. Contrast this with --source. Using --source --newest together does update the stand-alone source package with newer packages and does not require an associated binary package to be uploaded first.
--source Upload the indicated source packages. Doing this treats them as plain, stand-alone packages and not as special source packages associated with another, pre-existing binary package. For example, you can use this when you want to distribute application source to developers and testers outside of regular source control management.
--stdin Read the package names from standard input.
--nosig Don't fail if packages are unsigned.
--no-ssl Turn off SSL (not recommended).
--stdin Read the package names from standard input.
--username USERNAME Specify RHN username. If not provided, you are prompted for the username of a valid Channel Administrator.
--password PASSWORD Specify RHN password. If not provided, you are prompted for the password of a valid Channel Administrator.
--dontcopy In the post-upload step, do not copy the packages to their final location in the package tree.
--copyonly Only copy the packages, do not re-import them.
--test Only print a list of the packages to be pushed.
-?, --help Display the help screen with a list of options.
--usage Briefly describe the available options.
--copyonly Only copy packages

Note

These command line options are also described in the rhn_package_manager manual page: man rhn_package_manager.