question about ports and pkg install software in freebsd14.3 ?

dear all:
i am new guy in freebsd . i have saw some user told me , we can't use pkg install app and ports install app in the same time. is that right ?
most time i have used pkg install app ...but some app i need install it from github.com ... so that will cause my system get problem ?

1. install all app from pkg ..or install all app from ports .........in one system.. no two tiger live in one mountian ? is right ?
2. can install app from pkg and ports in the same time in same machine ?


thanks.
 
You can use pkg and ports if you want. You need to remember, though, that packages are built from quarterly, i.e. 2025Q2, while ports are generally built from HEAD. You could build ports from quarterly but then again, why?

The trouble you may have with mixing ports and packages is that packages will depend on older prerequisites that have been updated in HEAD. You'll find yourself in a cascading scenario of updating more than you had originally planned. Then the question you'd need to answer is, is all this work worth the trouble or should I wait three months or less for the latest <whatever> to show up in the latest quarterly and binary packages?
 
Precisely, pkg has both latest (aka main or head) and quarterly.
Releases (including releng) defalts to quarterly and others (main [aka Current] and stable) defaults to latest. This defaults can be switched by editing /etc/pkg/FreeBSD.conf or copy into /usr/local/etc/pkg/repos/ and edit it.
And ports can be switched to quarterly using git, too. But if you prefer quarterly, you need to switch to newer quarterly once new one is branched.

If you want to mix up ports and pkg, you need to
  • make both to be on the same branch,
  • and checkout ports with the same commit as the newest pkg you have,
  • make sure that if anything built with ports depends on anything installed via pkg should be aware that options used for official pkg are all default
to be safe.
 
most time i have used pkg install app ...but some app i need install it from github.com ... so that will cause my system get problem ?
Nah, grabbing something from a Github repository (and thus outside the whole package infrastructure) so that you can build it yourself won't affect your machine at all. The main problems only occur from mixing ports & packages; so both methods of installing.

1. install all app from pkg ..or install all app from ports .........in one system.. no two tiger live in one mountian ? is right ?
This is by far the safest way to go about it, yes. The 'why' has already been explained above. There are of course some exceptions to the rule, "sort off". Some ports only depend on specific libraries and not much else. Or they don't depend on anything specific at all. It won't become too much of an issue to install those using the package system while you build the rest yourself.

But even then... 'stuff' can always happen, and it's much safer to stick with only one method.

I prefer using the ports collection myself, and the only time when I rely on binary packages is to provide a backup server with the same kind of packages that I've already build. In other words: when using my own package repository; there's not much gain from building the same stuff on 2 servers afterall.
 
You can use pkg and ports if you want. You need to remember, though, that packages are built from quarterly, i.e. 2025Q2, while ports are generally built from HEAD. You could build ports from quarterly but then again, why?

The trouble you may have with mixing ports and packages is that packages will depend on older prerequisites that have been updated in HEAD. You'll find yourself in a cascading scenario of updating more than you had originally planned. Then the question you'd need to answer is, is all this work worth the trouble or should I wait three months or less for the latest <whatever> to show up in the latest quarterly and binary packages?
Dear cy@ :
thanks for your help . can you tell me what is HEAD ? i am new guy. thanks.
 
Precisely, pkg has both latest (aka main or head) and quarterly.
Releases (including releng) defalts to quarterly and others (main [aka Current] and stable) defaults to latest. This defaults can be switched by editing /etc/pkg/FreeBSD.conf or copy into /usr/local/etc/pkg/repos/ and edit it.
And ports can be switched to quarterly using git, too. But if you prefer quarterly, you need to switch to newer quarterly once new one is branched.

If you want to mix up ports and pkg, you need to
  • make both to be on the same branch,
  • and checkout ports with the same commit as the newest pkg you have,
  • make sure that if anything built with ports depends on anything installed via pkg should be aware that options used for official pkg are all default
to be safe.
DEar T-Aoki :
thanks for your help . can you tell me what branch i can used ? do they have list ? how to find brach with ports ? thanks .
 
Nah, grabbing something from a Github repository (and thus outside the whole package infrastructure) so that you can build it yourself won't affect your machine at all. The main problems only occur from mixing ports & packages; so both methods of installing.


This is by far the safest way to go about it, yes. The 'why' has already been explained above. There are of course some exceptions to the rule, "sort off". Some ports only depend on specific libraries and not much else. Or they don't depend on anything specific at all. It won't become too much of an issue to install those using the package system while you build the rest yourself.

But even then... 'stuff' can always happen, and it's much safer to stick with only one method.

I prefer using the ports collection myself, and the only time when I rely on binary packages is to provide a backup server with the same kind of packages that I've already build. In other words: when using my own package repository; there's not much gain from building the same stuff on 2 servers afterall.
DEar ShelLuser
thanks for your help . i have read you guide about pkg and ports before i ask question .

i am not full got the key , so i ask question . keep study . thanks.
 
DEar T-Aoki :
thanks for your help . can you tell me what branch i can used ? do they have list ? how to find brach with ports ? thanks .
For pkg, you can choose latest or quarterly.
Packages for latest are built using main branch of ports repo, and packages for quarterly are built using latest quarterly branch (currently, 2025Q2) of ports repo. Older quarterly branches (i.e., 2025Q1, 2024Q4,...) are no longer used for official pkg repo.

For ports using official git repo, you can choose whichever branches available. Usually, tracking main or latest quarterly branch (currently 2025Q2). Note that if you choose to track quarterly, you need to manually switch branch from previous quarterly to latest quarterly yourself, as no branch named "quarterly" exist in git repo.

The name "quarterly" is used in convenience for pkg users.
 
Back
Top