Migrating from ports to pkg

Matthew Seaman matthew at FreeBSD.org
Wed Dec 16 14:04:32 UTC 2015


On 16/12/2015 01:00, Baho Utot wrote:
>> I have been using "make" to install ports and "portsnap/portmaster" to
>> update my system.  But I'm over it now.
>>
>> I'm running 10.1-RELEASE and have very few ports installed.
>>
>> Is the migration from make/portsnap/portmaster -> pkg as simple as:
>>
>> pkg delete portmaster
>> rm -rf /usr/ports
>> pkg update

You don't need to run 'pkg update' as a separate step: it happens
automatically as part of 'pkg upgrade'

>> pkg upgrade
> 
> pkg upgrade -f
> 
> This will "reinstall and upgrade all packages on the system.

Again, forcing all your packages to upgrade is not actually necessary --
you only really have to do that for major OS version upgrades.  It can
be useful though if you do it lie so:

   * Make a list of the ports you specifically want installed,
     omitting the packages that are only installed to fulfil
     dependencies.
   * Delete all installed ports -- ie. clean out /usr/local except for
     any important configuration bits under /usr/local/etc.
   * Install only the ports you wanted from the list, which will pull
     in all necessary dependencies automatically.

What this does is get the 'automatic' flags set correctly on those
packages that are only installed as dependencies.  That way, in future
as you add or delete ports or as the dependencies of ports change over
time, you can use 'pkg autoremove' to delete stuff you have installed
but no longer need.  Again, this is an optional step -- your system will
work fine either way.

You've probably got a number of ports installed solely to provide build
dependencies -- things like gmake or alternate versions of compilers.
The above will fix that, but if you don't decide to follow that
procedure, you might want to delete some of the things just used for
port building.  Having that stuff installed won't hurt you, but it's all
additional maintenance which you can avoid by simply deleting those
packages.

What you will /have/ to do is look at any non-standard options settings
you've been using with portmaster.  You'll need to decide if you can
live without the changes resulting from altered options or not.  If you
can't then you'll need to work out some alternate method of building
packages with the options you want.  I'm a big fan of poudriere for
that, but there are other methods.


	Cheers,

	Matthew



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 957 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20151216/fd1650f5/attachment.sig>


More information about the freebsd-questions mailing list