• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

A mini-FAQ on pkg

Status
Not open for further replies.

IT_Architect

Member

Thanks: 4
Messages: 86

#26
WOW! Great thread! To summarize I learned not only what I learned here but:
- Ports with the default options gets you the same options as a binary package
- poudriere is port-based and creates packages for distribution, so it is a massive time saver if you have multiple similarly configured systems. On a single computer, poudriere can build ports with multiple configurations, in multiple jails, and from different port trees as separate sets. HOWEVER, it also makes sense for one-offs or two-offs because it enables you to compile everything on a production server without changing updating anything so that you can update it with the generated packages quickly at a time of your choosing.
- Portmaster vs. PortUpgrade have their pros and cons, making it not so easy to decide. The manual actually has a great discussion comparing both. It provides a lot of context for what you read on the web to arrive at a conclusion that you will be certain of why you went with the one you ultimately choose.
 

IT_Architect

Member

Thanks: 4
Messages: 86

#28
In addition, the handbook is incomplete in that it doesn't mention Synth at all, and Synth is at the same level of Poudriere, however there is a man page: synth(1)
...and from reading, it may be simpler and better in many cases. "it will create local package respositories and install pkg(8) repository configuration file that causes locally built packages to be used with the highest priority, all while allowing the system to fully upgraded with a single command." So to me that is saying, you can have a stub set of custom packages maintained by Synth and it will go to the repository for the others. I've seen that functionality asked for in my Googling.
 
A

ASX

Guest


#29
So to me that is saying, you can have a stub set of custom packages maintained by Synth and it will go to the repository for the others.
I will fix this for you:
Code:
you can have a set of custom packages and the remaining packages will be built with the default options
The fact is that Synth will build a "full repository" based on the packages you have installed, and yes, that is simpler than any other tools. Mixing ports (or packages built from ports) and packages from FreeBSD repository is discouraged, because they are built against different versions of the ports tree, and possibly using different or conflicting options.
 

IT_Architect

Member

Thanks: 4
Messages: 86

#30
I will fix this for you:
Got it! It would seem for that to work, the ports that you want the defaults for would have to have never been generated custom before, because ports remembers, and I should cure that by deleting the entire ports tree and starting over?
Mixing ports (or packages built from ports) and packages from FreeBSD repository is discouraged, because they are built against different versions of the ports tree, and possibly using different or conflicting options.
I've hawked a lot of threads going back and forth about mixing things but that one statement makes things crystal clear.

Thanks TONS!!!
 
A

ASX

Guest


#31
It would seem for that to work, the ports that you want the defaults for would have to have never been generated custom before, because ports remembers, and I should cure that by deleting the entire ports tree and starting over?
No, you don't need to delete the port tree, you will need to delete only the port options which are saved in /var/db/ports.
 

IT_Architect

Member

Thanks: 4
Messages: 86

#32
No, you don't need to delete the port tree, you will need to delete only the port options which are saved in /var/db/ports.
WOW! This is the first time in all these years that I'm actually beginning to understand what is going on with FreeBSD ports and packages. This is awesome!
 
A

ASX

Guest


#33
I would add a point to the mini-FAQ:

12 - "quarterly" vs. "latest" repository and "quarterly" vs. "head" port branch.

I started using FreeBSD version 10.0-RELEASE, at that time the default repository was "latest", same for 10.1-RELEASE.

From 10.2-RELEASE onward the default repository is set to "quarterly", "latest" is available but the system need to be configured to make use of "latest" repository.

A generic reference to"ports tree" is usually intended as the "head" branch of the port tree, it match the "latest" FreeBSD pkgs repository, and that "conflict" with pkgs default repository which instead is based on "quarterly" branch.

Users who want to build from ports, should be informed that to match the default FreeBSD repository ("quarterly") they should clone the "quarterly" branch of the port tree.

Additionally all this is not enough clear from reading the handbook, (I underdstand that probably those parts of the handbook and this mini-FAQ has been written before 10.2-RELEASE ...).
 

IT_Architect

Member

Thanks: 4
Messages: 86

#34
"quarterly" vs. "latest" repository and "quarterly" vs. "head" port branch.
Oh WOW! This thread is gold, and not knowing these things are what make good technical people throw their hands up. Let me make sure I have this straight.

Either people need to use the default packages repository and the quarterly version of ports, or they need to use the latest ports, and the latest packages, but the defaults are for packages to use quarterly, and the portsnap to fetch the latest. Nice (tic). That begs the question, how do we change the defaults to where either ports picks up quarterly, or the repository picks up the latest so they by default in-sync?

Thanks TONS!!!
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,873
Best answers: 6
Messages: 26,461

#35
That begs the question, how do we change the defaults to where either ports picks up quarterly, or the repository picks up the latest so they by default in-sync?
To configure pkg(8) to pick up the 'latest' packages instead of 'quarterly', create a file /usr/local/etc/pkg/repos/FreeBSD.conf:
Code:
FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest" }
Nothing else needs to be done or edited.
 
A

ASX

Guest


#36
to get the "head" branch of port tree use either:
Code:
cd /usr/ports
svnlite checkout http://svn.freebsd.org/ports/head
or
Code:
portsnap fecth extract
to perform subsequent updates of the port tree use respectively:
Code:
svnlite update /usr/ports
or
Code:
portsnap fetch update
to get the 2017 Q1 "quarterly" branch use:
Code:
cd /usr/ports
svnlite checkout http://svn.freebsd.org/ports/branches/2017Q1
and to update the port tree:
Code:
svnlite update /usr/ports
available branches are listed here: http://svn.freebsd.org/ports/branches/
 

IT_Architect

Member

Thanks: 4
Messages: 86

#38
- I assume FreeBSD pulls the versions currently installed from the pkg database, but where does FreeBSD pull its information to know what needs to be updated?

Thanks!
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,873
Best answers: 6
Messages: 26,461

#39
If a ports tree is installed pkg(8) can use the /usr/ports/INDEX-* file to compare versions; pkg version -vI. If that doesn't exist it will fetch digests.txz, meta.txz and packagesite.txz from the repository and stores it locally as /var/db/pkg/repo-<name>.sqlite. Then it's simply a matter of comparing versions and some clever bits trying to resolve dependencies.
 

IT_Architect

Member

Thanks: 4
Messages: 86

#40
Got it! Understanding HOW THINGS WORK is far more useful that instructions on how to do it. How things work answers thousands of questions and prevents much lost time and frustration. Your answer then also points out that it makes more sense than ever to make sure that ports and packages are both on the same page, either "quarterly" or "latest", or not having ports on your system at all if you decide to go packages.
 

getopt

Well-Known Member

Thanks: 294
Messages: 494

#43
Only the most recent "quarterly" packages repository is available.
Besides the "quarterly" repository there is still the "latest" repository. For whatever reason "quarterly" has been set as default in /usr/local/etc/pkg/repos/FreeBSD.conf causing problems for many. Just change the string there and be a little more happy.
 

IT_Architect

Member

Thanks: 4
Messages: 86

#44
No, not that I'm aware of. Only the most recent "quarterly" packages repository is available.

Besides the "quarterly" repository there is still the "latest" repository. For whatever reason "quarterly" has been set as default in /usr/local/etc/pkg/repos/FreeBSD.conf causing problems for many. Just change the string there and be a little more happy.
From what I read, the default to quarterly started in FreeBSD 10.? My theory as to why is:
- With packages, by setting them to "quarterly", users will be installing packages of the same date-time set, and thus they will be compatible. The only exception is during a quarter change. That is far less likely than with "latest".
- With ports, you also always have a set of the same date-time group, so latest is based on the latest ports tree you have downloaded.
- I agree, the best way to have things go well when you mix them is to set packages to "latest" and update ports before doing software updates. One has to do that anyway when you have out-of-date packages on the system. Being more up to date is also a plus.
- I hate all of the time ports requires. I am thinking about putting this next system together using the "latest" packages as much as I can, and maintaining it with ports, either directly, or using Synth.

Thanks TONS!
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,873
Best answers: 6
Messages: 26,461

#45
The rational behind the quarterly branch has to do with stability. Traditionally the ports tree and, as a consequence, the packages were more or less a "rolling release". Meaning something was always out of date, things broke from time to time, etc. By "freezing" the versions every quarter the number of updates remains relatively low. The only updates that will happen are due to security, build or runtime issues. For production systems this is the best option. Which is why it's now the default.

https://lists.freebsd.org/pipermail/freebsd-ports-announce/2014-April/000079.html

It's mostly for new users. Hardcore FreeBSD users tend to build their own repositories anyway.
 

IT_Architect

Member

Thanks: 4
Messages: 86

#46
The rational behind the quarterly branch has to do with stability...The only updates that will happen are due to security, build or runtime issues. For production systems this is the best option.
That is very good to know. Since you have to request ports by specifying the quarter to prevent getting "latest", I wonder if there is an easy way to test what the latest quarter available is, so the command to fetch the ports for latest quarter can be automatically amended to pickup the latest quarter in order to remain in-sync with the packages? It seems it happens two or three days after the new quarter begins?

Thanks TONS!!!
 

IT_Architect

Member

Thanks: 4
Messages: 86

#47
...to get the 2017 Q1 "quarterly" branch use:
Code:
cd /usr/ports
svnlite checkout http://svn.freebsd.org/ports/branches/2017Q1
and to update the port tree:
Code:
svnlite update /usr/ports
If do the update, will I get updated to "latest" or will it update to the latest for 2017Q1? (since quarterlys do receive security updates)
Edit:
I assume I still need to do:
portsdb -Uu
pkgdb –F
 
Status
Not open for further replies.
Top