summaryrefslogtreecommitdiff
path: root/posts/2008-06-20-mirror-cpan.org
blob: 3659d410ff2fd85a0f407c6da8210eac5d733d1d (plain) (blame)
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
For the last 10 months, I've been living with no internet connection at
home (not on purpose, but this is another story), so I've tried to be as
much as possible independent from the web. I've started to use git for
being able to work off-line, I use Vim as a wiki on my computer, my blog
engine for writing post off-line, ...

As as perl developer, I use a lot the CPAN. So, I've start to mirror the
CPAN on my computer. Here is how:

First, you will need the minicpan: =cpan CPAN::Mini=.

Then, edit a *.minicpanrc* file and add the following:

#+BEGIN_SRC sh
    local: /path/to/my/mirror/cpan
    remote: ftp://ftp.demon.co.uk/pub/CPAN/
#+END_SRC

And to finish, add this in your crontab:

#+BEGIN_SRC sh
    5 14 * * * /usr/local/bin/minicpan > /dev/null 2>&1
#+END_SRC

Everyday, at 14h05, your cpan will be updated.

Now use the CPAN cli: =sudo cpan= and execute the following command
=cpan[1]> o conf urllist unshift file:///path/to/my/mirror/cpan=

And voilà, I've got my own minicpan on my computer, so I can install
everything when I need it, being off-line or not.