Noob-me again: pkg_add -r?



  • Good afternoon  ;D

    On my normal PC-BSD box I can do pkg_add -r, but ony Pfsense box I can't?

    
    pkg_add -r wget
    Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.1-release/Latest/wget.tbz: File unavailable (e.g., file not found, no access)
    pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.1-release/Latest/wget.tbz' by URL
    

    I have been googling and googling but I can't find how to do this?

    So somewhere in a thread on this forum I read that packages need to be compiled specifically for Pfsense (?), so I found the Pfsense package site:

    http://files.pfsense.org/packages/8/All/

    I tried to install it directly from this site:

    pkg_add -r ftp://files.pfsense.org/packages/8/All/wget-1.14_1.tbz 
    Error: Unable to get ftp://files.pfsense.org/packages/8/All/wget-1.14_1.tbz: Operation timed out
    pkg_add: unable to fetch 'ftp://files.pfsense.org/packages/8/All/wget-1.14_1.tbz' by URL
    

    I then tried to download the *.tbz to my desktop and SCP it to Pfsense, after that doing a pkg_add without the -r, but, of course, it started to complain about dependencies.

    So: how do I install wget with pkg_add?

    :-[  :'(

    Thank you in advance for your help  :)

    Bye,



  • Check your URL. Also check whether ftp happens to be the problem. pkg_add works fine for me with an http site.



  • @rjcrowder:

    Check your URL. Also check whether ftp happens to be the problem. pkg_add works fine for me with an http site.

    Thank you for your reply  :D

    What URL do I need to check then, if I may ask? I mean: there is no url in pkg_add -r wget?

    I've been trying to install mc (midnight commander) for weeks now also, but I always get the same error. On my PC-BSD box it installs flawlessly, on the Pfsense it can't find the remote server?

    And no log file I guess to find out what the problem might be(?)



  • Make sure you can get to

    ftp://files.pfsense.org/packages/8/All/

    from the box.

    BTW - I'm executing the following whenever I setup a box…

    pkg_add -r http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/8.2-RELEASE/packages/Latest/bash.tbz


  • Rebel Alliance Global Moderator

    as mentioned try the http version instead of ftp, ftp might be your problem.  Also make sure that dns is working pfsense for its own resolution.

    Can you ping ftp-archive.freebsd.org ?

    [2.1-RELEASE][root@pfsense.local.lan]/root(1): ping ftp-archive.freebsd.org
    PING moss.cse.buffalo.edu (128.205.32.24): 56 data bytes
    64 bytes from 128.205.32.24: icmp_seq=0 ttl=51 time=32.798 ms
    64 bytes from 128.205.32.24: icmp_seq=1 ttl=51 time=32.754 ms

    Also what exact version and flavor of pfsense are you running.. I am running i386 version
    2.1-RELEASE (i386)
    built on Wed Sep 11 18:16:50 EDT 2013
    FreeBSD 8.3-RELEASE-p11

    but I had no problems just doing a simple pkg_add -r wget to get it installed

    
    [2.1-RELEASE][root@pfsense.local.lan]/root(2): wget
    wget: Command not found.
    [2.1-RELEASE][root@pfsense.local.lan]/root(3): pkg_add -r wget
    Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.3-release/Latest/wget.tbz... Done.
    Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.3-release/All/pkg-config-0.25_1.tbz... Done.
    Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.3-release/All/libidn-1.22.tbz... Done.
    pkg_add: warning: package 'libidn-1.22' requires 'libiconv-1.13.1_2', but 'libiconv-1.13.1_1' is installed
    pkg_add: warning: package 'wget-1.13.4_1' requires 'libiconv-1.13.1_2', but 'libiconv-1.13.1_1' is installed
    [2.1-RELEASE][root@pfsense.local.lan]/root(4): wget
    wget: missing URL
    Usage: wget [OPTION]... [url]...
    
    Try `wget --help' for more options.
    [2.1-RELEASE][root@pfsense.local.lan]/root(5):
    [/url]
    


  • Thank you to the both of you very much for your help  ;D

    I tried several things:

    
    ping www.pfsense.org
    PING www.pfsense.org (192.207.126.26): 56 data bytes
    64 bytes from 192.207.126.26: icmp_seq=0 ttl=55 time=166.336 ms
    64 bytes from 192.207.126.26: icmp_seq=1 ttl=55 time=172.604 ms
    
    
    ping files.pfsense.org
    PING files.pfsense.org (66.111.2.167): 56 data bytes
    ^C
    --- files.pfsense.org ping statistics ---
    18 packets transmitted, 0 packets received, 100.0% packet loss
    
    
    
    ping www.google.com
    PING www.google.com (173.194.70.147): 56 data bytes
    64 bytes from 173.194.70.147: icmp_seq=0 ttl=47 time=34.665 ms
    64 bytes from 173.194.70.147: icmp_seq=1 ttl=47 time=34.171 ms
    64 bytes from 173.194.70.147: icmp_seq=2 ttl=47 time=74.498 ms
    
    ping ftp-archive.freebsd.org
    PING moss.cse.buffalo.edu (128.205.32.24): 56 data bytes
    64 bytes from 128.205.32.24: icmp_seq=0 ttl=48 time=108.608 ms
    64 bytes from 128.205.32.24: icmp_seq=1 ttl=48 time=107.891 ms
    64 bytes from 128.205.32.24: icmp_seq=2 ttl=48 time=116.602 ms
    
    pkg_add -r wget
    Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.1-release/Latest/wget.tbz: File unavailable (e.g., file not found, no access)
    pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.1-release/Latest/wget.tbz' by URL
    
    ftp ftp://files.pfsense.org/packages/8/All
    
    ftp: connect: Operation timed out
    ftp: Can't connect or login to host `files.pfsense.org'
    
    ftp ftp.freebsd.org
    Trying 193.162.146.4...
    Connected to ftp.freebsd.org.
    220 beastie.tdk.net FTP server (Version 6.00LS) ready.
    

    So I can ping everybody except files.pfsense.org, I can ftp to Freebsd but not to pfsense.

    I was wanting to try the http-trick you both said, but then I run into the next problem:

    pkg_add -r http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/8.1-RELEASE/packages/Latest/wget.tbz
    Fetching http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/8.1-RELEASE/packages/Latest/wget.tbz... Done.
    pkg_add: warning: package 'wget-1.12_1' requires 'libiconv-1.13.1_1', but 'libiconv-1.14' is installed
    pkg_add: warning: package 'wget-1.12_1' requires 'libiconv-1.13.1_1', but 'libiconv-1.14_1' is installed
    pkg_add: warning: package 'wget-1.12_1' requires 'gettext-0.18_1', but 'gettext-0.18.1.1' is installed
    pkg_add: warning: package 'wget-1.12_1' requires 'gettext-0.18_1', but 'gettext-0.18.3' is installed
    

    My system is this:

    
     uname -a
    FreeBSD pfsense.wasa 8.1-RELEASE-p13 FreeBSD 8.1-RELEASE-p13 #0: Fri Apr 12 10:54:59 EDT 2013     root@snapshots-8_1-amd64.builders.pfsense.org:/usr/obj.pfSense/usr/pfSensesrc/src/sys/pfSense_SMP.8  amd64
    

    I don't understand nada about it. This is a freshly installed system, only three days old (I had to reinstall due to not being able to log in anymore). I do not run any 'custom made scripts' (I wouldn't dare  :-[), and all that is installed is packages from System/packages, only Snort and Squid, to be precise.

    :'( :'( :'(

    Thank you again for trying to help me, I [b]do appreciate it  ;D


  • Rebel Alliance Global Moderator

    "This is a freshly installed system"
    "I had to reinstall due to not being able to log in anymore"

    So why the OLD version of pfsense?  Current is 2.1 and runs on freebsd 8.3 not 8.1 that your showing.

    I would suggest you do a clean install with the current stable release.
    http://www.pfsense.org/index.php@option=com_content&task=view&id=43&Itemid=44.html



  • @johnpoz:

    "This is a freshly installed system"
    "I had to reinstall due to not being able to log in anymore"

    So why the OLD version of pfsense?  Current is 2.1 and runs on freebsd 8.3 not 8.1 that your showing.

    I would suggest you do a clean install with the current stable release.
    http://www.pfsense.org/index.php@option=com_content&task=view&id=43&Itemid=44.html

    Thanks John  :D

    I remained on 2.0.3 as I read there are both problems with Snort and with Squid 2 in 2.1, for which people are waiting for a hotfix. So I thought it wiser to stay on 2.0.3 for the time being as I am not that much a hero of poking to get things working  ;D


  • Rebel Alliance Global Moderator

    where have you read there are issues with squid or snort?

    If you want to run on an old version, then your going to have to deal with stuff like you saw where your dep are going to be out of sync

    'wget-1.12_1' requires 'libiconv-1.13.1_1', but 'libiconv-1.14' is installed

    These sorts of issues can be normally fixed with link with old name to current lib, etc.  But it can be a bit of a pain..

    I don't use squid or snort – but if you links to where people are having issues and need some hotfix be happy to take a look and try and duplicate it.



  • @johnpoz:

    where have you read there are issues with squid or snort?

    If you want to run on an old version, then your going to have to deal with stuff like you saw where your dep are going to be out of sync

    'wget-1.12_1' requires 'libiconv-1.13.1_1', but 'libiconv-1.14' is installed

    These sorts of issues can be normally fixed with link with old name to current lib, etc.  But it can be a bit of a pain..

    I don't use squid or snort – but if you links to where people are having issues and need some hotfix be happy to take a look and try and duplicate it.

    Hi John,

    Thanks  ;D

    The Squid I don't recall exactly, but the Snort was this thread:

    http://forum.pfsense.org/index.php/topic,68171.0.html

    Bmeeks confirms the bug later in that thread. They are speaking about a hotfix, I also read something somewhere about 'githubbing a fix into your installation', and I get al sweaty and nervous then (I have no clue what 'githubbing' is in the first place  ;D).


  • Rebel Alliance Global Moderator

    But clearly is a minor issue from this statement

    "Again, though, remember Snort should just "re-block" the IP on the next offending traffic.  So really no permanent harm done."



  • @johnpoz:

    But clearly is a minor issue from this statement

    "Again, though, remember Snort should just "re-block" the IP on the next offending traffic.  So really no permanent harm done."

    I decided to drink a lot of beer and then try my guts and update to 2.1  ;D

    The update went great, right from the dashboard. Indeed, Snort is doing what I linked to in the above, and the Traffic Shaper status (status/queues) is a mess, reporting my low queue is consuming 465 Gbit ( :P) although I am on a measy 20 Mb.

    But pkg_add -r seems to work now (albeit not for mc), so you were right; it probably was a problem with packages having been archived somewhere in a directory that pkg_add couldn't find anymore.

    Thank you for your help  ;D


  • Rebel Alliance Global Moderator

    You updated - why not a clean install?  I don't see issues with upgrades to a build, but if was going from say 2.0.x to 2.1 I would do clean..

    As to using git.. Its a simple command - it just pulls the changes from the repository..  So you can get changes as they are being done vs waiting for say 2.1.1

    Not something you would normally do a production setup, but if this is your home setup should not be an issue - just keep a backup, or install ready so if something really bad happens you can just go back to your working version, etc.



  • @johnpoz:

    You updated - why not a clean install?  I don't see issues with upgrades to a build, but if was going from say 2.0.x to 2.1 I would do clean..

    As to using git.. Its a simple command - it just pulls the changes from the repository..  So you can get changes as they are being done vs waiting for say 2.1.1

    Not something you would normally do a production setup, but if this is your home setup should not be an issue - just keep a backup, or install ready so if something really bad happens you can just go back to your working version, etc.

    I had prepared the full install iso in case the upgrade would go wrong. But being lazy I decided to try the upgrade first, and this worked very well.

    Is there a specific pfsense 'git' tutorial perhaps somewhere? So I understand what I could do (also the rolling back you mention)?

    Thank you John  ;D


  • Rebel Alliance Global Moderator

    Here is doc
    https://doc.pfsense.org/index.php/Updating_pfSense_code_between_snapshots

    Not sure how updated it is..  But gives you the general idea.

    I run my pfsense on vm, so rollback is click click – just click on take snapsnot of the vm before I do anything.  But if running hardware - just have install media ready and copy of your config before you do anything.  Worse case you reinstall and restore you config and bing bang zoom your back to how you were in a a couple of minutes.

    What exactly are you running pfsense on - is there some specific reason your running amd64?  And not i386 -- there seems to be far less issue when running i386.. Unless your running lots of ram not sure what advantages 64bit has to be honest.



  • @johnpoz:

    Here is doc
    https://doc.pfsense.org/index.php/Updating_pfSense_code_between_snapshots

    Not sure how updated it is..  But gives you the general idea.

    I run my pfsense on vm, so rollback is click click – just click on take snapsnot of the vm before I do anything.  But if running hardware - just have install media ready and copy of your config before you do anything.  Worse case you reinstall and restore you config and bing bang zoom your back to how you were in a a couple of minutes.

    What exactly are you running pfsense on - is there some specific reason your running amd64?  And not i386 -- there seems to be far less issue when running i386.. Unless your running lots of ram not sure what advantages 64bit has to be honest.

    Thanks for the link, John, I will study it  ;D

    The system backup/restore was how I reinstalled 2.0.3 two weeks ago. But that didn't quite work. I think I understand the logic; the restore simply plays all changes ever made to the system again, as a sort of 'macro'. At least, from looking at what it did this is my conclusion, as I saw it installing snort, deinstalling snort, installing snort, deinstalling snort, and so on for all packages. The end result after some hours was a system that still didn't work, so in the end I did a clean install of 2.0.3, all the packages, and all customizations for all packages. The upgrade from 2.0.3 to 2.1 on the other had worked 100% the first time  :P

    My hardware is in my sig. It has been recommended to me by a very kind and great person, who was helped me tremendously during the pre-move to Pfsense, by explaining things, recommending hardware, troubleshooting my ISP-problems. And to this very day, he still refuses to let me pay him some money so he can take a cup of coffee on my behalf :-\ (Yes you know him, he is on this board very regularly  ;D).

    I have AMD64 since I have 8 gig of ram. I have created a screenshot of my dashboard and attached that.

    Now I am off trying to find out why FreeBSD (desktop) doesn't want to see my LAN (samba is installed)  :-[

    Bye,