/
usage.txt
191 lines (141 loc) · 6.79 KB
/
usage.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
Usage information for mrepo and a description of the options and config file
============================================================================
mrepo is used to create a repository on your server from multiple sources.
Finding help on the command line
--------------------------------
mrepo -h
usage: mrepo [-g] [-q] [-u] [-v] [-c config] dist1 dist2-arch
Set up a distribution server from ISO files
mrepo options:
-c, --config=file specify alternative configfile
-g, --generate generate mrepo repositories
-q, --quiet minimal output
-u, --update fetch OS updates
-v, --verbose increase verbosity (only mrepo info)
-vv, -vvv increase verbosity more
--unmount unmount distributions
When you first run mrepo, do:
mrepo -v
This will show you what it is doing. You may add extra -v at any time
to see more of mrepo's internals.
mrepo -vvv
Now, you may want to change the default mrepo.conf to your needs and
add or remove distributions and/or repositories. If you have ISO
images of any of the distributions you want to mirror, mention them
too like in the examples, and copy them over to /var/mrepo/iso
(You can also decide to put them per distribution/arch)
The default directory structure that mrepo uses is explained in
README.dirs
mrepo by default will mount as many ISO files as possible. If you
have problems with the maximum number of loop devices, please read
README.loop
mrepo can also download the distribution RPM packages if you want to,
if you did not specify any ISO images it will download any os or core
repositories that you have specified. To do that, do
mrepo -u
or
mrepo -uv
To finally generate a complete working repository based on the
repositories, you need to issues:
mrepo -g
or
mrepo -gv
This will look for all the necessary packages in /var/mrepo (srcdir) and
symlink them to /var/www/mrepo (wwwdir). /var/www/mrepo can also be removed
at any time and should not contain any files you have put there yourself.
To start off from scratch, first unmount the ISO images by doing:
mrepo --unmount
and then remove /var/www/mrepo completely. This should never be needed,
but can be done after you played around or when removing components.
If you want to update only a part of your repository, you can select
the distributions by doing:
mrepo -ugv fc2
or
mrepo -ugv fc2-i386
or even
mrepo -ugv fc2-i386 fc1-x86_64
If you want to have multiple setups of mrepo running on a single system
(say one of your users wants its own setup), you can specify an
alternative config file, by doing:
mrepo -c /home/dag/mrepo.conf
In that case the user may want to use another srcdir and wwwdir.
Finally, you can see if everything worked, by looking at /var/www/mrepo
(wwwdir) or by surfing to http://localhost/mrepo/. For more information
about web-access and configuration, see README.web
The mrepo.conf file
-------------------
mrepo.conf file holds all the information mrepo uses to find the repos such
as distribution information and URLs to the repos. mrepo.conf is essentially
divided into three areas. main, repos, and dist.
The main area is your main configuration for mrepo.
Example from default mrepo.conf:
[main]
srcdir=/var/mrepo
wwwdir=/var/www/mrepo
metadata=apt repomd
arch=i386
The srcdir is where mrepo will download and store the files for your repo
The wwwdir is the location as to where your users for your repo will actually
get the files from. These are symbolic links to the srcdir.
The metadata is a list of metadata repositories you want to create. This
defined the default used if nothing is specified per distribution.
arch is a list of the default architectures, i.e. i386, x86_64.
This will set it globally but can be configured per distro.
The distro area of mrepo.conf is the heart of mrepo.conf it is where you can
specify the exact distribution and URLs to download from. Let me demonstrate
with a little example:
[fc3]
name = Fedora Core $release ($arch)
release = 3
arch = i386 x86_64
iso = FC$release-$arch-disc?.iso
core = rsync://ayo.freshrpms.net/pub/freshrpms/pub/freshrpms/ayo/fedora/linux/$release/$arch/RPMS.$repo/
updates = rsync://ayo.freshrpms.net/pub/freshrpms/pub/freshrpms/ayo/fedora/linux/$release/$arch/RPMS.$repo/
rpmforge = rsync://apt.sw.be/pub/freshrpms/pub/dag/fedora/$release/en/$arch/RPMS.dag/
freshrpms = rsync://ayo.freshrpms.net/pub/freshrpms/pub/freshrpms/ayo/fedora/linux/$release/$arch/RPMS.$repo/
newrpms = rsync://newrpms.sunsite.dk/projects/newrpms/www/htdocs/apt/redhat/en/$arch/fc$release/RPMS.$repo/
The section name [fc3] is your dist tag and you can change it to fit your needs.
Other tags you can include per section are:
name = is a description for this distribution ($name)
release = is the release version of your distribution ($release)
metadata = is a list of metadata you want for this repo
arch = is set to one or more architectures available for this distribution ($arch)
iso = is set to one or more globs matching the distributions ISO images
Any other entries are considered to be repositories. mrepo will assume that
repositories called 'os', 'core' and 'updates' are base system repositories
and these will be updated with mrepo option -u . os and core repositories will
be ignored when ISO images are available.
Other entries are considered extra (3rd party) repositories. mrepo will create
a separate directory for each of these in /var/mrepo/$dist-$arch/$repo
The LHS part can also be used in the RHS as variable $repo
Other special variables include:
$srcdir is set to the srcdir variable from mrepo.conf
$dist is set to the distribution section name (eg. fc2)
$arch is set to the architecture within this section context
$nick is set to $dist-$arch within this section context
$repo is set to the current repo-name within this repo context
mrepo can use several types of protocols or URL identifiers:
<empty> - use the directory in $srcdir/$dist-$arch/$repo
mrepo:// - handled by mrepo, equivalent to file://$srcdir/
file:// - handled by mrepo, symlink to other directory containing RPMS
fish:// - handled by lftp
ftp:// - handled by mirrordir or lftp
http:// - handled by lftp
https:// - handled by lftp
mc:// - handled by mirrordir
rhn:// - handled by up2date python classes
rhns:// - handled by up2date python classes
rsync:// - handled by rsync
sftp:// - handled by lftp
Metadata for repositories
-------------------------
Depending on what repositories you want to generate, you can install
a combination of these packages:
keyword description package
""""""" """"""""""" """""""
apt for apt 0.5.15cnc binary 'genbasedir' inside 'apt' package
yum for yum < 2.4 binary 'yum-arch' inside 'yum' package
repomd for apt >= 0.5.15lorg binary 'createrepo' inside 'createrepo' package
and yum >= 2.4
---
Please send me improvements to this document.