Where does "pkg_add -r" look for dependencies?

Status
Not open for further replies.

saurav

Contributor
Joined
Jul 29, 2012
Messages
139
On FreeNAS 9.1, I tried running pkg_add like this:

Code:
# export PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/                                             
# pkg_add -nr shells/bash-4.2.45                                                                                                   
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/shells/bash-4.2.45.tbz... Done.                           
Package dependency libiconv-1.14_1 for ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/shells/bash-4.2.45.tbz not fo
und!                                                                                                                               
Package dependency gettext-0.18.3 for ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/shells/bash-4.2.45.tbz not fou
nd!                                                                                                                               
#      


But I can see that ftp://...../packages-9-stable/converters/liibiconv-1.14_1.tbz is present on the server! So is devel/gettext-0.8.13.tbz.

Why can't "pkg_add -r" see them? Where does it look for the dependencies?

I have tried many more variations of PACKAGESITE, but it has never worked.

Thanks,
Saurav.
 
D

dlavigne

Guest
I assume this is in a jail and not it Shell?

Why are you mucking about with PACKAGESITE? pkg_add should "just work".
 

saurav

Contributor
Joined
Jul 29, 2012
Messages
139
pkg_add doesn't work. I get the exact same errors:
Code:
# cd /tmp                                                                   
# pkg_add -nr shells/bash                                                   
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-st
able/Latest/shells/bash.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages
-9-stable/Latest/shells/bash.tbz' by URL                                     
# pkg_add -nr bash                                                           
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/Latest/
bash.tbz... Done.                                                           
Package dependency libiconv-1.14_1 for ftp://ftp.freebsd.org/pub/FreeBSD/ports/a
md64/packages-9-stable/Latest/bash.tbz not found!                           
Package dependency gettext-0.18.3 for ftp://ftp.freebsd.org/pub/FreeBSD/ports/am
d64/packages-9-stable/Latest/bash.tbz not found!                             
# env | grep PACKAGESITE                                                     
# 
 
D

dlavigne

Guest
Again I ask, are you doing this in a jail or in shell?

Do NOT use pkg_add outside of a jail!
 

saurav

Contributor
Joined
Jul 29, 2012
Messages
139
Yes, it is in the jail. Sorry, I missed that part of your question.

This is a jail of type "pluginjail".
 

ewhac

Contributor
Joined
Aug 20, 2013
Messages
177
...you do not want to use pkg_add in a jail as it uses pkgng. Instead, use pkg install as demonstrated here: http://doc.freenas.org/index.php/Installing_non-PBI_Software#Installing_FreeBSD_Packages_with_pkgng.
Wow, I wish I'd seen this before I built my jail running Postfix...

If I use pkg_add, is anything outside the jail messed up? Or is all damage contained inside the jail? Is it just the packaging database that's messed up, or are other components damaged as well? My Postfix installation is running fine, and I have no plans to upgrade or install anything else in that jail. Will I be fine, or should I destroy and reconstruct the jail properly?
 
D

dlavigne

Guest
No, anything you do in the jail is limited to that jail (one of the many benefits of jails).

The cautionary note is to discourage people from using pkg_* as the old pkg system (pkg_add) is incompatible with the new one (pkgng), mixing/matching can result in corrupt pkg databases, and FreeNAS ships with pkgng. If you have only installed one or two apps, you may never notice. However, if you are mixing/matching pkg methods and installing a lot of apps, expect weirdness. I for one will be happy once the old pkg tools are removed from FreeBSD base so that people are forced to use just one pkg method and don't mistakingly shoot themselves in the foot.
 

saurav

Contributor
Joined
Jul 29, 2012
Messages
139
"pkg install" works beautifully for me. Thanks a lot!

Regards,
Saurav.
 
Status
Not open for further replies.
Top