Installing openSUSE and Adding Software

Critical tools for initially installing openSUSE, and for adding and managing software later, include the rpm utility (install/manage local packages), the YaST utility (install/manage packages from online repositories), and zypper, a relatively recent command line tool for managing packages.

This chapter highlights critical issues you need to know during initial installation of openSUSE. It covers information about online software repositories for an array of software tools and shows how to set them up for different circumstances. The chapter then gives examples of commands for installing and managing software after initial installation, including the rpm, yast, and zypper commands.

Installing openSUSE

For initial installation of openSUSE, you can get an official openSUSE DVD, or set of CDs, from the openSUSE website (http://software.opensuse .org/), or a software mirror near you (http://en.opensuse.org/ Mirrors_Released_Version).

Media available for the different openSUSE releases include:

□ Basic installation — For openSUSE 10.3, there is a single DVD or a set of CDs that represent the entire distribution. You can add more packages from several online repositories to gain functionality or enhance openSUSE with great open source tools.

□ Additional software — openSUSE 10.3 has two other companion CDs you can download. One CD is a compilation of non-open source software; the second is a language pack CD for multinational support.

IN THIS CHAPTER

Installing openSUSE

Working with software repositories

Getting software packages with YaST

Managing software packages with RPM and zypper

Extracting files from RPMs

Choose the set of media that best suits your need. Then use online repositories to download and install other packages you need.

The openSUSE media are available with books that cover openSUSE, such as Linux Bible 2007 Edition (Wiley, 2007), or by downloading media from the openSUSE website (www.opensuse.org). Get media for Novell SLES/SLED from www.novell.com (select Downloads). Subscription fees may apply for Novell SLED/SLES products.

Preparing to Install

If you are going to erase everything on your computer's hard disk and install openSUSE, you don't have to make preparations for your install in advance. If you want to keep any data from your hard disk, back up that data before proceeding. To keep existing data on your hard disk and add openSUSE, you may need to resize existing disk partitions and repartition your disk. See Chapter 7 for information on disk resizing and partitioning commands.

Choosing Installation Options

All SUSE-based Linux distributions use the YaST (Yet Another Setup Tool) installer to initially install the system. This is also the name of the tool you run, after initial installation, to modify other system settings. YaST can run in text-based or GUI mode.

Start the Install Process

Begin the install process by booting from the DVD or first CD in the install set. As an alternative, if you need to boot from install floppies or a USB key, refer to the README file in the boot/i3 86/ directory of CD #1, or visit the "Installation without CD" section on the openSUSE website (http://en.opensuse.org/Installation_without_CD). Choose one of the following methods to begin the installation process:

□ CD or DVD — Insert the DVD or first CD in the set and reboot the computer. You can also boot right from the hard disk if you've accidentally left the CD in after rebooting.

□ Minimal CD boot image — Locate the appropriate mini.iso (for example SUSE-Linux-10.1-Remastered-i386-mini.iso) image from the iso directory of the openSUSE download mirrors (ftp://mirror.colorado.edu/pub/opensuse/ distribution/SL-10.1/iso/). Burn mini.iso to a CD. This CD lets you start the install from the CD, but continue from some other medium (such as an online software repository) after starting. This is useful when you're doing a quick installation and don't have the full media with you.

□ USB flash drive — Review the instructions at http://en.opensuse.org/ Installation_without_CD and http://en.opensuse.org/SuSE_install_ from_USB_drive to ensure you get a proper installation.

Choose an Installation Method

Each of the methods just described should result in an openSUSE installer boot screen appearing. Here are your choices on how to proceed from the boot screen:

□ Graphical install — With a CD or DVD graphical install, use the down arrow keys to move to the Installation item. You can use function keys to modify the installation: press F2 to change the language, F3 to change the video mode, F5 to change some kernel options, or F6 to install a special driver needed for your hardware. Press F4 to change where you get the software packages used for installation from the CD/DVD to another location. Your choices are either hard disk or an online repository (available via FTP, HTTP, NFS, or SMB/CIFS protocols).

NOTE For information on available install methods see the openSUSE website under the Installation section (http://en.opensuse.org/Installation). Special vnc and ssh install options, are available from the boot prompt, as described later.

If you don't need any additional boot options, press Enter to continue with a graphical install from the selected media. You can skip from here right to the "Answering Installation Questions" section.

□ Boot prompt install — To have the install proceed from a simple boot prompt, press the Esc key from the boot screen and select OK from the pop-up that appears. Once at the boot prompt, you can add boot options to do special things, such as installing using ssh or vnc. Continue to the next section for information on boot options.

If you choose to bypass the menu on the boot screen and start your install from a simple boot prompt, there are a lot of options you can enter to direct how installation proceeds. Here are examples of some handy install types you can request from the boot prompt after pressing the Esc key:

WARNING! Note that the vnc=1 method may pass your install information over the network in clear text, such as the root password. You may want to consider using the ssh option whenever possible.

If you run the install in text mode (if your graphical screens are garbled), you will be working in the YaST text mode tool. If you run a VNC install, using the vnc=1 parameter, you can step through the graphical section of the install remotely by connecting a VNC client to the IP of the install machine. The installer will show the IP address to connect to when it starts the VNC server. If you want to run an SSH install, the ssh=1 parameter will launch an SSH server on the installer, which you can connect to using the ssh -X parameter. The installer will show you the SSH connection instructions on the screen.

Add Boot Prompt Options boot: linux boot: linux ssh=1 boot: linux vnc=1

start the install normally installer starts ssh server installer starts a vnc server

You also have the choice of going into modes other than installation mode. For example:

boot: linux rescue boot rescue mode (log in as root)

boot: memtest starts the Memtest86+ program

The rescue option starts a mini-Linux system in rescue mode, so you can mount file systems and fix problems from the command line. The memtest option will start up the Memtest86+ program (www.memtest.org/) to test your system memory for errors.

NOTE If you are familiar with the Red Hat Linux kickstart utility, openSUSE offers the AutoYaST tool that can be used in a similar way. To learn more about AutoYaST, refer to the openSUSE website (http://en.opensuse.org/YaST_ Autoinstallation).

Most boot options you add to existing install types are meant to help work around problems that might occur during installation. In particular, you might need to disable certain hardware components or features that aren't properly configured and enabled during installation (notice the Install menu offers some APIC options). From the boot prompt, type linux, followed by one or more of the boot options shown in Table 2-1, to deal with common problems.

NOTE To find out more about these and other boot options, visit the Linux BootPrompt-HowTo (www.faqs.org/docs/Linux-HOWTO/BootPrompt-HOWTO.html) and the Linux kernel-parameters.txt file which can be found online or in the kernel source tree under Documentation/kernel-parameters.txt.

Table 2-1: Boot Options When Installing openSUSE

Problem

Description

Boot Options to Try

Failures reading CD/DVD drive.

Some CD/DVD drives don't properly support DMA or some power management features.

ide=nodma nodma acpi=off all-generic-ide irqpoll

Hardware improperly probed.

Tell the boot process to not probe hardware.

noprobe

System hangs trying to enable some hardware.

Disable hardware or service that is causing the system to hang.

nousb nopcmcia nofirewire noapic nolapic pci=nomsi

Your computer has a serial console, but no regular monitor.

You can run the install in text mode from the serial terminal. Use tty0 for the first virtual console, or ttyS0 for the first serial port.

console=/dev/tty0

Table 2-1: Boot Options When Installing openSUSE (continued)

Problem

Description

Boot Options to Try

Video is garbled or

Try to set the resolution

vga=7 88

hangs.

yourself or skip monitor

vga=ask

probing.

See the vesafb.txt file in the

kernel documentation for other

video modes.

RAM is improperly detected.

Tell the kernel how much RAM to use.

mem=2 56M

Answering Installation Questions

Most of the screens you see during installation are quite intuitive. Table 2-2 offers a quick review of those screens, along with tips where you might need some help.

Table 2-2: openSUSE Installation Screens

Screen

Description

Tips

Language

Choose the install language.

If you need support for additional languages, add them later. You may not see this option until later, depending on which DVD or CD you install from.

Media Check

Check each CD/DVD image against an md5sum implanted on that image.

On occasion, a media check will fail with good media on a drive that doesn't support DMA. If the check fails, start the installer with ide= nodma and check again. If the media passes, you can continue.

License Agreement

Novell software agreement.

You must accept the license to install the openSUSE operating system.

Installation Mode

Update or install mode.

Update an existing openSUSE installation, or install a new one. You can also specify whether to use online repositories for SUSE packages. You will also need to configure a network connection.

Continued

Table 2-2: openSUSE Installation Screens (continued)

Screen

Description

Tips

Clock and Time Zone

Configure the time.

Set the date and time zone for your system. Note that the default for the clock setting is Universal Coordinated Time. Usually this is a server feature.

Desktop Selection

What type of desktop to run.

Choose the GNOME or KDE desktop to install to the system. Other options may include text mode only or a minimal X Window server for light resources. Note that if you are installing from a SUSE GNOME or KDE disk, your choice is already made.

Installation Settings

Review install options.

Change any install options, such as partitioning, here and review prior to continuing.

Package Installation

Begin the installation.

The system is now being initialized and installed with the settings chosen.

Password for the System Administrator

Set the password for the root user.

Make it difficult to guess. Don't share it.

Hostname and Domain Name

Set the host and domain.

Select a hostname for the system and optionally a domain name. You can also have openSUSE obtain its domain name from DHCP to take care of problems with dynamic DNS.

Network Configuration

Set up networking options.

Set up options for the network, the openSUSE firewall, and others like VNC administration and proxy servers.

Test Internet Connection

Test if the Internet connection is activated.

Here you can test if your network connection was set up successfully and optionally download all the latest updates.

Table 2-2: openSUSE Installation Screens (continued)

Screen

Description

Customer Center Configuration

Register with Novell

Send Novell your system information and register contract information if you've purchased any contracts.

Additional Installation Sources

Configure software add-ons.

Configure extra software repositories, possibly containing software packages that cannot be distributed with the openSUSE distribution.

User

Authentication Method

Set up how user passwords and logins are checked.

Choose between local, LDAP, NIS, and Windows Domain authentication.

(Authentication setup)

Various screens for filling in authentication information.

The screens you see here will depend on how you answered the previous question. You will need LDAP, NIS, WindBind, or Local user credential info to fill in.

Writing the System Configuration

Applying settings to the system.

YaST will generate linker cache, and apply other settings you've chosen, to finalize the install.

Release Notes

Notes about this version.

Last minute details about openSUSE are presented.

Hardware Configuration

Set up system hardware.

YaST sets up hardware devices such as video cards, sound cards, and printers.

Installation Complete

Installation has finished.

YaST has finished installing the system. You have an option to clone all settings used for this install, to use with AutoYaST.

NOTE When setting up partitioning, YaST defaults to create a single large root partition and a swap partition. This simple partitioning scheme is sufficient for most users. However, it has been considered good practice to locate some of the dynamic directories such as /var, /home, /tmp, and possibly /usr on separate file systems. One reason for this is that message logs writing to the /var directory can fill up the root partition, possibly preventing you from logging in. The / tmp and /home directories are usually separated for the same reasons (on multiuser systems especially). If these directories are located on separate partitions, the problems are contained on file systems other than the one root needs to use to log in and fix things. With /home on a separate partition, you also have the added benefit of leaving it unharmed when you want to reinstall Linux. If /home is part of the / partition, it will be erased.

If errors occur in installation, press Ctrl+Alt+Fl through F8 to get to virtual terminals containing useful information. Ctrl+Alt+F2 takes you to a console prompt; Ctrl+Alt+F3 displays the installation dialog box; Ctrl+Alt+F4 displays the message logs; Ctrl+Alt+F5 and F6 are console prompts; Ctrl+Alt+F7 is the YaST installer; and Ctrl+Alt+F8 displays messages sent from the X server.

Working with Software Packages

Software delivered particularly for SUSE systems is packaged in what are called RPM packages. An RPM package (.rpm extension) contains not only the software you want to install, as a compressed archive, but it can also hold lots of information about the contents of the package. That information can include software descriptions, dependencies, computer architecture, vendor, size, licensing, and other information. RPMs may include installation scripts.

Once a basic openSUSE system is installed, you can add, remove, and otherwise manage openSUSE packages to suit how you use that system. OpenSUSE and SLED/SLES use RPM Package Manager (RPM) to create and manage software for those systems. This packaging tool is also used on other Linux systems, including Fedora, Red Hat Enterprise Linux, and Mandriva.

A grand plethora of software management tools are available for your openSUSE/ SLED/SLES Linux system, including RPM, YaST, smart, APT, yum, zypper, and ZENworks, to name just a few. Historically, SUSE Linux systems have relied on YaST and RPM to get the package management job done. This chapter covers three package management utilities to give you resources for software management in SUSE Linux:

□ YaST — Use YaST, a text-based interface (YaST also provides a graphical interface), to download and install packages from online repositories. The yast command is preferred over rpm for installing packages in most cases because yast will get dependent packages needed by those packages you request to install. Also, by getting packages from official repositories, you are most likely to get the latest available packages.

□ Zypper — The zypper command provides an easy command-line tool for managing packages. Use zypper to add repositories (Software Catalogs in YaST) as well as search for and display information about available software packages, patches, and updates. As with YaST, zypper will automatically resolve software package dependencies, so you do not have to hunt around for every package needed to install a single piece of software. Note, however, that Novell does not recommend mixing zypper with an environment managed by Novell ZENworks, since zypper does not use the ZENworks zmd database. For more information on Zypper integration, visit the openSUSE web site (http://en.opensuse.org/Zypper/ Usage#About).

□ RPM — Use the rpm command to install RPM packages available from your local system (hard disk or CD/DVD) and otherwise manage installed packages (remove, query, and so on). There is some functionality built in to RPM to download and install individual packages from FTP and web servers, however this is mostly for convenience in contrast to downloading and installing the package in two steps. Related local commands and options are available for verifying software packages and repairing your local RPM database, if problems should occur.

Some software packages that work with openSUSE, but may not be included on CDs, DVDs, or in SUSE repositories for legal or other reasons, are available from third-party software repositories. The following sections deal with using software from repositories located around the world. Because there may be very different laws and regulations in some countries, you should check your local laws to determine the legal implications of using packages from third-party repositories.

Getting Software Packages with YaST

The standard SUSE Linux administration utility is the YaST Control Center. YaST has both a text-based flavor and a graphical version. The menu selections are the same in either utility. If you are running a server, or low-resource installation, you will most likely encounter the command line text interface more frequently than the GUI. It is common for administrators to leave out the graphical libraries and desktop features when striving for an environment with a minimal maintenance and software footprint. This leaves a lean system with a minimized potential for software problems.

To start the YaST Control Center simply type yast (using sudo or as root) at the command line. A blue-themed interface will appear, showing two menus. You can toggle focus to the menus by pressing Tab, and then use the arrow keys to navigate the highlighted selection bar over the menu items. When you have your selection highlighted, press Enter to proceed with that selection. You can also use the F1 key to bring up some information on navigating the YaST text interface.

The menu list on the left is a group of administrative areas and modules of the YaST environment. Table 2-3 describes the YaST modules available for configuration.

Table 2-3: YaST Control Center

Configuration Item

Description

Software

Manage packages, updates, installation sources, and install patch CDs.

Hardware

Configure video and sound cards, printers, hard disks, and all hardware connected to the system.

Continued

Continued

Table 2-3: YaST Control Center (continued)

Configuration Item

Description

System

Set up kernel tuning, configure the boot loader, manage disk partitions, add system services, and other settings.

Network Devices

Handle network and modem setup, as well as IP address configuration (with DHCP or static addresses).

Network Services

Client and server network service configuration for setting up NFS, LDAP, DNS, Samba, and other services.

Novell AppArmor

Configure access control for software applications to minimize or eliminate threats caused by software vulnerabilities.

Security and Users

Set up your firewall, users, groups, and sudo configurations.

Miscellaneous

View system logs, browse through release notes, configure AutoYaST, or post a support query.

The next section focuses on the Software area of YaST for managing system software.

The next section focuses on the Software area of YaST for managing system software.

Adding and Updating Software with YaST

The Software area of YaST lists several items for maintaining software on your SUSE Linux system. These items fall under two basic categories: working with software from online servers and working with software from local directories, CD-ROM, or other disks on your system. You can also verify Installation and Patch CDs from this area. The following sections describe the available menu items.

NOTE You can use some shortcuts to get to different YaST modules. Entering yast -l will show a list of modules you can enter at the command line without navigating the YaST dialog menus. For instance, entering yast sudo at the command line takes you right to the YaST Sudo Configuration module.

Online Update

When you select Online Update, YaST automatically begins synchronizing your system with the latest list of patches available from the Novell update sources. You are then taken to a patch list and summary view where you can select which patches you want to install or apply to your existing system.

Once you are in the patch module, patches can be segregated into different groups by tabbing to the Filter item at the top left corner and pressing Enter to activate the pulldown menu. Select whether you want to view patches grouped into categories such as New, Recommended, or Security related. You can also select the Search item from the pull-down menu to search for a specific patch.

Software Management

The Software Management module is the primary YaST module for adding, removing, searching, and getting information about software packages. From this module you can quickly search for packages and view descriptions from a summary list about which packages offer which functionality.

Page or arrow through the software packages, then select Actions to add or delete packages as you choose. Dependencies for each package are automatically resolved upon selection. When you have made all your selections, Tab to the Accept item in the lower right corner and press Enter.

Much like the Online Update module, a filter is available to limit the software summary view by different criteria such as functionality groups (Office or Game software for instance), or only installed packages. To search for packages, use the Filter menu and select Search. For example, if you enter the word magick, the filter will return all the packages it knows about which have the word magick in them (such as the ImageMagick graphics conversion utility).

Once a list of packages is displayed, you can act on the list of packages by selecting the Actions item, then the All Listed Packages menu. From there, you can choose to install all packages, delete them, or update them. Packages to be installed or deleted are tagged in the summary window with a + (install) or - (delete) status flag, respectively. Selecting Accept and pressing Enter completes the tasks. Table 2-4 shows other status flags you may select from the Actions menu.

Table 2-4: YaST Control Center Status Flags

Status Flag

Description

+

The package on this line will be added to the system.

a+

This package was automatically selected by YaST to be added (dependency).

>

This package has been selected for update (already installed).

a>

This package is selected for automatic updating.

i

The package is already installed.

- The package will be removed from the system.

— Three dashes show this package should never be installed (taboo).

-i-

The package should never be updated or deleted. Keep the installed version indefinitely.

Add-On Product

The Add-On Product module is used for installing drivers or applications available from product vendors or third parties. From the Add-On Product module, you can select several different media types to install from, including FTP, HTTPS protocols, and CD or DVD. The SLP (Service Location Protocol) method, used by devices such as a YOU server to announce itself on the network, is also available.

Automatic Online Update

The Automatic Online Update module enables you to configure when your SUSE system obtains automatic updates. You can set the time and day to download and apply the updates. Daily and Weekly update intervals are available, as well as the ability to skip patches which may require administrative input (such as accepting a license agreement prior to installation).

Community Repositories

You can configure where your SUSE system obtains software from using the Community Repositories module. By default, OSS and NON-OSS are the only repositories enabled. You can enable the main update repository here as well as the popular Packman repository and many others (scroll through the list to see more). The Videolan repository is for the VLC media player, which plays a wide variety of media formats, including DVD media. Other repositories that you might add at a later date include the NVIDIA repository with drivers for NVIDIA graphics cards, and the openSUSE BuildService repository.

Installation into Directory

The Installation into Directory module enables you to install additional SUSE Linux file systems into a directory or create a tar file out of a file system. Using this method, you could use an offline file system as a test bed, or as an exported file system for a thin client or embedded device that could download its file system over NFS at boot time.

Media Check

If you have downloaded an ISO image and burned it to a disk, or if you want to check the readability of any of your DVD or CD-ROM media, you can do a read-test of that media using this YaST module.

Online Update Configuration

This YaST module enables you to configure support options and product updates from Novell. (Note that Novell registration now requires you to use a web browser to complete the process, so you will not be able to do this from within the curses-based YaST tool.)

Patch CD Update

If you have a Novell Patch CD (or a custom-made one), you can use this YaST module to install the patches from that disk. You can also make your own Patch CD to distribute among multiple machines, and use YaST to apply your own patches. For more information on creating your own Patch CD, visit the openSUSE website (http://en .opensuse.org/SDB:How_To_Create_a_Patch_CD).

Software Repositories

You can add other repositories quite easily with YaST. The openSUSE web site (http://en .opensuse.org/YaST_package_repository) offers links to several repositories you may find useful. If you wanted to add Guru's RPM site you could do so like this:

1. Select the Software Repositories module from the YaST Control Center main menu and press Enter.

2. On the Configured Software Repositories screen, select the Add menu item at the bottom and press Enter.

3. The Media Type screen appears. Select HTTP and press Enter. You can optionally configure YaST to download the repository descriptions when setting up the repository now, or it will do so later when you use the repository for the first time. Uncheck Download repository description files if you do not want to do the download at this time. Select Next and press Enter.

4. The next screen shows the Server and Directory menu. In the Repository Name, enter Guru's RPM site. For Protocol, select HTTP and then enter ftp.gwdg.de for the Server Name. Under Directory on Server, enter /pub/linux/misc/suser-guru/rpm/10.3/RPMS/ and leave the Port field empty. For Authentication, you can leave Anonymous checked. Select Next and press Enter. You will be returned to the Configured Software Repositories menu where you should now see Guru's RPM site enabled and ready for business.

5. Select Finish and press Enter. You should be prompted to accept the digital signing key for the repository you just entered. There is a warning given here that states There is no trust relationship to the owner of the key, and further down says it is safest to skip it.

It is generally good practice to import keys to validate any software you install. However, the YaST developers suggest it is "safest to skip" importing a key if you have reason to question its authenticity. You will have to decide where your comfort level is. To learn about other ways to verify RPM GPG keys, visit the GNU GPG home page at www.gnupg.org/.

Using zypper to Manage Software

Historically, SUSE Linux distributions relied, by default, on the RPM and YaST utilities for managing software. Much of this picture has been changing starting with the 10.1 version of openSUSE. Utilities implementing Libzypp have emerged, with a utility called zypper being the focus for much of the command line package management needs.

The zypper utility is designed to be compatible with the Novell Rug (Red Carpet updater) and ZENworks software management systems, but does not require the ZLM daemon to be running in order to operate. Furthermore, zypper does not use the ZENworks zmd database, so Novell recommends you not use zypper with ZEN-works. This leaves a lighter footprint on system resources as well as fewer requirements for managing your software.

Zypper can be used to search for, install, remove, and update software packages as well as manage installation sources called repositories. Zypper offers a powerful way of managing software, much the same as APT for Debian and the Yum utility found on Fedora and Red Hat Linux systems. What follows are some useful ways of managing software on openSUSE using the zypper utility.

Working with zypper Repositories

When you define a repository, zypper holds a configuration that tells zypper where to find software to work with. If you have configured software locations in YaST, zypper will use them as well as other installation sources you may have configured through aptRPM, local file sources, and most ZENworks management systems. You can use zypper to list, add, rename and delete repositories. Table 2-5 shows the commands needed for managing zypper repositories, along with shortcut abbreviations for the commands. Also, keep in mind that command line help can be obtained by typing zypper -h at the command line.

Table 2-5: Managing zypper Repositories

zypper Command

Abbreviation

Description

addrepo

ar

Adds a new repository. You will need to provide a URI for the install source as well as a name for it.

removerepo

rr

Removes a repository.

repos

rr

Lists all known repositories and shows information about the repository such as its name and whether it's enabled or not.

renamerepo

nr

Renames the alias of a repository. The source repository has to be referred to by its alias. Remember to use quotes if you have whitespace or special shell characters in the alias.

modifyrepo

mr

Modifies whether the repository is automatically refreshed or not, and whether it is enabled or not.

refresh

ref

Re-downloads metadata for all known services or specific alias if given.

In the YaST section earlier, we added a repository from ftp.gwdg.de. We can demonstrate adding a Zypper repository using this same install location. First we'll remove the install location and then add, refresh, modify, and rename it.

The following example tells zypper to show all the repositories it knows about as well as the status of those repositories (in all example output, fields too long to display have been edited to fit the page width).

# zypper lr

# | Enabled | Refresh | Type | Alias | Name

# zypper lr

# | Enabled | Refresh | Type | Alias | Name

1

Yes

| No

| yast2

openSUSE-10.3-...

| openSUSE-10.3-

2

Yes

| Yes

| rpm-md

madwifi

| madwifi

3

Yes

| Yes

| rpm-md

Guru's RPM site

| Guru's RPM si.

4

Yes

| Yes

| yast2 |

http://downloa...

| Main Repositor

5

Yes

| Yes

| rpm-md |

openSUSE-10.3-...

| openSUSE-10.3-

6

Yes

| No

| yast2 |

testcdrom

| testcdrom

7

Yes

| Yes

| yast2 |

http://downloa...

| Main Repositor

Zypper shows the repositories we had configured in YaST (your list may look a bit different). The following command will remove the repository named Guru's RPM site:

# zypper rr "Guru's RPM site"

# Removing repository 'Guru's_RPM_site' Repository Guru's RPM site 1 has been removed.

To add this location using zypper and give it the alias name Guru's RPM site, issue the zypper command as follows (you must use quotes around the service name as it contains whitespace and a single quote):

# zypper ar http://ftp.gwdg.de/pub/linux/misc/suser-guru/rpm/10.3/RPMS/ \ "Guru's RPM site"

# Adding repository 'Guru's RPM site' Repository 'Guru's RPM site' successfully added: Enabled: Yes

Autorefresh: Yes

URL: http://ftp.gwdg.de/pub/linux/misc/suser-guru/rpm/10.3/RPMS/

Zypper will configure the new repository for use. After zypper is done, you can see it has added the new repository by issuing zypper lr as before. If you decide at a later date to rename the Guru's site to something different, you can use the zypper command like this to do so:

# zypper nr "Guru's RPM site" ftp.gwdg.de

Repository Guru's RPM site renamed to ftp.gwdg.de

# zypper lr

# | Enabled | Refresh | Type | Alias | Name

1 | Yes | No | yast2 | openSUSE-10.3-... | openSUSE-10.3-

2 | Yes | Yes | rpm-md | madwifi | madwifi

3 | Yes | Yes | rpm-md | ftp.gwdg.de | ftp.gwdg.de

You can use the mr command to modify the Refresh or Enabled repository attributes. Turning off the Refresh attribute will mean you have to refresh this repository manually; zypper will not do it automatically. You may want to disable repositories that you've added that deal with development software so you aren't automatically retrieving software from places that may be unstable. Here's an example of disabling a repository:

# zypper mr -d "ftp.gwdg.de"

Repository ftp.gwdg.de has been sucessfully modified. You can see the ftp.gwdg.de repository as disabled now:

# zypper lr

# | Enabled | Refresh | Type | Alias | Name

1 | Yes | No | yast2 | openSUSE-10.3-... | openSUSE-10.3-...

2 | Yes | Yes | rpm-md | madwifi | madwifi

3 | No | Yes | rpm-md | ftp.gwdg.de | ftp.gwdg.de

Likewise, the following command turns off the Refresh of the ftp.gwdg.de repository:

# zypper mr --disable-autorefresh "ftp.gwdg.de"

Repository ftp.gwdg.de has been sucessfully modified.

If you refresh all the repositories now, you can see ftp.gwdg.de is left alone:

# zypper ref

Repository 'openSUSE-10.3-DVD 10.3' is up to date. Repository 'madwifi' is up to date.

Repository 'Main Repository (NON-OSS)' is up to date. Repository 'openSUSE-10.3-Updates' is up to date. Repository 'testcdrom' is up to date. Repository 'Main Repository (OSS)' is up to date.

All repositories have been refreshed. Note that the first repository is a DVD. You need to have the DVD mounted to refresh from that repository. You can use the -e flag, just as the -d flag was used, to re-enable the ftp.gwdg.de repository. The -a flag, used the same way, will re-enable automatic-refresh.

# zypper mr -a ftp.gwdg.de

Repository ftp.gwdg.de has been sucessfully modified.

# zypper mr -e ftp.gwdg.de

Repository ftp.gwdg.de has been sucessfully modified.

In the course of adding repositories, you may get prompted to accept a Package Signing Key.

Do you want to trust key id A84EDAE8 9C8 00ACA SuSE Package Signing Key <[email protected]> fingerprint:7 9C179B2E1C82 0C189 0F99 94A84EDAE8 9C80 0ACA ? [y/n]:

This is a method of digitally verifying the authenticity of packages you download from various installation sources. There is a potential for malicious software to be introduced into your system through the use of third-party sources, which may be difficult to verify. The signing key is a way for your system to verify that the software came from where it says it came from. There is no 100 percent surefire way to absolutely guarantee that the key you are about to accept hasn't been inserted into your network session somewhere in the middle of your network connection. The odds may be slim, but nonetheless there is some risk because the Internet is a public network.

NOTE For more information on GPG and digitally signed packages, visit the GnuPG web site (www.gnupg.org) or have a look at the Security and Authentication with Digital Signatures article on the Linux Journal web site (www.linuxjournal.com/article/2304).

For more information about adding zypper services to openSUSE, visit the opensuse-community.org web site (http://opensuse-community.org/Package_ Sources).

Searching for Software with zypper

The zypper utility has a very feature-rich search utility built in that allows you to quickly and efficiently search through all, or certain, repositories for packages. Having the search utility right at your fingertips adds to making software maintenance very easy. Table 2-6 shows some of the most useful search commands for zypper.

Table 2-6: Useful zypper Search Commands

Command

Abbreviation

Description

search

se

Use with a search pattern to narrow the search query or without to see all available packages. Use -t to specify a resolvable to limit searching to.

patches

pch

Search for and display all known patches.

patch-info

Include the patch name in the command to display full information about that patch.

Continued

Table 2-6: Useful zypper Search Commands (continued)

Command

Abbreviation

Description

info

if

Include the package name to show full information

about that package.

list-updates

lu

List all available updates.

The following example shows how to add a repository and search for packages and patches using the zypper command. In this example, we'll tackle software drivers for wireless networking cards, because you often require extra repositories to find drivers for wireless cards, and because the drivers get patched frequently. If your system sports a wireless card, you'll often want to install driver packages for your card, or download patches to update those drivers.

The Madwifi (http://madwifi.org/) project provides a SUSE repository of packages for the popular Atheros chipset, a chipset used in wireless networking cards from many vendors. For installing wireless networking kernel drivers, having a repository custom tailored for your SUSE system can be very handy.

Start by adding the Madwifi install location using the zypper command in the same way as the previous example. Make sure you are adding the correct install location for the version of openSUSE you are running. Because we are using openSUSE 10.3 for this chapter, we'll add the 10.3 install location (change this for your version if necessary) and name the repository madwifi.

# zypper ar http://madwifi.org/suse/10.3/ madwifi

You can now use the zypper command to perform a case-insensitive search of anything you want. You can see in the results that the search returned case-insensitive results for the original term.

# zypper se wIFi

* Reading installed packages [100%]

S | Repository

Type

Name

Version

| Arch testcdrom

madwifi package package package iwlwifi-kmp-x...

madwifi madwifi

If you search for something more generic, you'll see that zypper searches across all enabled repositories, and reports back with the packages and repositories where the search query was found:

# zypper se util

* Reading installed packages [100%]

# zypper se util

* Reading installed packages [100%]

S

| Repository

| Type

| Name

| Version

| Arch

v

| openSUSE-10.3.

.| package

| alsa-utils

| 1.0.14-25

| i58 6

i

| http://downlo.

.| package

| alsa-utils

| 1.0.14-27

| i58 6

v

| testcdrom

| package

| alsa-utils

| 1.0.14-25

| i58 6

| openSUSE-10.3.

.| package

| apache2-utils.

.| 2.2.4-66

| i58 6

| http://downlo.

.| package

| apache2-utils.

.| 2.2.4-70

| i58 6

In the first column of the output is the package Status. A v or i in this column indicates that another version of the package is installed, or the package, as listed, is already installed. The second column shows in which Zypper repository the search word was found. The Type describes the type of resolvable the line refers to. Name and Version are obvious, and Arch lists whether this package is compiled for a specific system architecture.

Zypper uses something called resolvables to designate the different types of resources you want it to work with. A resolvable can be a package, patch, pattern, language, or product. You can select the different types of resolvables using the -t flag along with the resolvable you want to act on:

# zypper se -t patch

S | Repository | Type | Name | Version | Arch

| openSUSE-10.3...| patch | fetchmsttfont...| 4347-0 | noarch i | | patch | update-test-a...| 2609-0 | noarch

To limit the patch search to a specific piece of software, you could add a search pattern to the zypper command:

# zypper se -t patch msttfont

* Reading installed packages [100%]

S | Repository | Type | Name | Version | Arch

| openSUSE-10.3-Updates...| patch | fetchmsttfonts.sh | 4347-0 | noarch

To search the language resolvables, use the -t language command to show just language resolvables instead of packages. To look for the Estonian language packs, for example, you would use a zypper command such as:

* zypper se -t language et

* Reading installed packages [100%]

S | Repository | Type | Name | Version | Arch i | | language | et | | noarch

You can also use the zypper command to list available software patches by way of the pch command:

* zypper pch

* Reading repository 'openSUSE-10.3-DVD 10.3' cache

* Reading repository 'madwifi' cache

* Reading repository 'ftp.gwdg.de' cache

* Reading repository 'Main Repository (NON-OSS)' cache

* Reading repository 'openSUSE-10.3-Updates' cache

* Reading repository 'testcdrom' cache

* Reading repository 'Main Repository (OSS)' cache

* Reading installed packages [100%]

Repository: | Name | Version | Category | Status openSUSE-10 | fetchmsttfonts.sh | 4347-0 | optional | Not Needed

To view more information about the fetchmsttfonts.sh patch, you can issue the patch-info command to zypper along with the field from the Name column. It must match the Name column exactly:

* zypper patch-info fetchmsttfonts.sh

* Reading repository 'openSUSE-10.3-DVD 10.3' cache

Name: fetchmsttfonts.sh Version: 4347-0 Arch: noarch Status: Not Needed Category: optional

Created On: Fri 21 Aug 1970 02:15:19 AM CDT

You can also view similar information about a package (rather than a patch) by issuing the info command with zypper:

* zypper info alsa-utils

Information for package alsa-utils:

Repository: Main Repository (OSS)

Name: alsa-utils

Version: 1.0.14-27

Arch: i58 6

Installed: Yes

Status: up-to-date

Installed Size: 1.6 M

Summary: Advanced Linux Sound Architecture Utilities

Description:

<p>This package contains utility programs supporting ALSA, Advanced Linux Sound Architecture. </p>

You can also use the zypper command to list all available updates it knows about:

* zypper lu

* Reading repository 'openSUSE-10.3-DVD 10.3' cache

* Reading repository 'madwifi' cache

* Reading repository 'Guru's RPM site' cache

* Reading repository 'Main Repository (NON-OSS)' cache

* Reading repository 'openSUSE-10.3-Updates' cache

* Reading repository 'testcdrom' cache

* Reading repository 'Main Repository (OSS)' cache

* Reading installed packages [100%]

No updates found.

Installing and Removing Software with zypper

To install and remove software with zypper, you need only give the install (in) or remove (rm) command along with the package name. In the following example, zypper looks for information on the zoo archiving utility and finds it is in the Main Repository (OSS).

* zypper info zoo

Information for package zoo:

Repository: Main Repository (OSS) Name: zoo Version: 2.10-938

To install the zoo package, you only need to give the install or in command:

# zypper install zoo

* Reading repository 'openSUSE-10.3-DVD 10.3' cache

* Reading repository 'madwifi' cache

* Reading repository 'ftp.gwdg.de' cache

* Reading repository 'Main Repository (NON-OSS)' cache

* Reading repository 'openSUSE-10.3-Updates' cache

* Reading repository 'testcdrom' cache

* Reading repository 'Main Repository (OSS)' cache

* Reading installed packages [100%]

The following NEW package is going to be installed: zoo

Overall download size: 62.9 K. After the operation, additional 108.2 K will be used.

The Main Repository (OSS) alias is a URL (which you might rename to something a little less unwieldy). To install zoo from a different repository, specify this with the -r flag:

* zypper install -r testcdrom zoo

* Reading repository 'testcdrom' cache

* Reading installed packages [100%]

The following NEW package is going to be installed:

Overall download size: 62.9 K. After the operation, additional 108.2 K will be used.

To remove the zoo package, use the remove or rm command with zypper:

* zypper remove zoo

* Reading installed packages [100%]

The following package is going to be REMOVED:

After the operation, 108.2 K will be freed. Continue? [yes/no]: y

To install an available patch that was returned from the zypper pch operation, zypper could be implemented this way:

* zypper install -t patch fetchmsttfonts.sh

The following NEW patch is going to be installed: fetchmsttfonts.sh

The following NEW script is going to be installed: fetchmsttfonts.sh-43 47-patch-fetchmsttfonts.sh-2

After the operation, 0.0 B will be freed. Continue? [yes/no]:

You can also use zypper to perform a complete update of your openSUSE system. With the update (up) command, zypper will collect the updated packages and patches it knows about and give you the option of applying them to your system:

* zypper update

* Reading repository 'openSUSE-10.3-DVD 10.3' cache

* Reading repository 'madwifi' cache

* Reading repository 'ftp.gwdg.de' cache

* Reading repository 'Main Repository (NON-OSS)' cache

* Reading repository 'openSUSE-10.3-Updates' cache

* Reading repository 'testcdrom' cache

* Reading repository 'Main Repository (OSS)' cache

* Reading installed packages [100%]

Nothing to do.

By using the shell command, you can work with zypper using a shell interface. This negates the need to include the zypper command every time you run a command. Once in the shell, just enter the commands you would normally use on the command line. Use the quit or exit command to exit the shell:

# zypper shell zypper> lr

# zypper shell zypper> lr

Name

1

Yes

| No

| yast2

openSUSE-10.3-..

| openSUSE-10.3-..

2

Yes

| Yes

| rpm-md

madwifi

| madwifi

3

Yes

| Yes

| rpm-md

ftp.gwdg.de

| ftp.gwdg.de

4

Yes

| Yes

| yast2 |

http://downloa..

| Main Repositor..

5

Yes

| Yes

| rpm-md |

openSUSE-10.3-..

| openSUSE-10.3-..

6

Yes

| No

| yast2 |

testcdrom

| testcdrom

7

Yes

| Yes

| yast2 |

http://downloa..

| Main Repositor..

NOTE To find out more about using the zypper command, visit the openSUSE web site under the Zypper Usage section (http://en.opensuse.org/Zypper/ Usage).

Managing Software with RPM

Although Zypper has some very handy features for installing RPM packages from online repositories, RPM has some extraordinary options for querying RPMs and verifying installed RPMs. It is also a useful tool for installing, removing, and validating RPMs that are available on your computer.

Using the rpm command, any user can query the local RPM database. To use the command to install or remove software from your system, you must have root privileges.

Installing a Package with rpm

The following example uses wget to download the rar package, a compression and packaging utility. The example then installs the rpm package located in the current directory.

Options in the rpm command include -U for update or install, -v for verbose, and -h to show progress hash marks.

NOTE The -i option of rpm can also be used to install a package. However, most people use the -U option because it causes the package you are installing to replace an earlier, existing package of the same name if one exists. You can use the -i option, however, if you want multiple instances of the same package to exist on the system. Having multiple kernel packages is an example of this.

http://packman.iu-bremen.de/suse/10.3/i586/rar-3.7.1-0.pm.0.i586.rpm

Preparing... ##################################### [100%]

1:rar ##################################### [100%]

Using the rar package as an example, the following command installs the package directly from the Internet. This approach works with http and ftp protocols.

http://packman.iu-bremen.de/suse/10.3/i586/rar-3.7.1-0.pm.0.i586.rpm

Retrieving http://packman.iu-bremen.de/suse/10.3/i586/rar-3.7.1-0.pm.0.i586.rpm warning: /var/tmp/rpm-xfer.9eOu3a: Header V3 DSA signature: NOKEY, key ID 9a795806

Preparing... ########################################### [100%]

1:rar ########################################### [100%]

Upgrading a Package with rpm

If an older version of the package is already installed, an error will occur. Use rpm -Uvh to upgrade an existing package to a newer version:

http://packman.iu-bremen.de/suse/10.3/i586/rar-3.7.0-0.pm.0.i586.rpm

Retrieving http://packman.iu-bremen.de/suse/10.3/i586/rar-3.7.0-0.pm.0.i586.rpm warning: /var/tmp/rpm-xfer.HgM2qb: Header V3 DSA signature: NOKEY, key ID 9a795806

Preparing... ########################################### [100%]

1:rar ########################################### [100%]

This example installed an older version of the command. To upgrade, use the same rpm command line options, but with a newer package. For example:

http://packman.iu-bremen.de/suse/10.3/i586/rar-3.7.1-0.pm.0.i586.rpm

Retrieving http://packman.iu-bremen.de/suse/10.3/i586/rar-3.7.1-0.pm.0.i586.rpm warning: /var/tmp/rpm-xfer.HgM2qb: Header V3 DSA signature: NOKEY, key ID

9a795806

Preparing... ########################################### [100%]

1:rar ########################################### [100%]

Removing a Package with rpm

To remove an installed package, use the -e option as follows:

# rpm -e flash-player

Sometimes, you will find that rpm will not remove a package due to failed dependencies. This is one of the downsides of rpm — it does not resolve these dependencies.

# rpm -e gzip error: Failed dependencies:

gzip is needed by (installed) perl-5.8.8-75.i58 6 gzip is needed by (installed) mkinitrd-2.1-3 6.i58 6

The command failed because of dependency issues. The best way to resolve dependency issues is to use zypper or yast to work through the dependencies automatically. However, you may reach a point where you have to force the install or removal of a package.

WARNING! Forcing the install or removal of a package is DANGEROUS and may result in an unstable system. Make sure you know precisely what you're doing.

In this example, you specify that you want to remove the i586 version of the zoo package and ignore dependencies:

Querying Information about RPM Packages

The following example shows how to query installed packages for the zoo package and display version information about that package:

Use the -qp option to get information about an RPM file in the present directory:

To see a list of all the packages installed on your system, type the following:

#&n;

Continue reading here: Extracting Files from RPMs

Was this article helpful?

0 0