Replacing base commands with pkg versions
phascolarctos at protonmail.ch
Tue Jan 29 12:47:03 UTC 2019
> On 29/01/2019 12:31, Lorenzo Salvadore via freebsd-questions wrote:
> > > What is the recommended way of dealing with the base versions of
> > > commands when installing a package version instead? Should I chmod -x
> > > the base executable(s), delete them or rename them? What happens if I
> > > subsequently do a freebsd-update - do the base executables get
> > > reinstated or are they ignored?
> > > The specific case I'm interested in is unbound under 11.2, but this
> > > applies to a variety of programs (CUPS vs base lpr, or base vs pkg llvm
> > > come to mind) and if there's any official guidance on this I've missed it.
> > I cannot give you an official answer, but if you always want to have the pkg
> > version getting precedence on the base version, I would reorder the PATH
> > variable.
> > If instead you want to mix versions, I would not change the base system, I
> > would rather create aliases for the shell.
> In this case I specifically want to disable the base commands, and want
> them to be disabled under all circumstances, hence the suggestions of
> chmod -x, etc.
If you really know what you're doing then locate the base program, rename it (to
keep a backup) and make a link to the pkg version in the base location with the
original name. (Again, there is nothing official about this approach.)
Be carefull: packages are tested with a base system unchanged, hence there is no
guarantee that if a software you install depends on a command in base that you
changed it will still work.
Maybe you should think if there is a better way to achieve your goal than
using pkg versions instead of base. Can you tell us what's the reason base is
not good enough for you?
More information about the freebsd-questions