Do I want to switch to the new pkg(8) format?

Andrew Berg aberg010 at my.hennepintech.edu
Sat Dec 27 01:07:17 UTC 2014


On 2014.12.26 18:30, Chris Stankevitz wrote:
> Thank you all for your help.  A summary:
> 
> 1. Packages can be installed from "source ports" or "binary packages".
> -- actually I knew that all along but thank you to you all for remind
> me so many times.
You are still thinking of ports and packages as separate things. You can
install binary packages that you have built yourself using ports tools, or you
can install binary packages that someone else has built using ports tools. You
are using pkg to track what you have installed regardless, and it does not
really care where the package came from. If you run 'make package' and someone
else installs that package, do you think it is a "binary package" or a "source
port"?
All (tracked) third-party software comes from packages, and all packages are
built from ports. It does not matter whether the packages are distributed or not.
> 
> 2. To install a binary package use "pkg"
Yes.
> 
> 3. To install a "source port" use "make"
Kind of. To perform various stages of port building, use make. There are a
bunch of targets that do different things. 'make install' does all the stages,
including installing the package at the end. It calls pkg to both create and
install said package during the process.
> 
> 4. To uninstall a "binary package" use "pkg"
Yes.
> 
> 5. To uninstall a "source port", use "pkg" or use "make deinstall"
Just use pkg, because you are uninstalling a binary package. You can probably
use 'make deinstall', but there isn't really a reason to. It would just call
pkg anyway.
> 
> 6. To upgrade your "source ports" use "portsnap fetch install" and "portmaster".
To update your ports tree, use portsnap or svn(lite). To do various things with
ports, including build and install new binary packages based on updates to the
new ports tree, use portmaster (or portupgrade if that is your preference).
Generally, portmaster removes the need to call make directly. Invoking make
directly to test different stages (or as part of your own script) can be
useful, but for everyday ports building, portmaster works really well.
> 
> 7. To upgrade your "binary packages" use ???? (don't really care...
> but just adding it to be complete)
Same tool you use to do anything with binary packages - pkg.
> 
> 8. To remove unneeded "source ports", use "portmaster -l" or "pkg auto
> remove" (even though this is described in section 5.4 of the handbook
> "Using pkg for Binary Package Management").  Do not use pkg_cutleaves.
portmaster wraps pkg, so you can use it for this, but there is 'pkg autoremove'
to cull packages that were only ever installed as dependencies. To trim any
arbitrary leaf ports, there is ports-mgmt/pkg-rmleaf (a separate tool in ports,
not part of pkg itself).

> 
> 9. Do not use cvs or pkg_ or pkgng
Correct, except, pkgng is the same thing as pkg.
> 
> 10. If you are ever asked "to switch to the new pkg(8) format" say
> YES, even if you are using source ports.
Correct.
> 
> 11. If you are feeling frisky, upgrade your source ports with
> portupgrade instead of portmaster
It's a matter of personal preference, but yes, they do pretty much the same thing.

> And summarized even further:
> 
> - When you want to install a binary package, use pkg
> 
> - When you want to list or remove installed software, whether it was
> installed via source or binary packages use pkg
> 
> - When you want to install or upgrade using source use (portsnap AND
> make AND (postmaster OR portupgrade)).
Correct, except see my comment above about make and portmaster.



More information about the freebsd-questions mailing list