Installing/updating ports on computer without internet connection.

Ryan Schmidt ryandesign at macports.org
Mon Jan 26 16:59:38 PST 2009


On Jan 26, 2009, at 12:34, Ivan Kawaler wrote:

> I have MacPorts installed, along with a number of packages, on a  
> computer that was connected to the internet.  I would like to  
> install additional packages and update the ones installed, but this  
> machine is no longer connected to the internet.  Is it possible to  
> download the packages on one machine and transfer them to the other  
> via flash drive to be compiled/installed?  What would this entail?

Yes. You'll need to update the offline machine's ports tree, and copy  
over the distfiles for any software you want to install or update there.

To update the ports tree:

Using your online machine, download http://www.macports.org/files/ 
ports.tar.gz and copy it to the offline machine. Replace the contents  
of the directory /opt/local/var/macports/sources/rsync.macports.org/ 
release/ports with the contents of the archive.

To get the needed distfiles:

Using the online machine, update your ports tree as well, using "sudo  
port sync" or the same method as above. Now decide which ports you  
want to install or update on the offline machine. For each port x,  
run "sudo port fetch x" on the online machine. If port x is installed  
(or will be installed) with variants on the offline machine, specify  
those variants when fetching, e.g. if you want to install port x with  
the +docs variant, run "sudo port fetch x +docs" to ensure that any  
variant-specific distfiles get fetched as well. This will download  
the distfiles for port x into /opt/local/var/macports/distfiles/x  
from which you can copy them to the same location on the offline  
machine.

It may be that port x has dependencies on ports y and z which are not  
installed on the offline machine. If so, the offline machine will  
fail when trying to download the distfiles for y and z. If you can  
anticipate this, use "sudo port fetch y z" to fetch those distfiles  
too. Otherwise, just start installing on the offline machine. If it  
fails trying to download something, you'll know what you need to copy  
over next.

It might be worthwhile to turn this into a How-To in the wiki...

http://trac.macports.org/wiki/howto




More information about the macports-users mailing list