From Fedora Project Wiki

< Archive:Legacy

Revision as of 15:11, 26 March 2013 by Sparks (talk | contribs) (Sparks moved page Legacy/Yum73Detailed to Archive:Legacy/Yum73Detailed)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Using Fedora Legacy's yum for Red Hat Linux 7.3

Introduction

yum (Yellowdog Updater, Modified) is an automated package management program which may be used to install, remove, and update packages on an RPM based system. It will help you to keep your system up to date and is used by Fedora Core, the successor to Red Hat Linux. Unfortunately, it wasn't included in original 7.x release of Red Hat Linux, however, we have prepared a yum package for you to get the full yum functionality on your existing Red Hat Linux 7.x system.

Step 1: Preliminaries

Linux prevents ordinary users from installing, removing, or modifying system software, libraries, and important configuration information. So you must have root access to proceed. You may either login as the root user, or use the su (or sudo) commands to become the root user on the machine.

Note: Be careful when running as root! Be sure to logout of the root account as soon as you are done. Running as root is dangerous, and should only be used when needed. Typos or mistakes can destroy your system or your data, so it is important that you be careful when running as root.

When you are running as root, your prompt will be changed to the # character. In the command examples below, we include this prompt, however you should not type the # character when entering a command!

Besides rpm itself, yum depends on the gnupg, python and rpm-python packages. Please check if all the packages are available by executing the following command as root:


rpm will output the package versions, or "...is not installed" if the package is missing, for each of these packages. If all of these packages are installed, continue with Step 2 below. If you're missing any of these packages, you must install them before you can proceed.

Installing missing packages on Red Hat Linux 7.3

Install any of the missing packages:


The above may seem like a lot of work, but don't worry; you only have to do this once, and after that you'll never need to worry about using rpm commands again to update your installed packages. Once installed, yum will automatically retrieve and install the newest required updates along with all their dependencies in a single call. The work involved in setting up yum is small compared to the amount of work it will save you in the future!

Step 2: Install yum

To install yum, use the following command as the root user on your machine:


yum automatically uses the correct configuration for your system (7.2 or 7.3), so you can install the above RPM on any 7.2 or 7.3 systems.

Step 2.1: Optionally add mirror sites

yum will be installed so as to use download.fedoralegacy.org as the source of updates. You may want to configure it to use additional mirror sites which are closer to you, faster, or meet your security policy. yum supports automatic fail-over when one or more servers are unavailable, so it is advantageous to use multiple mirror sites to take advantage of this fail-over support. yum will use the sites in the order presented in the baseurl parameters of your configuration file, so you should order them so that the most desirable sites will be tried first before your fail-over mirrors.

Again, please note that this step is optional, and it is up to you to decide if you wish to implement it.

You can find a list of current Fedora Legacy mirrors at http://www.fedoralegacy.org/download/mirrors.php.

You will need to manually edit the file /etc/yum.conf to set the mirror site(s) should you chose to do so.

Step 2.2: Add the GPG keys to root's keyring

All Fedora Legacy packages are signed with GPG keys. All packages should be verified using these keys. See http://www.fedoralegacy.org/about/security.php for more information.

In order to properly verify the packages, you need to add the appropriate PGP keys to your root user's keyring. The keys are installed with the yum documentation as part of the RPM installation, but not imported into your keyring. To import the keys, use the following command as the root user:


Note: If you've never used pgp before as root, you will need to run the command a second time so that gpg can read and use its newly created options file.

Step 3: Update your system

Once you have installed the yum package, you should run the following command as the root user on your system to update your system:


This command will first check for and download any new update headers (header files contain information about packages, including dependency information) to your system's yum cache, and check if any updates are available for packages already installed on your system. If no updates are available for your system, it will display messages to that effect and exit. If updates are available for your system, it will calculate which packages are needed, including any packages needed to resolve dependencies, and present this list to you. At this point, it will ask you if you want to proceed, by prompting you with the question:

Is this ok [y/N] :

Answer with "y" (followed by the Enter key) to proceed with the updates, or "n" (followed by the Enter key) to abort the updates. (Note that the default reply is "n", so that simply pressing the Enter key without entering "y" will be the same as entering "n").

If you answer "y" then yum will download all the actual RPM packages needed to your system's yum cache, check for sufficient disk space to install the updates, and then apply them to your system. (If you answer "n", nothing will be done).

Warning: This may take some time on your first use of yum, depending on how up to date your system is and the speed of your internet connection! Step 4: Decide if you want automatic updates

yum has the ability to automatically apply (download/verify/install) all updates to your system, but this feature is disabled by default. Please refer to this autoupdates discussion to see if automatic updates are right for you, and additional information about automatic updates. If you want to enable that functionality, please enter the following command as the root user on your system:


After typing the last line, you should see a message on the screen confirming that nightly updates are now enabled. After that, yum will update your system through the cron job /etc/cron.daily/yum.cron, which will run every night (or later through anacron, if your system isn't running all the time).

Please note that the above depends on a working cron setup on your machine! You can check the cron log file /var/log/cron to verify it is working. There should be at least one hourly entry each hour, and one daily entry each day.

You can check what yum updates are being done by looking at the yum log file var/log/yum.log for recent entries.

Step 5: Subscribe to fedora-legacy-announce

You may subscribe to the fedora-legacy-announce mailing list to be informed by e-mail when new updates become available. This step is optional, but highly recommended.

Step 6: Please help us with our service!

The Fedora Legacy project is always in the need of helping hands. Please check the LegacyParticipate page to see what you can do to help us. As we're a community project, our success will heavily depend on helping hands – possibly you!

If you find a problem with an update published by The Fedora Legacy Project, or in The Fedora Legacy Project documentation, please let us know!

Step 7: Optionally learn additional features of yum

Below is a summary of some of the more advanced features of yum for those who wish to know more. You do not need to know these commands to keep your system updated; they are simply provided for those who want to learn more about using yum to its fullest.

yum list
List all available software.
yum check-update
See if there are updated packages available.
yum update
Update all installed packages that have a newer version available.
yum install <packagename>
Install specific package(s) (and its dependencies, if missing any).
yum search <word>
Search all known packages entries (descriptions etc) for <word>.
yum info <packagename>
Show basic information about a package.