# Upgrading packages without ports



## luckytaxi (Sep 16, 2009)

One thing that bothered me is the fact that it takes anywhere between half an hour to an hour just to compile/install certain apps. So, I decided to give packages a whirl and so far so good. However, how do I install the "latest and the greatest?" For example, I just installed apache and it's at version 2.2.11 I believe from packages. In the port systems, it's at revision .13. Let's say I wanted that particular installation, how do I go about installing it w/o using the port system?


----------



## ale (Sep 16, 2009)

Packages are built from ports, so it's normal that there is a lag.
About apache, you can try looking here:
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/www


----------



## donald1000 (Sep 23, 2009)

When you use "portinstall" or "portupgrade" you can use the -P option. Then the system first try to find a precompiled port. If it is not available it will compile from source.


----------



## nu2fbsd (Apr 5, 2010)

I also would like to do upgrade using packages instead of ports, since compiling takes a lot of time. What is the command I should execute to upgrade all? I have xorg and gnome.


----------



## sixtydoses (Apr 5, 2010)

If you're using `# portupgrade` you can specify the `-PP` flag so that it uses packages only.

From portupgrade(1) man:


> -PP
> --use-packages-only    Never use the port even if a package is not avail-
> able either locally or remotely, although you
> still have to keep your ports tree up-to-date so
> ...




Similar discussion on upgrading packages:
http://forums.freebsd.org/showthread.php?t=12690


----------



## phoenix (Apr 6, 2010)

Install the sysutils/bsdadminscripts port.  This includes the *pkg_upgrade* tool which uses only pre-compiled packages.  You can even delete /usr/ports completely and still keep your apps updated.


----------



## nu2fbsd (Apr 12, 2010)

Is this information in the handbook? I have read the section on ports and packages but I do not remember reading a tip like you have given phoenix. This is what I was looking for. Are there going to be any other issues if I use *pkg_upgrade*? I remember upgrading the ports tree but still I got the 2.26 version of Gnome when the version on the ftp site is 2.28. When there is this utility why is portupgrade recommended?


----------



## sixtydoses (Apr 12, 2010)

Well it is really up to one preference in maintaining ports/packages. There are lots of users who use `portupgrade`, as well as `portmaster`. In your case, you'd like to maintain a package based system only, which is something that `portupgrade` can handle (with `-PP` flag), and I believe `portmaster` has the same capability.

I guess there are just many handy tools available in /usr/ports that including every single of them in handbook is just going to cause more confusion than clarity.


----------



## phoenix (Apr 13, 2010)

Personal preference.

Some people like all the added utilities that come with portupgrade (portsclean, portversion, portsdb, pkgdb, etc).

Some people prefer portmaster as it's a pure shell script, and uses the default FreeBSD pkg_* tools and ports infrastructure.

Some people prefer portmanager.

Some people prefer pkg_upgrade, or the other ports management tools available.

Because there are so many different ways to do things, and because people work in different ways, there's no "official" ports management tool.  Which is why a lot of this isn't in the Handbook.  Portupgrade and portmaster are the most popular tools, so they get recommended the most.

The latest version of portmaster just gained the ability to work without a ports tree.  See the *--index-only* and *--packages-only* options in the man page for version 2.22.  Thus, portmaster can also be used as a packages-only upgrade tool.


----------



## phoenix (Apr 13, 2010)

nu2fbsd said:
			
		

> Is this information in the handbook?



No.  pkg_upgrade was developed as part of the DesktopBSD project, which was a meta-project based on FreeBSD (make a more desktop-oriented version of FreeBSD).

There's work to make the pkg_upgrade tools into a separate port, and to incorporate some of the features into the main pkg_* tools, though.  Eventually, we should be able to use just the base pkg_* tools to manage a binary-packages-only system.  



> Are there going to be any other issues if I use *pkg_upgrade*? I remember upgrading the ports tree but still I got the 2.26 version of Gnome when the version on the ftp site is 2.28.



I have not personally used (or even researched) pkg_upgrade, so can't comment on exactly how it works.  However, you will probably need to set *PACKAGESITE* in your environment, to point to the correct packages directory on the FTP servers, in order to get more up-to-date packages.  (I've covered the difference between packages for -RELEASE and packages for -STABLE on here before, so do some searches.)



> When there is this utility why is portupgrade recommended?



See my previous post in this thread.


----------



## harishankar (May 10, 2010)

Just to update, using portmaster with --index-only and -PP is a failure. It won't work 

```
# portmaster -a --packages-only --index-only

===>>> The --index, --index-first, and --index-only options are mutually exclusive
===>>> Aborting update
```


----------



## phoenix (May 10, 2010)

It works fine, I've used it a couple times.  Check your portmasterrc file to make sure --index isn't set.  You can't use --index and --index-only at the same time.


----------

