Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 301 lines (220 sloc) 9.268 kb
97e75df @dagwieers Updates
authored
1 = Using RHN support in mrepo
2 Dag Wieers <dag@wieers.com>
abd2a40 @dagwieers Update documentation
authored
3 0.8.8svn, 29 august 2011
b13ed51 @dagwieers Changing Depo into mrepo.
authored
4
97e75df @dagwieers Updates
authored
5 // Please send me improvements to this document.
6
7 This document describes how to set up a Red Hat Network mirror for various
8 RHEL versions and architectures and provide the packages to local clients.
9
10
11 == Requirements
b13ed51 @dagwieers Changing Depo into mrepo.
authored
12 For RHN support to work, you need to install the up2date package
13 that comes with your RHEL distribution. It may not work with
14 another up2date package (eg. Fedora Core).
15
16
97e75df @dagwieers Updates
authored
17 == RHN systemid creation
61777b3 @dagwieers Finalize rename to mrepo
authored
18 For each distribution you want to add to mrepo, you need to have a valid
b13ed51 @dagwieers Changing Depo into mrepo.
authored
19 RHN systemid. You can create a systemid (provided you have the correct
20 entitlements to do so) by using the gensystemid tool that comes with
61777b3 @dagwieers Finalize rename to mrepo
authored
21 mrepo, eg.
b13ed51 @dagwieers Changing Depo into mrepo.
authored
22
97e75df @dagwieers Updates
authored
23 ----
abd2a40 @dagwieers Update documentation
authored
24 gensystemid -r 6Server -a x86_64 /var/mrepo/rhel6s-x86_64
b13ed51 @dagwieers Changing Depo into mrepo.
authored
25 ----
26
abd2a40 @dagwieers Update documentation
authored
27 The tool will create a new system called _<hostname>-6Server-x86_64-mrepo_,
b13ed51 @dagwieers Changing Depo into mrepo.
authored
28 register this system on RHN and create a systemid file in
abd2a40 @dagwieers Update documentation
authored
29 _/var/mrepo/rhel6s-x86_64_
b13ed51 @dagwieers Changing Depo into mrepo.
authored
30
31
97e75df @dagwieers Updates
authored
32 == RHN configuration
b13ed51 @dagwieers Changing Depo into mrepo.
authored
33 Having done that, you can enable multiple channels for this systemid
61777b3 @dagwieers Finalize rename to mrepo
authored
34 on the RHN website. And then configure mrepo to use these channels, eg.
b13ed51 @dagwieers Changing Depo into mrepo.
authored
35
36 ----
abd2a40 @dagwieers Update documentation
authored
37 [rhel6s]
38 name = Red Hat Enterprise Linux Server 6.1 ($arch)
39 release = 6
40 arch = i386 x86_64
41 iso = rhel-server-6.1-$arch-dvd.iso
42 updates = rhns:///rhel-$arch-server-6
43 ha = rhns:///rhel-$arch-server-ha-6
44 lb = rhns:///rhel-$arch-server-lb-6
45 optional = rhns:///rhel-$arch-server-optional-6
46 rs = rhns:///rhel-$arch-server-rs-6
47 supplementary = rhns:///rhel-$arch-server-supplementary-6
b13ed51 @dagwieers Changing Depo into mrepo.
authored
48 ----
49
61777b3 @dagwieers Finalize rename to mrepo
authored
50 After that, mrepo should be able to successfully log on and download
b13ed51 @dagwieers Changing Depo into mrepo.
authored
51 all packages for the configured channels.
52
53
97e75df @dagwieers Updates
authored
54 == Creating systemids for different dists/archs
b13ed51 @dagwieers Changing Depo into mrepo.
authored
55 Previously it was not possible to generate a new systemid for a
56 dist/arch without installing a system, connecting it to the Internet
57 and then register on RHN.
58
59 A lot of companies simply do not allow servers to have internet access
60 and I have personally been several times in the situation that I needed
61 to download x86_64 or ppc packages for a system that I have entitlements
62 for but is simply not allowed to connect to the Internet.
63
61777b3 @dagwieers Finalize rename to mrepo
authored
64 The gensystemid tool that comes with mrepo will help you with creating
65 valid systemids for mrepo, eg.
b13ed51 @dagwieers Changing Depo into mrepo.
authored
66
97e75df @dagwieers Updates
authored
67 $ gensystemid -r 4AS -a x86_64 /var/mrepo/rhel4as-x86_64
b13ed51 @dagwieers Changing Depo into mrepo.
authored
68
69 You can manage your systems on the RHN website afterwards.
70
97e75df @dagwieers Updates
authored
71 WARNING: For yet unknown reasons, you have to be root to run +gensystemid+.
b13ed51 @dagwieers Changing Depo into mrepo.
authored
72
73
97e75df @dagwieers Updates
authored
74 == Downloading from unsubscribed channels
61777b3 @dagwieers Finalize rename to mrepo
authored
75 You can let mrepo subscribe to the necessary channels, unfortunately this
b13ed51 @dagwieers Changing Depo into mrepo.
authored
76 requires your RHN username and password. You can provide these in
77 the main section, like:
78
79 ----
80 [main]
81 rhnlogin = username:password
82 ----
83
84 Or you can supply them to rhnget at the appropriate time. Unfortunately since
97e75df @dagwieers Updates
authored
85 +rhnget+ is a seperate tool invoked by mrepo, you may need to provide this
b13ed51 @dagwieers Changing Depo into mrepo.
authored
86 information several times (every time you need to subscribe to a new channel).
87
97e75df @dagwieers Updates
authored
88 You can also choose to only provide the username in _/etc/mrepo.conf_ and
89 provide the password interactively.
b13ed51 @dagwieers Changing Depo into mrepo.
authored
90
91 ----
92 [main]
93 rhnlogin = username
94 ----
95
97e75df @dagwieers Updates
authored
96 Of course if you put the password in _/etc/mrepo.conf_, you need to protect it.
b13ed51 @dagwieers Changing Depo into mrepo.
authored
97 You may want to do:
98
97e75df @dagwieers Updates
authored
99 $ chmod og= /etc/mrepo.conf
100 $ chown root.root /etc/mrepo.conf
b13ed51 @dagwieers Changing Depo into mrepo.
authored
101
102 Since you only need the username/password to subscribe to new channels
103 (only the very first time you access them) you may wish to remove the
61777b3 @dagwieers Finalize rename to mrepo
authored
104 login information from mrepo.conf after that.
b13ed51 @dagwieers Changing Depo into mrepo.
authored
105
106 You can also log on manually to the RHN website to subscribe your system
107 to the channels you require.
108
109
97e75df @dagwieers Updates
authored
110 == Adding up2date-uuid file
111 If you get the following error:
112
113 No rhnuuid config option found in /etc/sysconfig/rhn/up2date-uuid
114
115 Then you are missing the file _/etc/sysconfig/rhn/up2date-uuid_, the content
116 of this file looks similar to:
117
118 ----
119 uuid[comment]=Universally Unique ID for this server
120 rhnuuid=7d2bee48-99b6-11d8-83df-000475ffe7a6
121 ----
122
123 where +rhnuuid+ contains a unique identifier that matches your system. You can
66f63e0 @zyv docs: add a ready to use command to generate up2date-uuid on RHEL5/6
zyv authored
124 create this file by running:
97e75df @dagwieers Updates
authored
125
66f63e0 @zyv docs: add a ready to use command to generate up2date-uuid on RHEL5/6
zyv authored
126 ----
127 UUID=$(uuidgen) ; /bin/echo -e "uuid[comment]=Universally Unique ID for this server\nrhnuuid=$UUID" > /etc/sysconfig/rhn/up2date-uuid
128 ----
97e75df @dagwieers Updates
authored
129
130 == List of RHN channels
b13ed51 @dagwieers Changing Depo into mrepo.
authored
131 For a complete and up-to-date list of available channels, check the RHN
abd2a40 @dagwieers Update documentation
authored
132 website. Here is a list of what we encountered, please send in more.
133
134 RHEL6 Server
135 rhel-$arch-server-6
136 rhel-$arch-server-ha-6
137 rhel-$arch-server-lb-6
138 rhel-$arch-server-optional-6
139 rhel-$arch-server-rs-6
140 rhel-$arch-server-supplementary-6
141
142 RHEL5 Server
143 rhel-$arch-server-5
144 rhel-$arch-server-fastrack-5
145 rhel-$arch-server-hts-5
146 rhel-$arch-server-supplementary-5
147 rhel-$arch-server-vt-5
148 rhel-$arch-server-productivity-5
149 rhn-tools-rhel-$arch-server-5
150
151 RHEL4 AS
152 rhel-$arch-as-4
153 rhel-$arch-as-4-beta
154 rhel-$arch-as-4-extras
155 rhel-$arch-as-4-extras-beta
156 rhel-$arch-as-4-hwcert (only for AS)
157 rhel-$arch-as-4-sdk
158 rhel-4-as-$arch-rhaps-2
159 rhel-4-as-$arch-rhaps-2-beta
160 rhel-4-as-$arch-rhds-2.1
161 rhel-4-as-$arch-rhds-2.1-beta
162
163 RHEL3
164 rhel-$arch-as-3
165 rhel-$arch-as-3-beta
166 rhel-$arch-as-3-devsuite
167 rhel-$arch-as-3-devsuite-beta
168 rhel-$arch-as-3-extras
169 rhel-$arch-as-3-extras-beta
170 rhel-$arch-as-3-hwcert (only for AS)
171 rhel-3-as-i386-rhaps-1 (only for i386)
172 rhel-3-as-$arch-rhaps-beta
173 rhel-3-as-i386-rhds-2 (only for i386)
174
175 RHEL2.1
176 redhat-advanced-server-i386 (only for AS)
177 redhat-ent-linux-i386-es-2.1 (only for ES)
178 rhel-i386-XX-2.1-beta
179
180 Please send me updates on these.
b13ed51 @dagwieers Changing Depo into mrepo.
authored
181
182
97e75df @dagwieers Updates
authored
183 == Ignore packages you already have elsewhere
b13ed51 @dagwieers Changing Depo into mrepo.
authored
184 This is possible, although hard to implement currently. I could check
185 whether the file exists on one of the ISOs (or in the RPMS/ directory),
186 but I prefer to implement this after a redesign.
187
188 You can simply get the same effect with the following script, clean.sh:
189
190 ----
191 #!/bin/bash
192
193 dists=$*
61777b3 @dagwieers Finalize rename to mrepo
authored
194 srcdir=/var/mrepo
195 wwwdir=/var/www/mrepo
b13ed51 @dagwieers Changing Depo into mrepo.
authored
196
197 if [ -z "$dists" ]; then
198 cd $srcdir
199 dists=rhel[2-4][aew]s-*
200 cd -
201 fi
202
203 for dist in $dists; do
204 echo "Cleaning up $dist"
205
abd2a40 @dagwieers Update documentation
authored
206 ### Remove dangling links
207 for link in $(find "$srcdir/$dist/updates" -type l); do
208 if [ ! -r "$(readlink $link)" ]; then
209 rm -f $link
210 fi
211 done
b13ed51 @dagwieers Changing Depo into mrepo.
authored
212
abd2a40 @dagwieers Update documentation
authored
213 ### Relink existing files
b13ed51 @dagwieers Changing Depo into mrepo.
authored
214 for rpm in $wwwdir/$dist/disc?/RedHat/RPMS/*.rpm; do
215 file="$(basename $rpm)"
216 dstfile="$srcdir/$dist/updates/$file"
217 ln -sf "$rpm" "$dstfile"
218 done
219 done
220 ----
221
222 Run this script when you download new RHEL ISO files and make these available
61777b3 @dagwieers Finalize rename to mrepo
authored
223 in mrepo, but before downloading any updates from RHN.
b13ed51 @dagwieers Changing Depo into mrepo.
authored
224
97e75df @dagwieers Updates
authored
225 $ mrepo --umount
226
227 Then download new ISO files and modify the mrepo config file(s) to reflect
228 this change. And then do:
229
230 $ mrepo -v
231 $ ./clean.sh
232 $ mrepo -uvg
b13ed51 @dagwieers Changing Depo into mrepo.
authored
233
234 This will free up some space by symlinking duplicate RPM packages from the ISO
235 files on top of the RPM packages on disk. As a side-effect it will also prevent
236 the new updates from being downloaded. You can also remove _all_ packages from
237 the updates repository prior to doing this.
238
239
97e75df @dagwieers Updates
authored
240 == rhn:// and rhns:// URL schemes
b13ed51 @dagwieers Changing Depo into mrepo.
authored
241 The default scheme for RHN is rhns:// (HTTPS), but it was reported that
242 in some cases (related to proxies or firewalls) the HTTPS connections
243 fail, so there is a need to allow for HTTP connections. You can specify
244 this by using the rhn:// scheme instead of rhns://
245
246 In this case, the authentication is not done using SSL either !
247
248
97e75df @dagwieers Updates
authored
249 == Using Red Hat satellite servers
b13ed51 @dagwieers Changing Depo into mrepo.
authored
250 You can override the hardcoded RHN server by specifying it in the URL.
61777b3 @dagwieers Finalize rename to mrepo
authored
251 If it is not specified, mrepo will assume a default value of
b13ed51 @dagwieers Changing Depo into mrepo.
authored
252 xmlrpc.rhn.redhat.com
253
254 So the following two lines are identical:
255
abd2a40 @dagwieers Update documentation
authored
256 updates = rhns:///rhel-i386-as-4
257 updates = rhns://xmlrpc.rhn.redhat.com/rhel-i386-as-4
b13ed51 @dagwieers Changing Depo into mrepo.
authored
258
259 And you can use a satellite server by doing:
260
abd2a40 @dagwieers Update documentation
authored
261 updates = rhns://your.own.satellite/rhel-i386-as-4
b13ed51 @dagwieers Changing Depo into mrepo.
authored
262
263
97e75df @dagwieers Updates
authored
264 == Using a single systemid
b13ed51 @dagwieers Changing Depo into mrepo.
authored
265 You can experiment with using a single systemid for multiple dists
97e75df @dagwieers Updates
authored
266 using the +rhnrelease+ directive:
b13ed51 @dagwieers Changing Depo into mrepo.
authored
267
268 ----
269 [rhel3as]
270 rhnrelease = 3AS
271 ----
272
273 This way you override the OS release that is in the systemid file.
274
275 This works across the same entitlement. Eg. when you have an Advanced
276 Server entitlement, you can download from 2.1AS, 3AS and 4AS channels.
277 But not from the ES or WS channels and not from different architectures.
278
279
97e75df @dagwieers Updates
authored
280 == RHN documentation and references
b13ed51 @dagwieers Changing Depo into mrepo.
authored
281 A useful list of RHN references:
282
abd2a40 @dagwieers Update documentation
authored
283 Red Hat: RHN XMLRPC API
284 https://rhn.redhat.com/rpc/api/errata/
b13ed51 @dagwieers Changing Depo into mrepo.
authored
285
abd2a40 @dagwieers Update documentation
authored
286 kickstart-list: RHN XMLRPC API
287 https://www.redhat.com/archives/kickstart-list/2005-December/msg00021.html
b13ed51 @dagwieers Changing Depo into mrepo.
authored
288
abd2a40 @dagwieers Update documentation
authored
289 RHbz 162210: [RFE] New up2date command-line options
290 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=162210
b13ed51 @dagwieers Changing Depo into mrepo.
authored
291
abd2a40 @dagwieers Update documentation
authored
292 RHbz 179721: [RFE] No documentation for (RHN) up2date XMLRPC API methods
293 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=179721
b13ed51 @dagwieers Changing Depo into mrepo.
authored
294
61777b3 @dagwieers Finalize rename to mrepo
authored
295 And how to configure mrepo for RHN access:
b13ed51 @dagwieers Changing Depo into mrepo.
authored
296
abd2a40 @dagwieers Update documentation
authored
297 Installing YAM 0.8.0 on Red Hat Enterprise Linux 4
298 http://wiki.garylaw.net/doku.php?id=technical:unix:linux:yam
b13ed51 @dagwieers Changing Depo into mrepo.
authored
299
97e75df @dagwieers Updates
authored
300 // vim: set syntax=asciidoc:
Something went wrong with that request. Please try again.