Projekt

Allgemein

Profil

Setup yum-priorities » Historie » Version 2

Jeremias Keihsler, 12.01.2017 09:30

1 1 Jeremias Keihsler
h1. Install Procedure for yum-priorities
2
3
h2. Requirements
4
5
To install yum-priorities you will need the following:
6
* a installed and supported operating system (e.g. CentOS 6.x)
7
* root-access
8
* a fast internet connection
9
10
h2. Preliminary Note
11
12
Some basic information may be found at
13
* http://wiki.centos.org/PackageManagement/Yum/Priorities
14
15
h2. Install yum-priorities
16
17
<pre><code class="bash">
18
yum install yum-priorities
19
</code></pre>
20
21
h2. Configure yum-priorities
22
23
the configuration of yum-priorities happens by adding a @priority@ setting to each repo-section
24
<pre><code class="bash">
25
vim /etc/yum.repos.d/CentOS-Base.repo
26
</code></pre>
27
28
add to each enabled section a @priority@ setting equal to @10@
29
<pre>
30
[base]
31
name=CentOS-$releasever - Base
32
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
33
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
34
priority=10
35
gpgcheck=1
36
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
37
38
#released updates 
39
[updates]
40
name=CentOS-$releasever - Updates
41
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
42
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
43
gpgcheck=1
44
priority=10
45
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
46
</pre>
47
48 2 Jeremias Keihsler
|_.Repo               |_.Section      |_.Priority |
49
|iRedMail.repo        |iRedMail       |5          |
50
|CentOS-Base.repo     |base           |10         |
51
|CentOS-Base.repo     |updates        |10         |
52
|pgdg-92-centos.repo  |pgdg92         |20         |
53
|virtualbox.repo      |virtualbox     |20         |
54
|zabbix.repo          |zabbix         |20         |
55
|rpmforge.repo        |rpmforge       |30         |
56
|epel.repo            |epel           |40         |
57
|nux-dextop.repo      |nux-dextop     |50         |
58
|adobe-linux-*.repo   |adobe-linux-*  |60         |
59 1 Jeremias Keihsler
60
h2. Test
61
62
actually not a test, but this one-liner gives you a sorted output of repo's and their configured priority
63
<pre><code class="bash">
64
sed -n -e "/^\[/h; /priority *=/{ G; s/\n/ /; s/ity=/ity = /; p }" /etc/yum.repos.d/*.repo | sort -k3n
65
</code></pre>
66
should give you a output like
67
<pre><code class="bash">
68
priority = 10 [base]
69
priority = 10 [updates]
70
priority = 20 [virtualbox]
71
priority = 30 [rpmforge]
72
priority = 40 [epel]
73
priority = 100 [adobe-linux-x86_64]
74
</code></pre>