Bug 129464

Summary: using packages system
Product: Documentation Reporter: guillaume <g71>
Component: Books & ArticlesAssignee: Allan Jude <allanjude>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description guillaume 2008-12-06 15:30:07 UTC
in the FreeBSD handbook, 4.4 (Using the Packages System), pkg_add and pkg_delete are obsolete commands to manage packages. it's quasi-impossible to control requirements packages with these commands.
when a beginner read the handbook, he lost a lot of hours before he understand that (if, by miracle, he doesn't give up FreeBSD).

Fix: 

the good commands are portupgrade and pkg_deinstall.
the portupgrade tool must be natively integrated in FreeBSD.

example of procedure:

1) it's better to have PACKAGESITE to the last stable branch by default, no?
2) install port collection with csup
3) clean database with pkgdb -aF (is it necessary after the port collection install?)
4) to install the xfce package: portinstall -RPP xfce
5) to upgrade the xfce package: portupgrade -RPP xfce
6) to delete the xfce package: pkg_deinstall -r xfce



PS: it's not convenient to install the port collection if one only use packages. a solution to this will be good for the future...
How-To-Repeat: see above.
Comment 1 Szilveszter Adam 2008-12-07 09:26:21 UTC
On Sat, Dec 06, 2008 at 03:29:11PM +0000, guillaume wrote:
> in the FreeBSD handbook, 4.4 (Using the Packages System), pkg_add and pkg_delete are obsolete commands to manage packages. it's quasi-impossible to control requirements packages with these commands.

On this, I tend to agree. However, when starting out with a new system,
these are the only commands that are available.

> >Fix:
> the good commands are portupgrade and pkg_deinstall.
> the portupgrade tool must be natively integrated in FreeBSD.

This is not possible with the current state of affairs, because
portupgrade has external dependencies. It must rewritten first (like it
happened with cvsup).

> example of procedure:
> 
> 1) it's better to have PACKAGESITE to the last stable branch by default, no?

No. Those packages were specifically made for the stable branch, not the
release that you are trying to install. In most cases, it would probably
work (but only, if you upgrade all packages at the same time and from
tha same branch) but not always (eg if a component of the base has
already been upgraded in the stable branch compared to your release and
eg a library version has been bumped) 

The trouble is, that on FreeBSD using packages was not the way to
install third-party software. It was provided more as a quick aid or a
convenience, but the recommended method was to use the ports and compile
yourself. This procedure is well-tested and works fine today as well.
Packages, by contrast, are trickier. Not just for FreeBSD: on most Linux
distros, there is no option to eg only upgrade Firefox, unless the
maintainer has specifically made a new package for the distro and
release you are using; otherwise you must wait until the next release.
On FreeBSD, by contrast, there was no problem with upgrading eg Firefox
or even complex stuff like the whole KDE environment although the new
FreeBSD release was still months away, since the ports system did the
trick.

> 2) install port collection with csup
> 3) clean database with pkgdb -aF (is it necessary after the port collection install?)

Not really, you did not install anything yet, so there is no database.

> 4) to install the xfce package: portinstall -RPP xfce
> 5) to upgrade the xfce package: portupgrade -RPP xfce
> 6) to delete the xfce package: pkg_deinstall -r xfce
> 
> 
> 
> PS: it's not convenient to install the port collection if one only use packages. a solution to this will be good for the future...

Only, if there will be a decision that binary packages will be the
primary method of installing third-party software on FreeBSD. This is
not the case today.

-- 
Regards:

Szilveszter ADAM
Budapest
Hungary
Comment 2 guillaume 2008-12-07 23:12:27 UTC
it will be good to integrate the keys features of your explanation in 
the handbook:

- it isn't recommended to override PACKAGESITE because packages are 
specifically made for a branch.
- pkg_add and pkg_delete are obsolete, use the portupgrade tool. it is 
recommended to install it before you try to manage package. portupgrade 
use the port tree, so you must have the port tree installed.
    examples:
    - install the xfce package: portinstall -RPP xfce
    - upgrade your xfce with the ports: portupgrade -R xfce
    - uninstalll your xfce: pkg_deinstall -r xfce

(and if the user can access to internet, it seems recommended to not 
install the port tree from the distribution media, but directly from 
internet after the FreeBSD installation (with csup), no?)


regards
Comment 3 Szilveszter Adam 2008-12-08 06:03:35 UTC
Dear guillaume,

On Mon, Dec 08, 2008 at 12:12:27AM +0100, guillaume wrote:
> it will be good to integrate the keys features of your explanation in 
> the handbook:

I am ok with this :-)

> - it isn't recommended to override PACKAGESITE because packages are 
> specifically made for a branch.

Yes.

> - pkg_add and pkg_delete are obsolete, use the portupgrade tool. it is 
> recommended to install it before you try to manage package. portupgrade 
> use the port tree, so you must have the port tree installed.
>     examples:
>     - install the xfce package: portinstall -RPP xfce
>     - upgrade your xfce with the ports: portupgrade -R xfce
>     - uninstalll your xfce: pkg_deinstall -r xfce

Yes. (Although I am not sure what happens if you use -PP and do not have
the ports tree. I will try it sometime.)

> (and if the user can access to internet, it seems recommended to not 
> install the port tree from the distribution media, but directly from 
> internet after the FreeBSD installation (with csup), no?)

Yes, this is a good recommendation. I do it like this all the time.

-- 
Regards:

Szilveszter ADAM
Budapest
Hungary
Comment 4 Thomas Abthorpe freebsd_committer freebsd_triage 2009-02-06 17:53:49 UTC
Responsible Changed
From-To: freebsd-doc->tabthorpe

I'll take it.
Comment 5 guillaume 2009-04-18 09:11:02 UTC
i have a better understanding now. when i wrote "pkg_add is obsolete" 
it's not correct.
this is a convenient procedure for "easy" software installation (in my 
opinion):

- the ports tree must be installed (choose csup or portsnap method)
- portupgrade must be installed
- install softwares with pkg_add -r (when it's possible)
- if pkg_add -r don't find a package in "Latest", look in "All"... then: 
pkg_add -r ../All/<name-ver>.tbz
- after each installation with pkg_add, keep the package DB up to date 
with portupgrade: pkgdb -aF
- if it isn't possible to install with pkg_add, install with portinstall -RP
- upgrade with portupgrade -RP
- deinstall with pkg_deinstall -R (not -r as i wrote before)


regards
Comment 6 Thomas Abthorpe freebsd_committer freebsd_triage 2010-04-10 05:45:29 UTC
Responsible Changed
From-To: tabthorpe->freebsd-doc

Back to the heap, I have made no positive progress on this, maybe 
somebody else can do it justice
Comment 7 Allan Jude freebsd_committer freebsd_triage 2014-05-19 21:02:10 UTC
State Changed
From-To: open->closed

the pkg_* tools have been superseded by pkg(7) and pkg(8) and the  
documentation has been updated to reflect this  


Comment 8 Allan Jude freebsd_committer freebsd_triage 2014-05-19 21:02:10 UTC
Responsible Changed
From-To: freebsd-doc->allanjude

the pkg_* tools have been superseded by pkg(7) and pkg(8) and the 
documentation has been updated to reflect this