# Cannot install packages



## Deleted member 9563 (Nov 26, 2010)

Since I reinstalled the system there are a lot of problems, so forgive me if this post contains too many questions. First I will mention that dbus, despite being enabled in the usual way, is not running and I can't get it to work. Second, and that is what I will focus on here, I cannot install software. Here is the result of one attempt:


```
# pkg_add -r djvulibre
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.1-release/Latest/djvulibre.tbz... Done.
pkg_add: package pkg-config-0.25_1 has no origin recorded
pkg_add: package pkg-config-0.25_1 has no origin recorded
pkg_add: package pkg-config-0.25_1 has no origin recorded
pkg_add: package pkg-config-0.25_1 has no origin recorded
pkg_add: warning: package 'djvulibre-3.5.22_3' requires 'tiff-3.9.4', but 'tiff-4.0.0' is installed
pkg_add: warning: package 'djvulibre-3.5.22_3' requires 'gettext-0.18_1', but 'gettext-0.18.1.1' is installed
```

I have a feeling that this and the dbus problem are related but at this point I am completely lost as to what to focus on. Any suggestions?


----------



## DutchDaemon (Nov 26, 2010)

If *pkg_add* complains that djvulibre cannot be installed because there are newer dependencies in the system than it requires, it probably means that you installed those dependencies from the 8.1-stable collection, whereas you're now installing from the 8.1-release collection (which is older, and built against older versions of dependencies). The error itself is not dbus-related as far as I can see, but maybe dbus also complains about not finding the correct dependencies (i.e. library versions). Try (re)installing packages from the -stable repository (set the PACKAGESITE environment variable), and use specific tools for keeping packages up-to-date, like sysutils/bsdadminscripts, or ports-mgmt/portmaster with the *-PP* flag enabled (requires an up-to-date ports tree though).


----------



## Deleted member 9563 (Nov 27, 2010)

Thanks DutchDaemon, now I have something to go on. I think you put your finger on it. When I reinstalled, I did if from the network and inadvertently got the Stable version of programs instead of the Release version that I had before. However, I don't know how to install a kernel and just took the only one I found after the install and put it in the /boot/kernel directory. Perhaps my problem starts there.


```
#uname -a
FreeBSD TOP.lan.cgs 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010
     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
```

Your post suggests to me that I will end up with a Stable or mixed version. My preference is for the Release, although I am not certain that there is any disadvantage to Stable. What is the easiest way to put the whole system back to Release?


----------



## DutchDaemon (Nov 27, 2010)

Well, that depends on your tools of choice. 

OS: (this paragraph is only applicable if you suspect that your base system is not -RELEASE, but a mixture of -STABLE and -RELEASE parts) -> you can use a -RELEASE CD/DVD and extract the proper distributions to install -RELEASE; you can use freebsd-update(8), but I'm not sure if it can 're-force' a 'mixed' system back to a proper -RELEASE, or you can use csup(1) with the RELENG_8_1 tag to build your own -RELEASE from the source tree. 

Packages: once your system identifies itself as -RELEASE in *uname -a* (after performing one of the strategies to 'repair' the OS) using pkg_add(1) will automatically use the 8.1-release package repository. It's probably best to take the output of pkg_info(8) to determine which packages you need (by name, disregard the versions), then delete all of the installed ones, and reinstall the proper ones (i.e. the ones from the release repository). If you have the full CD set or the DVD, all of them should be on the disc(s), so you can pkg_add from them instead of fetching them from the FreeBSD ftp server.


----------



## Deleted member 9563 (Nov 27, 2010)

I really am an amateur. I've "googled" how to "extract a FreeBSD distribution" and I'm not getting anywhere, so I can't take advantage of your advice.  I also can't delete any packages. Here is an example:


```
# pkg_info |grep zim
zim-0.28_4          WYSIWYG text editor written in Gtk2-Perl
# pkg_delete zim-0.28_4
pkg_delete: package pkg-config-0.25_1 has no origin recorded
# pkg_add -F zim-0.28_4
pkg_add: can't stat package file 'zim-0.28_4'
```

When I type pkg_version one of the lines looks like this:

```
pkg-config                          =
pkg_version: pkg-config-0.25_1 does not appear to be a valid package!
```

If I could delete that package perhaps I could re-install it, but I'm stuck.

```
#pkg_delete pkg-config-0.25_1
pkg_delete: package 'pkg-config-0.25_1' doesn't have a prefix
```

All these problems came from when I tried to install FreeBSD 8.1-RELEASE (again)without touching the original /home partition. Perhaps it is wrong to do it that way. I did notice that the install program did not offer an option to format. Should I use something like Gparted and format the whole disk first and then do a complete install? I would like to avoid restoring a rather large /home, but if that is needed then so be it.


----------



## Beastie (Nov 27, 2010)

OJ said:
			
		

> I've "googled" how to "extract a FreeBSD distribution" and I'm not getting anywhere, so I can't take advantage of your advice.


Check the distributions' directories (base, kernels, etc.) There is an install.sh script in each one of them. You can execute it or execute the *cat ... / tar ...* command found inside.
Of course, make sure 1) you don't _already_ have *RELEASE*, 2) you use the Bourne shell and set the *DESTDIR* variable appropriately (*export DESTDIR=/destination*), 3) you backup anything you need.

If you don't already have the *disc1*/*dvd1* ISOs, you can download the distributions manually from here (<- *i386* architecture) using ftp/wget or the native fetch.



			
				OJ said:
			
		

> I also can't delete any packages. Here is an example:


I may be wrong but it looks like some packages are not registered properly in /var/db/pkg/. You should reinstall them, forcing (*-f*) those that are not installed well. And most importantly you should find out the reason it happened to begin with so it doesn't happen again.

You can also extract a "test" package manually just to make sure they were not somehow corrupted (*tar -xf package-ver.tbz*).


----------



## Deleted member 9563 (Nov 27, 2010)

Thanks Beastie, there's a couple of educational suggestions there.  The system is working for the purpose of browsing and other basic stuff, but anything to do with installing or removing programs is completely broken. I've tried a few things like 
	
	



```
portsnap fetch update
```
which appeared succesful, and I fixed the dbus problem I think. (Thanks to a detailed post by DutchDaemon elsewhere) 

However, I don't seem to be getting anywhere. Using *pkg_add* or ports *make install* is no matter. Uninstall, reinstall, or  anything with the pkg-config program does nothing useful. Pkg-config is always referred to as either not being a valid package or not having a prefix. Just to see what would happen I did this: 


```
#pkg_add -r pkg-config
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.1-release/Latest/pkg-config.tbz... Done.
pkg_add: package 'pkg-config-0.23_1' or its older version already installed
```

However pkg_version says it is not a valid package. I am not clear on the function of pkg-config, I just focused on that because it was called for and I thought it was a place to start.

I am at a loss. 



> *Beastie:* And most importantly you should find out the reason it happened to begin with so it doesn't happen again.



I installed over an existing installation using the CD without touching the /home partition. I believe that was my mistake. I don't think the install program is meant to do that. This machine was running OK until I did that. (It was a misinformed choice.) 

It is 5 in the morning and I am too old to carry on. Tomorrow I am going to re-install, and this time I will delete the /home partition as well. Surely that will be successful. I have had no problems installing the 32 bit version of FreeBSD on several other machines.

PS: To clarify - it was a video problem that led me to mistakenly re-install. I know now that the Intel H55 is not supported, so I won't worry about video until I get a separate card.


----------



## Beastie (Nov 27, 2010)

OJ said:
			
		

> I am not clear on the function of pkg-config, I just focused on that because it was called for and I thought it was a place to start.


From the description:

```
A utility to retrieve information about installed libraries
```



			
				OJ said:
			
		

> Tomorrow I am going to re-install, and this time I will delete the /home partition as well. Surely that will be successful. I have had no problems installing the 32 bit version of FreeBSD on several other machines.


I guess the /home partition contains user directories, e.g. /home/oj, and nothing else, right? Removing/newfsing it will not fix your problems. You'll only destroy any custom configurations you've made while using applications.
There's no need to reinstall FreeBSD either. If the only problem you have is related to third-party packages, then remove the contents of the /var/db/pkg/ and /usr/local/ directories. Then reinstall applications using either packages or ports.


----------



## Deleted member 9563 (Nov 28, 2010)

Beastie said:
			
		

> I guess the /home partition contains user directories, e.g. /home/oj, and nothing else, right?


I'm not completely sure that there isn't anything that can break things there, but it makes sense.



> Removing/newfsing it will not fix your problems. You'll only destroy any custom configurations you've made while using applications.


It is not essential, (I keep a few notes) but it certainly would be a time saver to keep most configurations.



> There's no need to reinstall FreeBSD either. If the only problem you have is related to third-party packages, then remove the contents of the /var/db/pkg/ and /usr/local/ directories. Then reinstall applications using either packages or ports.



Thank you for what is looking to be some wise words.  I first deleted /var/db/pkg/ and already the installation of programs appeared to work properly again. However, not being sure, I decided to follow your suggestion and also delete /usr/local/. It asked if I wanted to override some things and I said yes. Perhaps that was not strictly needed and I could have saved some time, but I wanted to be sure. The system is now back to what looks like "the beginning". No X, no fluxbox, no apps. I am happy with that and will report back with (hopefully) news of my success.


----------



## Deleted member 9563 (Nov 28, 2010)

I've installed *xorg* and *fluxbox* and various applications and they seem to work well. In fact now *djview* works, and it didn't before. It appears that I've now got a coherent and functional system. Thanks again for the help.


----------

