# FreeBSD 11.1  make always goes to internet, not using distfiles



## Derek C Johnstone (Aug 5, 2017)

Hi
I must be doing something stupid, so help would be appreciated.
I have a clean 11.1 install and now need to add some ports (samba44)
I've copied all the packages to distfiles, but they are *.txz files.
make appears to want *.xz files.
So goes off to the internet to get them.
I live out in the sticks, and 2m connection on a good day. 700k when all the kids in town are watching tv.  It takes ages to download.
I need to use the files off the DVD.
What am I doing wrong?
Thanks in anticipation,  Derek


----------



## Deleted member 30996 (Aug 5, 2017)

The ports tree is updated several times a day. The version on your disk may, or may, not be what's current in the ports tree. In addition, net/samba44 has a total of 29 dependencies. Do you know what they are, and are they on your disk?

https://www.freshports.org/net/samba44/

The last time I paid attention to it the ports tree was only 76MB in total. Do yourself a favor and pull the ports tree and do it in the prescribed manner. If the kids are in bed the middle of the night should give you most of the bandwidth and if you use ports-mgmt/portmaster it will gather all the dependencies at the beginning of the build.

Extract the ports tree:
`portsnap fetch extract`

Build ports-mgmt/portmaster:
`cd /usr/ports/ports-mgmt/portmaster
make install clean`

Have it build net/samba44:
`portmaster net/samba44`


----------



## ShelLuser (Aug 5, 2017)

Derek C Johnstone said:


> I've copied all the packages to distfiles, but they are *.txz files.
> make appears to want *.xz files.


There are 2 things to keep in mind here...

The Ports collection itself (/usr/ports) only consists of so called "blueprints" which merely tell the system where to download the source code and how to compile that. After a port has been build it will be packaged into a txz file which will then get installed through pkg (using pkg-add(8) to be exact).

The files which get downloaded, the so called distfiles, are placed in /usr/ports/distfile. But not all of them just jammed into one directory, some reside in sub directories. Also: these are mere archives. Things like (for example): httpd-2.2.34.tar.bz2, subversion-1.9.6.tar.bz2, samba-4.5.10.tar.gz, and so on. This is not something you should mess with yourself.

Next there are also so called binary packages. Pre-compiled which you can easily download and install. These are so called txz files. One way to install these is using pkg-install(8); this will look up a package in an online repository, download and eventually install it.

However... you already have those files. So all you need to do is use `# pkg add package.txz`.

All of this is also explained in the handbook by the way, see this link.

(edit)



Trihexagonal said:


> The last time I paid attention to it the ports tree was only 76MB in total. Do yourself a favor and pull the ports tree and do it in the prescribed manner. If the kids are in bed the middle of the night should give you most of the bandwidth and if you use portmaster it will gather all the dependencies at the beginning of the build.


While the ports tree maybe small, the same cannot be said for all the source code which it will download to build against. All of that is not included with the download which you suggest here. 

But most of all: why would he want to install the ports collection if he already seems to have a bunch of binary packages on this DVD?


----------



## Deleted member 30996 (Aug 5, 2017)

ShelLuser said:


> While the ports tree maybe small, the same cannot be said for all the source code which it will download to build against. All of that is not included with the download which you suggest here.



Now if the ports tree included all the source code needed to build ports and dependencies there wouldn't be a need for ports-mgmt/portmaster to gather them from the internet, would there? Or did you miss where I said:



Trihexagonal said:


> If the kids are in bed the middle of the night should give you most of the bandwidth and if you use ports-mgmt/portmaster it will gather all the dependencies at the beginning of the build.






ShelLuser said:


> But most of all: why would he want to install the ports collection if he already seems to have a bunch of binary packages on this DVD?



A "bunch of binary packages" does not mean he has all 29 dependencies on his DVD. If you, in your infinite wisdom, can guarantee that he does and the build won't fail, then he won't need to install the ports tree.


----------



## SirDice (Aug 7, 2017)

Derek C Johnstone said:


> I've copied all the packages to distfiles, but they are *.txz files.


Packages and distfiles are two completely different things. Ports use distfiles (the original source code) and local patches to create FreeBSD specific packages.


----------



## Derek C Johnstone (Aug 8, 2017)

Hi All
Thanks for that.It seem I've been misled into thinking that the 3G .iso DVD image file would mean I could install the packages in stand alone mode.  How wrong it has turned out to be.  Even the files listed in the packages don't exist on the DVD "All" directory, or flag up as the wrong size.   It seems a waste of the developer's time building the DVD release.  I trusted that the DVD would contain all I needed, but WRONG !!!
I've had to just accept that it takes ages to load any package.  But at least as I go along, some of the distfiles are now correct.
Thanks for your help.  Regards Derek


----------



## jef (Aug 8, 2017)

Using pkg(7) may be a better option for you, as it downloads pre-compiled binaries. In most cases, the binaries are significantly smaller than the source code and patches required to build them from scratch. By default, the FreeBSD repos are updated quarterly (last I checked), and perhaps when there are significant security updates, so running `pkg upgrade` on the default FreeBSD configuration should be "reasonable" (rather than dozens of minor updates every time).


----------



## SirDice (Aug 8, 2017)

jef said:


> By default, the FreeBSD repos are updated quarterly (last I checked)


There are two repositories, the default quarterly packages and the latest packages. The quarterly branch is split off from the "main" branch every 3 months. During those 3 months only packages that have security or significant stability issues are updated. This is the ideal choice for someone who just want to install it and run without the constant need to update. 

The latest packages try to follow the ports tree as close as possible. I'm not sure what the build rate is at the moment but it should build every port every couple of days. Because of the time it takes to build everything (for every architecture and every supported version!) there will always be a bit of "lag" between the latest ports tree and the latest packages. It's the quickest way to get the latest versions.


----------

