Projekt

Allgemein

Profil

Setup yum-priorities » Historie » Version 1

Jeremias Keihsler, 13.01.2017 09:13

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 7.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-7
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
priority=10
44
gpgcheck=1
45
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
46
</pre>
47
48
|_.Repo                 |_.Section        |_.Priority |
49
|_.iRedMail.repo        |_.iRedMail       |5        |
50
|_.CentOS-Base.repo     |_.base           |10       |
51
|_.CentOS-Base.repo     |_.updates        |10       |
52
|_.virtualbox.repo      |_.virtualbox     |20       |
53
|_.zabbix.repo          |_.zabbix         |20       |
54
|_.epel.repo            |_.epel           |30       |
55
|_.nux-dextop.repo      |_.nux-dextop     |40       |
56
|_.elrepo.repo          |_.elrepo         |90       |
57
58
h2. Test
59
60
actually not a test, but this one-liner gives you a sorted output of repo's and their configured priority
61
<pre><code class="bash">
62
sed -n -e "/^\[/h; /priority *=/{ G; s/\n/ /; s/ity=/ity = /; p }" /etc/yum.repos.d/*.repo | sort -k3n
63
</code></pre>
64
should give you a output like
65
<pre><code class="bash">
66
priority = 10 [base]
67
priority = 10 [updates]
68
priority = 20 [virtualbox]
69
priority = 21 [adobe-linux-x86_64]
70
priority = 30 [epel]
71
priority = 40 [nux-dextop]
72
</code></pre>