# pkg_add not working



## Carnildo (Aug 5, 2012)

I've just finished the basic installation of FreeBSD from a DVD, and I'm now trying to install Gnome from the DVD using pkg_add.  If I run

```
# pkg_add -v -n gnome2
```
I get the error

```
pkg_add: Can't stat package file 'gnome2'
```
If I change to the directory on the DVD containing the packages and run

```
# pkg_add -v -n gnome2-2.32.1_3.tbz
```
it gives "was not found" errors for every dependency.  Any idea what's going wrong?


----------



## jb_fvwm2 (Aug 5, 2012)

pkg_add of gnome is lengthy and multi-stage even if one is connected to the internet, and has done it many times before.  It is not something I'd want to do outside of the ports tree using a pkg management tool (portmaster, portmanager, portupgrade...


----------



## Carnildo (Aug 6, 2012)

jb_fvwm2 said:
			
		

> pkg_add of gnome is lengthy and multi-stage even if one is connected to the internet, and has done it many times before.  It is not something I'd want to do outside of the ports tree using a pkg management tool (portmaster, portmanager, portupgrade...



Does this mean that pkg_add is unable to properly resolve dependencies, or are you saying something else?


----------



## jb_fvwm2 (Aug 6, 2012)

I've never had the chance to use it to install more than a single port or package at a time, relying on portmaster or local .tbz files... surmising that all dependencies have already been installed. Back when I first installed from cd, I installed relatively simple ports and went slowly from there, mostly using portupgrade  and the ports tree.


----------



## SirDice (Aug 6, 2012)

Make sure you are in the directory containing all the packages when using *pkg_add*.

It shouldn't result in errors, I regularly *pkg_add* packages with a lot of dependencies.


----------



## Carnildo (Aug 7, 2012)

Starting from a fresh boot:

```
# mnt -t cd9660 /dev/iso9660/FREEBSD_INSTALL /mnt
# cd /mnt/packages/All
# pkg_add -n -v bash
pkg_add: can't stat package file 'bash'
pkg_add: 1 package addition(s) failed
# pkg_add -n -v bash-4.1.11.tbz
Requested space: 3822k bytes, free space: 12G bytes in /var/tmp/instmp.bmZ9AK
Package 'bash-4.1.11' depends on 'libiconv-1.13.1_1 with 'converters/libiconv' origin.
and was not found.
Package 'bash-4.1.11' depends on 'gettext-0.18.1.1' with 'devel/gettext' origin.
and was not found.
pkg_add: 1 package addition(s) failed
```

I get the same results regardless of if I run pkg_add from /mnt/packages, /mnt/packages/All, or /mnt/packages/shells.


----------



## SirDice (Aug 7, 2012)

Are libiconv-1.13.1_1.tbz and gettext-0.18.1.1.tbz actually on the CD/DVD?


----------



## izotov (Aug 7, 2012)

Carnildo said:
			
		

> If I change to the directory on the DVD containing the packages and run
> 
> ```
> # pkg_add -v -n gnome2-2.32.1_3.tbz
> ...



Try changing to the All ports directory and add the package from there (considering your DVD is mounted under /mnt):
`# cd /mnt/packages/All`
`# pkg_add gnome2-2.32.1_3.tbz`


----------



## Beastie (Aug 7, 2012)

Open the "All" directory;
Search for the exact file versions (*ls libiconv-1.** and *ls gettext-0**) as the libiconv and gettext versions compiled against GNOME may be slightly different from the ones included;
Install them;
Force install GNOME using the *-f* option.
HTH


----------



## Carnildo (Aug 8, 2012)

SirDice said:
			
		

> Are libiconv-1.13.1_1.tbz and gettext-0.18.1.1.tbz actually on the CD/DVD?



Yes.



			
				izotov said:
			
		

> Try changing to the All ports directory and add the package from there (considering your DVD is mounted under /mnt):
> `# cd /mnt/packages/All`
> `# pkg_add gnome2-2.32.1_3.tbz`



Tried that, it didn't work.



			
				Beastie said:
			
		

> Open the "All" directory;
> Search for the exact file versions (*ls libiconv-1.** and *ls gettext-0**) as the libiconv and gettext versions compiled against GNOME may be slightly different from the ones included;
> Install them;
> Force install GNOME using the *-f* option.
> HTH



That's a viable option for Bash, with two dependencies.  It's not viable for Gnome, with dozens if not hundreds of dependencies.


----------



## Carnildo (Aug 25, 2012)

I figured it out: use of the "-n" (dry run) option renders pkg_add unable to resolve dependencies.  Is this a known bug, or should I report it?


----------

