# Best way to install packages



## gnumonk (Dec 11, 2012)

Hi, 
What is the best way to install big ports or packages like libreoffice or koffice. I do have quite old machine P4/1GB RAM. 
If I installed using pkg_install(1), ports get installed but most of the times shared library issues come. If I use *cd /usr/ports/editor/<pkg_name> && make config && make install*. It takes its own time?

Can anybody let me know that what will be the best way to install the packages including dependencies ?


--
Thanks
gnmk


----------



## gnumonk (Dec 11, 2012)

Also note that I have used *portmaster -P editor/<pkg_name>*. It's running from last two days and if error comes, it starts from scratch? Any idea?


----------



## SirDice (Dec 11, 2012)

There are two ways to install packages, pkg_add(1) and using PKGNG. Using portmaster or the ports tree installs a port. Ports are build from source. Packages are build from ports.


----------



## jb_fvwm2 (Dec 12, 2012)

If you *really* want the heavyweight ports on a not-speedy machine, ...

```
cd [FILE]/usr/ports/www/chromium[/FILE]  # for example, in an xterm
make config
make build
#  cntl-c it when you want the machine to turn off
#  the next day, [FILE]/work/[/FILE]  is still there, 1/2 done
make build  # will resume ... where it left off.
```
Then the only problem may be of space for the build etc, you could use an external
drive (if available) and WRKDIRPREFIX=/mnt but /work/ would be on the extra thumdrive or drive and not on the same machine.
...
Other methods exist, no time to expound a lot...


----------



## unixlearn (Dec 12, 2012)

If you have a fresh install of FreeBSD and don't care about updating it software later, then just installing packages using *pkg_add -r* will suffice. That's how I gave it on my old laptop, the newer one. I care about keeping everything up to date, thus I went through the trouble of installing from ports which took me about a week to work through. All the errors and troubleshooting (which I'm still doing). Working with packages will get your machine up and running quick. But you will have a monster of problems if when you try to update anything because of dependencies.


----------



## SirDice (Dec 12, 2012)

Which is where PKGNG comes in, it tries to fix a lot of the issues the 'old' pkg_* tools had.

http://wiki.freebsd.org/pkgng


----------



## unixlearn (Dec 12, 2012)

trying out PKGNG and I get the following errors

```
bsdcomputer# pkg add deluge
pkg: Command not found.
bsdcomputer# pkg install deluge
pkg: Command not found.
```

I tried installing it and it says it's already installed

```
===>  Installing for pkg-1.0.3_1
===>   Generating temporary packing list
===>  Checking if ports-mgmt/pkg already installed
===>   pkg-1.0.3_1 is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of ports-mgmt/pkg
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop in /usr/ports/ports-mgmt/pkg
```

I'm using - FreeBSD bsdcomputer.computerbsd.bsd 8.3-RELEASE


----------



## SirDice (Dec 12, 2012)

Maybe this is something for a FAQ, it comes up quite often. 

rehash

NB 9-STABLE and 9.1 now have *set autorehash* in .cshrc by default.


----------



## gnumonk (Dec 12, 2012)

I have tried *cd /usr/ports/editor/libreoffice/* and then *make config* and *make install*, it was running for two days? I then canceled this and installed with *pkg_add -r -v libreoffice*. I was able to installed but there were shared library issue came because my machine was mostly build with make and make installed.

I have not tested pkg yet, I have installed this, let me see how does this goes with pkg? Else I needs to be very cautious from next time onwards before using *pkg_delete "*"*.


----------



## unixlearn (Dec 12, 2012)

gnumonk said:
			
		

> I have tried cd /usr/ports/editor/libreoffice/ and then make config and make install, it was running for two days ? I then cancelled this and installed with pkg_add -r -v libreoffice , I was able to installed but there were shared library issue came because my machine was mostly build with make and make installed .
> 
> I have not tested pkg yet, I have installed this, let me see how does this goes with pkg? else I needs to be very cautious from next time onwards before using pkg_delete "*".



This is the problem I often and still have. Packages are built with old programs while ports are built with the most current (as long as you keep the ports tree updated) so an individual package doesn't want to install without all the version it recognizes being the same. So if it wants version *.21.2 and you have *.21.5 or visa versa, it messes everything up. This is unlike say a windows os where you can just install say vlc with its current version without worrying about what version 10 other programs are.


----------



## kpa (Dec 12, 2012)

It's a one variation of what is commonly called a "DLL hell" that stems from the archaic methods for object linkage with dynamic libraries. Microsoft has it's own solution to the problem and that is COM and in the open source world there are solutions like CORBA. Unfortunately in many open source projects such considerations are seen as extra baggage and bloat and not used that often.


----------



## unixlearn (Dec 12, 2012)

*Upgrading packages?*

After reading /usr/ports/UPDATING just to do an update I'm going to have to rebuild practically all my ports? 
Ex. ImageMagick AND devel/pcre both want me to rebuild all the dependencies the list for those are a mile long. It took me a week to get my system finally running. How can I rebuild everything all over again just to update a few ports? What's worse is that it seems that I have no choice since I've started updating and now I'm getting errors. Aeems like updating is useless. I might as well reinstall the whole system over and leave it be once and for all.

PS. If they have the same dependencies. It also seems like it's going to redundantly rebuild dependencies with every port I upgrade.


----------



## jb_fvwm2 (Dec 12, 2012)

Copy the four libpcre*.so.* from /usr/local/lib to /usr/local/lib/compat/, . Update everything at your leisure (although here, it was not so relaxing, ports had to be updated that did not officially have to be updated (gvfs, glib-networking, gtk20, vte..., but only about thirty.  Then, when the update is bumped, remove the .so.. 
One www port had to be rebuilt for seamonkey  to be usable again. (swfdec-plugin) maybe.
Finally, six or so ports (here). had trouble compiling and are awaiting a fix.  
Howsoever, sometimes other ports /gettext/, for example, incur even more breakage, in which case if one wants to do the upgrade leisurely (rather than right away as suggested in UPDATING, this is a method that sometimes works.
One gotcha here, I just remembered, is that IIRC to compile binutils, the older version must still be installed... (that is my recollection anyway.) And that port is necc. for this upgrade AFAIK.


----------

