Monday, December 1, 2008

Updating and Adding Packages to Red Hat Linux

Updating and Adding Packages to Red Hat Linux

Red Hat Linux consists of various software applications and utilities, known as RPM packages. A package is just a file that contains a software program. This chapter explains three ways to update your system: using Red Hat Network, using the online Errata List, and using the Red Hat Linux Installation CD-ROMs.

 

13.1. Red Hat Network

Red Hat Network is an Internet solution for managing one or more Red Hat Linux systems. All Security Alerts, Bug Fix Alerts, and Enhancement Alerts (collectively known as Errata Alerts) can be downloaded directly from Red Hat using the Red Hat Update Agent standalone application or through the RHN Web interface available at http://rhn.redhat.com/. Red Hat Network saves users time because they receive email when updated packages are released. Users do not have to search the Web for updated packages or security alerts. By default, Red Hat Network installs the packages as well. Users do not have to learn how to use RPM or worry about resolving software package dependencies; RHN does it all.

Each Red Hat Network account comes with:

 

Ø      Errata Alerts --learn when Security Alerts, Bug Fix Alerts, and Enhancement Alerts are issued for all the systems in your network through the Basic interface

Ø      Automatic email notifications  -- receive an email notification when an Errata Alert is issued for your system

Ø      Scheduled Errata Updates  -- schedule delivery of Errata Updates (with optional automatic installation)

Ø      Package installation  -- Schedule package installation on one or more systems with the click of a button

Ø      Red Hat Update Agent  -- use the Red Hat Update Agent to download the latest software packages for your system (with optional package installation)

Ø      Red Hat Network website  -- manage multiple systems, downloaded individual packages, and schedule actions such as Errata Updates through a secure Web browser connection from any computer.

 

To start using Red Hat Network, follow these three basic steps:

 

1. Create a System Profile using one of the following methods:

 

Ø      Registering the system with RHN during the Setup Agent the first time your system boots after installation.

 

Ø      Select Main Menu Button => System Tools => Red Hat Network on your desktop.

 

Ø      Execute the command up2date from a shell prompt.

 

2. Log in to RHN at http://rhn.redhat.com/ and entitle the system to a service offering. Everyone receives a free Red-Hat Network account for one system. Additional accounts can be purchased.

 

3. Start scheduling updates through the RHN website or download and install Errata Updates with the Red Hat Update Agent.

 

For more detailed instructions, read the Red Hat Network User Reference Guide available at http://www.redhat.com/docs/manuals/RHNetwork/.

 

Tip

Red Hat Linux includes the Red Hat Network Alert Notification Tool, a convenient panel applet that displays visible alerts when there is an update for your Red Hat Linux system. Refer to the following URL for more information about the applet: http://rhn.redhat.com/help/basic/applet.html

 

13.2. Errata List

It is recommended that new users use Red Hat Network to download and install/upgrade packages. Updating Errata packages from the Red Hat Linux Errata website is recommended for more experienced Red Hat Linux users. It also requires users to resolve software dependencies manually. A software dependency is when a package is dependent on other package being installed. All Security Alerts, Bug Fix Alerts, and Enhancement Alerts (collective known as Errata Alerts) can also be downloaded from the Red Hat website at http://www.redhat.com/apps/support/errata/.  Click on the Red Hat Linux version you are using to view a list of all available errata for Red Hat Linux. Click on the name of the Errata Alert that you want to apply to your system. Instructions for updating the packages are on the individual Errata pages. Red Hat, Inc. tests and approves the RPMs posted on this site. RPMs downloaded from other sites are not supported.

 

13.3. Installation CD-ROMs

Place the first Red Hat Linux CD-ROM in your CD-ROM drive. Select Yes when asked if you want to run the autorun program from the CD. It then prompts you for the root password so that you can install packages.

 

If you enter the correct root password, the Package Management Tool interface appears and allows you to select packages groups to install as well as individual packages within the groups. Refer to the Official Red Hat Linux Customization Guide for more information about the Package Management Tool.

 

Frequently Asked Questions

This chapter answers some of the most common questions about using Red Hat Linux that you may ask as you become more familiar with it. From recovering forgotten passwords to troubleshooting package installation problems, this chapter will ease you step-by-step through some common tasks and get you on your way.

14.1. Localhost Login and Password

I have installed Red Hat Linux. After rebooting, I get a message telling me it needs a localhost login and password. What are these?

Unless you specified a host name for your computer, or received that information from a network, your Red Hat Linux installation will call your machine localhost.localdomain by default. When you get to that initial prompt, it is asking you to log in to your system. If you created a user account during installation, you can log in using that user name and password. If you didn't create a user account during installation, then you can log in as the super user, also known as root. The root password is the system password you assigned during installation. It is highly recommended that you create at least one user account during installation. If you did not, you can create a new user after logging in as root with the Red Hat User Manager GUI application or the useradd command-line utility. For more information, refer to Section 1.6.

 

14.2. Error Messages During Installation of RPMs

How do I install an RPM from a CD or the Internet? I keep getting an error message when I use rpm. If you are getting an error message similar to failed to open /var/lib/rpm/packages.rpm,

 

it is because you do not have proper permission to install RPM files. When you install software, you are often required to make system-wide changes which only root can make, such as creating new directories outside of your user home directory or making changes to your system configuration. If you are using your normal user account, you will not have permission to make such changes by default. You need to be the root user in order to install RPM files. At a shell prompt, switch to root user by running the following command:

su

You should then be able to install the RPM file without further errors. For more information about using RPM and Package Management Tool, refer to the Official Red Hat Linux Customization Guide on the Red Hat Linux Documentation CD or online at http://www.redhat.com/docs/.

 

14.3. Starting Applications

I installed an application I downloaded from the Internet, and everything seemed to go fine, but I still get "command not found" when I type its name. I think I have the right name, so why will it not start?

 

If you are trying to start an application from the shell prompt and it is not working, try typing out the full directory path before the name of the application's executable (such as /usr/local/bin/myexecutable).

 

For example, imagine that you have downloaded the setiathome client application and want to try it out. You follow the directions for installing the software, which creates a subdirectory in your home directory called seti/. Now, start the application using the full path to the executable file as shown below:

/home/joe/seti/setiathome

 

The reason you may need to use the full pathnames in order to start an application is because the executable wasn't placed in a directory where your user shell environment knew it could be found (such as /usr/local/bin).

You can customize your settings so that you won't be required to use the type the full path to the application each time. To do this, you will have to edit your PATH environment variable.

 

14.3.1. Editing Your PATH

If you frequently start programs that are not located in a directory that your user shell has been configured to search, you will have to edit your user shell configuration file to add the directory containing the executable you wish to run. You can do this by adding the directory to your PATH environment variable.

 

Caution

These instructions are intended only for user accounts. Avoid modifying files such as the root user's .bash_profile, because of the potential security risks.

Start a text editor, such as pico, at a shell prompt. You can open the file called

 

.bash_profile by typing the following:

 

pico .bash_profile

 

You will see a PATH statement, similar to the one shown below.

 

PATH=$PATH:$HOME/bin:/usr/local/bin:

 

To the end of this statement, add ./ as shown below:

 

PATH=$PATH:$HOME/bin:/usr/local/bin/:$HOME/seti:

 

Now, type [Ctrl]-[x]; you will be asked whether you want to save "the modified buffer" (that's what Pico calls an updated file); type [y] for "yes." Next, you will see the name the file will be saved as; press the [Enter] key.

 

You can then make the changes to .bash_profile take effect immediately by typing the following command:

 

source .bash_profile

 

By doing the above, you do not have to manually add ./ to the beginning of the executable to start an application located in the directory you've added to your PATH.

 

14.4. Accessing a Windows Partition

I have a dual-boot system with Red Hat Linux and Windows 98. Is there a way to access my Windows partition while I am running Linux?

You can access another partition on your system (for example, a Windows partition), in two different ways.

 

First, assume that your Windows partition is on your first IDE hard drive, in the first partition (/dev/hda1).

At a shell prompt, log in as root (type su and then enter the root password).

Create a directory at which the Windows partition will be mounted by typing the following command:

 

mkdir /mnt/windows

 

Before you can access the partition, you will need to mount it at the directory you just created. As root, type the following command at a shell prompt:

 

mount -t vfat /dev/hda1 /mnt/windows

 

To automatically mount a Windows partition, you must modify the /etc/fstab file.

At a shell prompt, su to root, following the above example. Next, open the /etc/fstab in a text editor by typing (for example):

 

pico /etc/fstab

 

Add the following on a new line (the /dev/hda1 may vary, but for most users this is correct):

/dev/hda1 /mnt/windows vfat auto,owner,users 0 0

 

Press [Ctrl]-[x] and then press [y] for yes when prompted to save the changes.

The next time the system is rebooted, the /etc/fstab file is read, and the Windows partition is automatically mounted in the directory /mnt/windows. To access the partition, at a shell prompt, type the command cd /mnt/windows. To navigate through directories or files with spaces, surround the name of the directory or file with quotation marks, as in ls "Program Files".

No comments: