| Andrew Stacey | |||
|
|
Fri, 9th Mar 2007 (HowDidIDoThat :: MacOSX) Updating Fink Offline Having figured out how to keep a Ubuntu machine up to date without connecting it to the internet, I'd like to be able to do the same for the fink installation on my iBook. It's not too hard, but there doesn't seem to be a single set of instructions for how to do it so I've gathered together the necessary steps here.
The output of fink --version starts:
And my fink.conf contains the following lines:
My iBook is running the latest version of Tiger (10.4.8 at time of writing)
and has Xcode 2.2.1.
The fink package manager is based on the Debian one, as is the Ubuntu package manager. So the general method of keeping a machien up to date is the same: download the package information, use the local package manager to select packages but instead of trying to download them just tell you which ones to download (and hopefully where to do it), go and get said packages, put them in a reasonable place, then tell the local package manager to install them. Step One: Updating the InformationThis is actually very easy; even easier than it was for Ubuntu. The first step is to download the package information:
Obviously, change the mirror to one that suits and the final finkinfo to wherever you want to download the files to; the
above will copy the remote directory 10.4 into the
local directory finkinfo. By default, rsync only downloads the files that have been modified
compared to the current versions (based on file size and modification time) so
you use the same command to update an existing set of the package information
as you do for the original download. So I maintain a copy of this on my
machine that is permanently connected to the internet.
Note: in one of the bits of scattered documentation is the implication that one can download a tar-ball of the package information. I couldn't find such a tar-ball. Of course, if one exists then that is a simpler method of getting hold of it. Having downloaded the package information, transfer it to the MacOSX machine and stick it somewhere temporary. Step Two: Updating the Package InformationThis is the really easy step and is what makes the fink update even easier than the Ubuntu one. The fink team have written a little perl script to do the update. At the top of the download (in finkinfo/10.4 if you've used the exact same syntax as I did above) is a little script called inject.pl. The next step is to run this script so go to the directory where it is and run:
The /sw should be changed to wherever you put fink but that's the default. It will try to find a fink installation if it can but it's probably best to tell
it explicitly where it is. It will also do a few sanity checks to make sure
that it is okay to update the information.
The advantage of doing it this way rather than just copying the files over is that the inject.pl script does a bit of housekeeping as well which means that next time you are connected to the internet and are able to properly update fink then everything works as it should. (At least, I assume that this is why it does the little extras, I haven't actually tried this yet). Step Three: Updating and Installing PackagesAs inject.pl finishes, it tells you to do two things:
But of course, these won't work without an internet connection. The solution
is the fetch option.
Here you have a choice. If you want to use the latest packages, regardless of whether they are binary or source, then life is a little simpler in that fink will automatically choose this option given just the basic name of the package. On the other hand, if you prefer to use the latest binary package regardless of whether or not there is a more up to date source package then life is a little more complicated. The first thing to do is get a list of all the packages that are out of date on your system. This is straightforward:
I Prefer BinariesWe next need to check whether or not there is a later binary version. Life gets complicated here because not all packages have binary versions. My rules are:
The implementation of all the above is
I Want the LatestAs shall be noted below, even if you want the latest packages regardless of whether they are available as binary or not, it is still necessary to sort out the binaries from the sources. The only time that you don't need to do this is if you never download binaries. In that case, skip this step and in the next step ignore anything involving binaries and use fink_out_of_date instead of fink_out_of_date_sources. If you are still reading this section then you want to use the most up to date package available, but if it happens to be available as a binary then you'd rather use the binary than the source. Generally this would be to save time in installation. Then we do a dry-run of trying to fetch those files. Note, we want the output to go to both the screen, since there may be questions that need answering, and a file, for further processing. With zsh this is easy.
The two files now list where to get the packages from, together with some other useful information such as md5sums. The sources file contains a long list of places where the packages can be found. This is, quite frankly, ridiculous. So these two files need a bit of post-processing to put them into a useable form. By "usable form", I mean a script that downloads the packages. The binaries one is easiest.
For the sources, we may as well use the fact that we have all those options
but it is a bit ridiculous to use them all. Fink
tends to give up after about four goes so that seems a reasonable limit. We
use the first two and last two.
Obviously, replace wget by whatever you have on the
machine connected to the internet.
Finally, take the two files packages_to_get and package_md5sums to a machine connected to the internet and use them to download the required packages. Installing the Downloaded PackagesOther RemarksSomewhat bizarrely, fink assumes that its package information is in the right place and doesn't do any extra checking. When downloading the package information I found that I had downloaded some information earmarked for the 10.5 distribution (presumably on its way but not yet released). These merrily went into the 10.4 directory structure and fink assumed that they were valid, even though the filename was something like intltool-10.5.info and contained the line
So such files need to be removed, or at least moved to somewhere where they
can't do any damage. I created a 10.5 directory, with structure modelled on
that of the 10.4 tree, and moved any file which seemed to belong to the 10.5
distribution into it (I searched for files containing the Distribution: 10.5 line as not all were so helpfully
labelled as intltool-10.5.info). I then had to run
to rebuild the cache (to make fink do this
automatically next time it was run then touch the
timestamp). After that, it merrily ignored packages for the 10.5
distribution.
[Full link] |
||