From Fedora Project Wiki
fp-wiki>ImportUser
(Imported from MoinMoin)
 
m (add category)
 
(3 intermediate revisions by 2 users not shown)
Line 7: Line 7:
To add an extra repository, place a definition file in the <code>/etc/yum.repos.d/</code> directory on your system. Package providers make the definition files for their repositories available on their web sites.
To add an extra repository, place a definition file in the <code>/etc/yum.repos.d/</code> directory on your system. Package providers make the definition files for their repositories available on their web sites.


{| border="1"
{{Admon/tip | Definition File Extension | The names of repository definition files end with <code>.repo</code>.}}
|-
| {{Template:Tip}} '''Definition File Extension'''
|-
| The names of repository definition files end with <code>.repo</code>.
|}


You must have ''root'' access to add a file to the definitions directory. To copy the definition file <code>example.repo</code>, type this command:
You must have ''root'' access to add a file to the definitions directory. To copy the definition file <code>example.repo</code>, type this command:
Line 37: Line 32:
At the prompt, enter the ''root'' password.
At the prompt, enter the ''root'' password.


{| border="1"
{{Admon/important | Importing the Fedora Key | To add the Fedora public key to the <code>rpm</code> keyring on Fedora systems, run the command <code>su -c 'rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora'</code>.}}
|-
| {{Template:Important}} '''Importing the Fedora Key'''
|-
| To add the Fedora public key to the <code>rpm</code> keyring on Fedora systems, run the command <code>su -c 'rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora'</code>.
|}


== 7.3. Understanding Repository Compatibility ==
== 7.3. Understanding Repository Compatibility ==
Line 52: Line 42:
Alternative packages may contain versions of the software that function differently from the version in the Fedora Project packages. Determine the benefits and potential incompatibilities before replacing Fedora Project packages with alternative versions.
Alternative packages may contain versions of the software that function differently from the version in the Fedora Project packages. Determine the benefits and potential incompatibilities before replacing Fedora Project packages with alternative versions.


{| border="1"
{{Admon/caution | Incompatible Repositories | If you configure your system to use incompatible repositories yum operations may fail.}}
|-
| {{Template:Caution}} '''Incompatible Repositories'''
|-
| If you configure your system to use incompatible repositories yum operations may fail.
|}


Packages built for one version of Fedora are usually not compatible with other versions of Fedora. The web site of the provider should specifically state which versions of Fedora they support.
Packages built for one version of Fedora are usually not compatible with other versions of Fedora. The web site of the provider should specifically state which versions of Fedora they support.


{| border="1"
{{Admon/tip | Old Versions of yum and Current Repositories | The data format for repository indexes changed with version 2.1 of <code>yum</code>. This was the version supplied with Fedora Core 3. Repository providers should specify the versions of Fedora that they support. To confirm that an unlabeled repository is compatible with current versions of <code>yum</code>, check that it has a sub-directory called <code>repodata/</code>.}}
|-
| {{Template:Tip}} '''Old Versions of yum and Current Repositories'''
|-
| The data format for repository indexes changed with version 2.1 of <code>yum</code>. This was the version supplied with Fedora Core 3. Repository providers should specify the versions of Fedora that they support. To confirm that an unlabeled repository is compatible with current versions of <code>yum</code>, check that it has a sub-directory called <code>repodata/</code>.
|}


== 7.4. Disabling or Removing Package Sources ==
== 7.4. Disabling or Removing Package Sources ==
Line 74: Line 54:
To completely remove access to a repository:
To completely remove access to a repository:


1. Delete the relevant file from <code>/etc/yum.repos.d/</code>.
# Delete the relevant file from <code>/etc/yum.repos.d/</code>.
2. Delete the cache directory from <code>/var/cache/yum/</code>.
# Delete the cache directory from <code>/var/cache/yum/</code>.


{| border="1"
{|
|-
|-
|[[Docs/Drafts/SoftwareManagementGuide/UpdateWithYum| Previous Page - 6. Updating Your System with yum]] ||[[Docs/Drafts/SoftwareManagementGuide| Table of Contents]] ||[[Docs/Drafts/SoftwareManagementGuide/IsolatedInstall| Next Page - 8. Installing Software from an Isolated Package]]
|[[Docs/Drafts/SoftwareManagementGuide/UpdateWithYum| Previous Page - 6. Updating Your System with yum]] ||[[Docs/Drafts/SoftwareManagementGuide| Table of Contents]] ||[[Docs/Drafts/SoftwareManagementGuide/IsolatedInstall| Next Page - 8. Installing Software from an Isolated Package]]
|}
[[Category:Software Management Guide]]

Latest revision as of 01:11, 4 March 2009

7. Configuring Access to Software Repositories

Fedora systems automatically use the Fedora Project repositories. If the Fedora Project does not supply packages for a product, the manufacturer may provide or recommend a separate repository. Members of the community also maintain repositories to provide packages for Fedora systems. For example, http://www.jpackage.org/ distributes popular Java software as packages.

7.1. Adding a Repository as a Package Source

To add an extra repository, place a definition file in the /etc/yum.repos.d/ directory on your system. Package providers make the definition files for their repositories available on their web sites.

Definition File Extension
The names of repository definition files end with .repo.

You must have root access to add a file to the definitions directory. To copy the definition file example.repo, type this command:

su -c 'cp example.repo /etc/yum.repos.d/'

At the prompt, enter the password for the root account.

The configuration file for each repository should include a gpgkey setting. This setting specifies the location of a public key that verifies the packages provided by that repository. This public key is automatically imported the first time that you install software from the repository. If the configuration file provided does not include this setting, refer to Section 7.2, “Manually Authorizing Package Sources”.

7.2. Manually Authorizing Package Sources

To manually add a public key to your rpm keyring, use the import feature of the rpm utility. To import the file GPG-PUB-KEY.asc, type the following command:

su -c 'rpm --import GPG-PUB-KEY.asc'

At the prompt, enter the password for the root account.

You may also import public keys directly from a web site. For example, to import the file GPG-PUB-KEY.asc on the web site www.therepository.com, use this command:

su -c 'rpm --import http://www.therepository.com/GPG-PUB-KEY.asc'

At the prompt, enter the root password.

Importing the Fedora Key
To add the Fedora public key to the rpm keyring on Fedora systems, run the command su -c 'rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora'.

7.3. Understanding Repository Compatibility

The Fedora Package Collection includes several thousands of packages which are compatible with each other. Third-party packages should be compatible with these Fedora Project packages, unless the provider specifically states otherwise.

Always read the web site of the repository for information on package compatibility before you add it as a package source. Separate repository providers may offer different and incompatible versions of the same software. Third-party repositories may also provide alternative packages for software that is included in Fedora repositories.

Alternative packages may contain versions of the software that function differently from the version in the Fedora Project packages. Determine the benefits and potential incompatibilities before replacing Fedora Project packages with alternative versions.

Incompatible Repositories
If you configure your system to use incompatible repositories yum operations may fail.

Packages built for one version of Fedora are usually not compatible with other versions of Fedora. The web site of the provider should specifically state which versions of Fedora they support.

Old Versions of yum and Current Repositories
The data format for repository indexes changed with version 2.1 of yum. This was the version supplied with Fedora Core 3. Repository providers should specify the versions of Fedora that they support. To confirm that an unlabeled repository is compatible with current versions of yum, check that it has a sub-directory called repodata/.

7.4. Disabling or Removing Package Sources

Set enabled=0 in a definition file to prevent yum from using that repository. The yum utility ignores any definition file with this setting.

To completely remove access to a repository:

  1. Delete the relevant file from /etc/yum.repos.d/.
  2. Delete the cache directory from /var/cache/yum/.
Previous Page - 6. Updating Your System with yum Table of Contents Next Page - 8. Installing Software from an Isolated Package