2.2. Running the subscription-manager Command-Line Tool

Any of the operations that can be performed through the Red Hat Subscription Manager UI can also be performed by running the subscription-manager tool. This tool has the following format:
[root@server1 ~]# subscription-manager command [options]
Each command has its own set of options that are used with it. The subscription-manager help and manpage have more information.

Table 1. Frequently-Used subscription-manager Commands

Command Description
Operational Commands
register Registers or identifies a new system to the subscription service.
unregister Unregisters a machine, which strips its subscriptions and removes the machine from the subscription service.
attach Assigns a specific subscription to the machine.
remove Removes a specific subscription or all subscriptions from the machine.
redeem Autosubscribes a machine to a pre-specified subscription that was purchased from a vendor, based on its hardware and BIOS information.
import Manually installs a subscription certificate, rather than contacting the subscription service with a request and then receiving the certificate.
list Lists all of the subscriptions that are compatible with a machine, either subscriptions that are actually consumed by the machine or unused subscriptions that are available to the machine.
Configuration Commands
config Modifies a specified configuration parameter in the Red Hat Subscription Manager configuration file, /etc/rhsm/rhsm.conf. The parameters are passed in the form configuration_area.parameter="value".
service-level Sets the service-level preference for the system to use when selecting subscriptions in autoattach operations.
release Sets the operating system release version preference for the system to use when selecting subscriptions in autoattach operations.
refresh Pulls the latest subscription data from the server. Normally, the system polls the subscription server at a set interval (4 hours by default) to check for any changes in the available subscriptions. The refresh command checks with the subscription server immediately, outside the normal interval.
clean Removes all of the subscription and identity data from the local system, without affecting the consumer information in the subscription service. Any of the subscriptions consumed by the system are still consumed and are not available for other systems to use. The clean command is useful in cases where the local subscription information is corrupted or lost somehow, and the system will be reregistered using the register --consumerid=EXISTING_ID command.
Informative Commands
version Returns the version of the local Red Hat Subscription Manager client, the name of the subscription service the system is registered with, and the version of the subscription service.
identity Handles the identity certificate and registration ID for a system. This command can be used to return the current UUID or generate a new identity certificate.
facts Lists the system information, like the release version, number of CPUs, and other architecture information.
orgs, repos, environments Lists all of the configured organizations, environments, and content repositories that are available to the given user account or system. These commands are used to view information in a multi-org infrastructure. They are not used to configure the local machine or multi-org infrastructure.