7.12 Update from the Command Line
SUSE Linux Enterprise comes with a new command line tool for installing and updating
packages, rug. It works with the rcd daemon to install, update, and remove
software according to the commands given. It can install software from local
files or from servers. You may use one or more remote servers,
known as services. Supported services are mount for local files and yum or
ZENworks for servers.
rug sorts software from services into
catalogs (also known as channels), groups of similar software. For example,
one catalog might contain software from an update server and another some
software from a third-party software vendor. Subscribe to individual
catalogs to control the display of available packages and prevent the
accidental installation of unwanted software. Operations are normally
performed only on software from catalogs to which you are subscribed.
The most commonly used command is
rug update, which downloads and
installs patches in catalogs to which you are subscribed. If you only want
to update software, this is the only command you need. To obtain a list of
all packages from one catalog, use
rug pa catalogname. Replace
catalogname with name of your catalog. To list
all available services, use
rug sl.
Some other useful rug commands and their functions are
shown in Table 7-1.
Table 7-1 rug Commands
ca |
List the catalogs |
sa |
Add a service |
reg |
Register a service |
sub |
Subscribe to a catalog |
refresh |
Refresh the lists of patches |
7.12.1 rug User Management
One of the biggest advantages of rug is user management. Normally only root can update or install new
packages. With rug, you can distribute the right to update the system to
other users and restrict them, for example, only to the update right
without
the possibility to remove software. Privileges you can grant are:
- install
- User may install new software
- lock
- User may set package locks
- remove
- User may remove software
- subscribe
- User may change channel subscriptions
- trusted
- User is considered trusted, so may install packages
without package signatures
- upgrade
- User may update software
packages
- view
- This allows the user to see which software is installed on
the machine
and which software is in available channels. The option is relevant
only to remote
users, local users are normally permitted to view installed and
available packages.
- superuser
- Permits all rug commands except user management and settings, which must be done locally.
To give a user permission to update the system, use the command
rug ua username upgrade. Replace
username with the name of the user.
To revoke the privileges of a user, use command
rug ud username.
To list users with their rights, use
rug ul.
To change the current privileges of a user, use
rug ue username. Replace
username with name of the desired user.
The edit command is interactive. It lists privileges of the selected user
and the offers you a prompt. Enter the plus (+) or minus (-) symbol
and the name of the privilege then press Enter. For example, to permit the user to delete
software, enter +remove. To save and quit, press
Enter on a blank line.
7.12.2 Scheduling Updates
Using rug, the
system can be updated automatically, for example, with scripts. The
simplest example is the fully automatic update. To do this, as root configure a
cron job that
executes rug up -y. The
up -y option downloads and installs the patches from
your catalogs without confirmation.
However, you may not want the patches installed automatically. Instead, you
may want to
retrieve the patches and select the patches for installation at a later
time. To download
patches only, use the command rug up -dy.
The up -dy option downloads the patches from
your catalogs without confirmation and saves them to the rug cache.
The default location of the rug cache is
/var/cache/redcarpet.
7.12.3 Configuring rug
rug comes with many preferences to provide the update functionality in
different network configurations. To list the preferences that may be set,
use rug get. To
set a preference variable, enter
rug set.
For example, adjust settings if you need to update your system, but the
computer is behind a proxy server. Before downloading updates, send your
username and password to the proxy server. To do so, use the commands:
rug set proxy-url url_path
rug set proxy-username name
rug set proxy-password password
Replace url_path with the name of your proxy
server. Replace name with your username. Replace
password with your password.
7.12.4 For More Information
For more information about updating from the command line,
enter rug --help or see the
rug(1) man page.
The --help option is also available for all rug
commands. If, for example, you want to read help for
rug update, enter
rug update --help.