Changes

From SME Server
Jump to navigationJump to search
479 bytes removed ,  21:14, 24 June 2010
m
added ref to centos wiki
Line 1: Line 1: −
yum-plugin-priorities
+
==Yum-plugin-priorities==
{{Warning box|Currently under development.  '''DOES NOT WORK'''}}
+
{{Level|Advanced}}
 
  −
{{Needs review}}
  −
 
      
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 ==
  −
=== SME 7.x (Centos 4.x ===
   
  yum --enablerepo=extras install yum-plugin-priorities
 
  yum --enablerepo=extras install yum-plugin-priorities
   −
=== SME 8.x (Centos 5.x) ===
+
On SME Server 8.x use (untested!)
(untested!)
   
  yum --enablerepo=extras install yum-priorities
 
  yum --enablerepo=extras install yum-priorities
    
=== Configuration ===
 
=== Configuration ===
==== New config files ====
+
The installation of yum-plugin-priorities will create '''/etc/yum/pluginconf.d/priorities.conf''' with the following settings
(SME 7.x): The installation of yum-plugin-priorities will create '''/etc/yum/pluginconf.d/priorities.conf''' with the following settings
   
  [main]
 
  [main]
 
  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.
   −
==== Modify /etc/yum.conf ====
+
If you are not running SME Server 7.4, update smeserver-yum
Now add '''priority=10''' to the repos in /etc/yum.conf that are enabled by default.
+
yum update smeserver-yum
   −
  cd /etc
+
==== modify yum template ====
mv yum.conf yum.conf.sav
+
cp the original and add the following to the bottom of the fragment
  sed s/enabled=1/enabled=1\\npriority=10/ /etc/yum.conf.sav > yum.conf
+
  nano -w  /etc/e-smith/templates-custom/etc/yum.smerepos.d/sme-base.repo/20repositories
 +
   
 +
      if (exists $props{priority})
 +
        {
 +
            $OUT .= "priority" . '=' . $props{priority} . "\n";
 +
        }
   −
==== Modify /etc/yum.conf/* in sme 7.4 ====
+
==== DB values ====
 
+
Use this script to create DB priority values
create priority db default
   
  #!/bin/bash
 
  #!/bin/bash
 
   
 
   
 
  for REPO in smeaddons smecontribs smedev smeextras smeos smetest smeupdates smeupdates-testing addons base  centosplus contrib extras updates
 
  for REPO in smeaddons smecontribs smedev smeextras smeos smetest smeupdates smeupdates-testing addons base  centosplus contrib extras updates
 
  do
 
  do
echo 5 > /etc/e-smith/db/yum_repositories/defaults/$REPO/priority
+
  db yum_repositories setprop $REPO priority 10
 +
  #set to 99 for testing when you want to remove priority
 
  done
 
  done
 
   
 
   
  echo "now run"
+
  signal-event yum-modify
echo "/etc/e-smith/events/actions/initialize-default-databases"
  −
echo "expand-template /etc/yum.smerepos.d/sme-base.repo"
  −
  −
add the following, to the bottom of the fragment, use templates-custom if you prefer
  −
nano -w  /etc/e-smith/templates-custom/etc/yum.smerepos.d/sme-base.repo/20repositories
  −
  −
      if (exists $props{priority})
  −
        {
  −
            $OUT .= "priority" . '=' . $props{priority} . "\n";
  −
        }
  −
 
  −
== Testing ==
  −
=== Original Configuration ===
  −
yum update
  −
 
  −
...
  −
Transaction Summary
  −
=============================================================================
  −
Install      0 Package(s)
  −
Update      8 Package(s)
  −
Remove      0 Package(s)
  −
 
  −
yum --enablerepo=dag update
  −
 
  −
...
  −
Transaction Summary
  −
=============================================================================
  −
Install    22 Package(s)
  −
Update      80 Package(s)
  −
Remove      0 Package(s)
  −
 
  −
=== After modifying /etc/yum.conf ===
  −
yum update
     −
...
+
=== Usage ===
Transaction Summary
+
* 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>
Install      0 Package(s)
+
* If you get a ''missing dependency'' error from yum
  Update      8 Package(s)
+
** re-run yum manually using ''--exclude <pkgname>'' on the command line, replacing <pkgname> with the package that is preventing your update
  Remove      0 Package(s)
+
** 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 --enablerepo=dag update
+
===References===
   −
...
+
[[bugzilla:4757]]
Error: Missing Dependency: perl(DBD::Pg) >= 1.32 is needed by package perl-DBIx-DBSchema
  −
...
     −
== To Do ==
+
Centos Wiki page at http://wiki.centos.org/PackageManagement/Yum/Priorities
Figure out why setting priorities results in missing dependcies.
     −
I tried giving all 'sme' repos higher priority (priority=5) than the centos repos (priority=10) - same result.
+
----
 +
[[Category:Howto]]
 +
[[Category:Administration]]

Navigation menu