Difference between revisions of "Yum-plugin-priorities"

From SME Server
Jump to navigationJump to search
m
m (added ref to centos wiki)
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Warning box|Currently under development.}}
+
==Yum-plugin-priorities==
 +
{{Level|Advanced}}
  
 
This page is intended to explore the possible use of yum-plugin-priorities in order to help prevent the installation of unwanted rpms from 3rd-party repositories such as dag, dries, etc.
 
This page is intended to explore the possible use of yum-plugin-priorities in order to help prevent the installation of unwanted rpms from 3rd-party repositories such as dag, dries, etc.
 
Inspired by [[Bugzilla:4757]]
 
  
 
=== Installation ===
 
=== Installation ===
 
  yum --enablerepo=extras install yum-plugin-priorities
 
  yum --enablerepo=extras install yum-plugin-priorities
  
On SME 8.x use (untested!)
+
On SME Server 8.x use (untested!)
 
  yum --enablerepo=extras install yum-priorities
 
  yum --enablerepo=extras install yum-priorities
  
Line 16: Line 15:
 
  enabled = 1
 
  enabled = 1
 
  check_obsoletes = 1
 
  check_obsoletes = 1
These settings tell yum to pay attention to the 'priority' setting for each repo, and to make sure the an 'obsoletes' flag in a low priority repo will not result in the removal of a package from a higher-priority repo.
+
These settings tell yum to pay attention to the 'priority' setting for each repo, and to make sure the 'obsoletes' flag in a low priority repo will not result in the removal of a package from a higher-priority repo.
  
If you are not running Sme 7.4 update smeserver-yum
+
If you are not running SME Server 7.4, update smeserver-yum
 
  yum update smeserver-yum
 
  yum update smeserver-yum
 +
 +
==== modify yum template ====
 +
cp the original and add the following to the bottom of the fragment
 +
nano -w  /etc/e-smith/templates-custom/etc/yum.smerepos.d/sme-base.repo/20repositories
 +
 +
      if (exists $props{priority})
 +
        {
 +
            $OUT .= "priority" . '=' . $props{priority} . "\n";
 +
        }
  
 
==== DB values ====
 
==== DB values ====
Line 32: Line 40:
 
   
 
   
 
  signal-event yum-modify
 
  signal-event yum-modify
 
==== modify yum template ====
 
cp the original and add the following to the bottom of the fragment
 
nano -w  /etc/e-smith/templates-custom/etc/yum.smerepos.d/sme-base.repo/20repositories
 
 
      if (exists $props{priority})
 
        {
 
            $OUT .= "priority" . '=' . $props{priority} . "\n";
 
        }
 
  
 
=== Usage ===
 
=== Usage ===
Line 47: Line 46:
 
* If you get a ''missing dependency'' error from yum
 
* If you get a ''missing dependency'' error from yum
 
** re-run yum manually using ''--exclude <pkgname>'' on the command line, replacing <pkgname> with the package that is preventing your update
 
** re-run yum manually using ''--exclude <pkgname>'' on the command line, replacing <pkgname> with the package that is preventing your update
** If you suspect that the blocked update resolves a security issue, you must decide for yourself whether to compromise the original sme/centos package and force the update of the non-sme/centos package by running  
+
** If you suspect that the blocked update resolves a security issue, you must decide for yourself whether to compromise the original SME Server/CentOS package and force the update of the non-SME Server/CentOS package by running  
 
  yum update --enablerepo=<xxx>  --enablerepo=<xxx2> --noplugins <pkgname>
 
  yum update --enablerepo=<xxx>  --enablerepo=<xxx2> --noplugins <pkgname>
 +
 +
===References===
 +
 +
[[bugzilla:4757]]
 +
 +
Centos Wiki page at http://wiki.centos.org/PackageManagement/Yum/Priorities
 +
 +
----
 +
[[Category:Howto]]
 +
[[Category:Administration]]

Latest revision as of 20:14, 24 June 2010

Yum-plugin-priorities

PythonIcon.png Skill level: Advanced
The instructions on this page may require deviations from standard procedures. A good understanding of linux and Koozali SME Server is recommended.


This page is intended to explore the possible use of yum-plugin-priorities in order to help prevent the installation of unwanted rpms from 3rd-party repositories such as dag, dries, etc.

Installation

yum --enablerepo=extras install yum-plugin-priorities

On SME Server 8.x use (untested!)

yum --enablerepo=extras install yum-priorities

Configuration

The installation of yum-plugin-priorities will create /etc/yum/pluginconf.d/priorities.conf with the following settings

[main]
enabled = 1
check_obsoletes = 1

These settings tell yum to pay attention to the 'priority' setting for each repo, and to make sure the 'obsoletes' flag in a low priority repo will not result in the removal of a package from a higher-priority repo.

If you are not running SME Server 7.4, update smeserver-yum

yum update smeserver-yum

modify yum template

cp the original and add the following to the bottom of the fragment

nano -w  /etc/e-smith/templates-custom/etc/yum.smerepos.d/sme-base.repo/20repositories 

      if (exists $props{priority})
       {
           $OUT .= "priority" . '=' . $props{priority} . "\n";
       }

DB values

Use this script to create DB priority values

#!/bin/bash

for REPO in smeaddons smecontribs smedev smeextras smeos smetest smeupdates smeupdates-testing addons base  centosplus contrib extras updates
do
 db yum_repositories setprop $REPO priority 10
 #set to 99 for testing when you want to remove priority
done

signal-event yum-modify

Usage

  • If you install any contribs or non-sme packages using any form of --enablerepo=<xxx>, update with the following to make sure you get any available updates for your extra packages
yum update --enablerepo=<xxx> --enablerepo=<xxx2>
  • If you get a missing dependency error from yum
    • re-run yum manually using --exclude <pkgname> on the command line, replacing <pkgname> with the package that is preventing your update
    • If you suspect that the blocked update resolves a security issue, you must decide for yourself whether to compromise the original SME Server/CentOS package and force the update of the non-SME Server/CentOS package by running
yum update --enablerepo=<xxx>  --enablerepo=<xxx2> --noplugins <pkgname>

References

bugzilla:4757

Centos Wiki page at http://wiki.centos.org/PackageManagement/Yum/Priorities