# Installing from remote servers no longer working.



## Onoir (Jun 26, 2010)

I finally got FreeBSD to install on my computer, (I've run DesktopBSD and PC-BSD), and somehow managed to only install the basic command-line system only. Now, I've been running Linux for 5 years, BSD on and off, so with my knowledge of those systems, I was able to install Xorg, KDE, and the Awesome window manager and get them all running, using:

```
pkg_add -r <xorg/kde/whatever>
```
However, now that those are installed, I cannot use that to install anything else. I tried installing Firefox that way and it listed where it should be on the ftp site but that it couldn't find it. Being curious, I copied the ftp site address into my browser, and the files are all there.

Pidgin, firefox, and pretty much any other program are not found by pkg_add -r even though they are on the server. I was able to install firefox by downloading the files themselves and installing manually, but Pidgin has so many dependencies it would take me years to install it. 

I haven't altered any files relating to any ports, I haven't even made any files besides the xorg configuration. Any idea why my computer just headed downhill? I was pretty sure BSD wasn't a system that just did things on a whim like windows and ubuntu but I guess I could be wrong. 

If you have any advice please help, I'm rather lost.


----------



## hydra (Jun 26, 2010)

Try to post the output of [cmd=]pkg_add -rv firefox[/cmd] for example.


----------



## Onoir (Jun 26, 2010)

Here is the output:


```
$ sudo pkg_add -rv firefox
Password:
scheme:   [ftp]
user:     []
password: []
host:     [ftp.freebsd.org]
port:     [0]
document: [/pub/FreeBSD/ports/amd64/packages-8.0-release/Latest/firefox.tbz]
---> ftp.freebsd.org:21
looking up ftp.freebsd.org
connecting to ftp.freebsd.org:21
<<< 220 Welcome to freebsd.isc.org.
>>> USER anonymous
<<< 331 Please specify the password.
>>> PASS <user>@<host>.org
<<< 230 Login successful.
>>> PWD
<<< 257 "/"
>>> CWD pub/FreeBSD/ports/amd64/packages-8.0-release/Latest
<<< 250 Directory successfully changed.
>>> MODE S
<<< 200 Mode set to S.
>>> TYPE I
<<< 200 Switching to Binary mode.
binding data socket
>>> PORT 192,168,1,5,223,68
<<< 200 PORT command successful. Consider using PASV.
initiating transfer
>>> RETR firefox.tbz
<<< 550 Failed to open file.
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.0-release/Latest/firefox.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.0-release/Latest/firefox.tbz' by URL
pkg_add: 1 package addition(s) failed
```


----------



## DutchDaemon (Jun 26, 2010)

Try firefox35.


----------



## Onoir (Jun 26, 2010)

Well I have already installed Firefox, I had to do so by downloading the packages and installing manually. The problem is nothing else installs either.

Heres what happens when trying to install Pidgin for example.

```
$ sudo pkg_add -rv pidgin
Password:
scheme:   [ftp]
user:     []
password: []
host:     [ftp.freebsd.org]
port:     [0]
document: [/pub/FreeBSD/ports/amd64/packages-8.0-release/Latest/pidgin.tbz]
---> ftp.freebsd.org:21
looking up ftp.freebsd.org
connecting to ftp.freebsd.org:21
<<< 220 Welcome to freebsd.isc.org.
>>> USER anonymous
<<< 331 Please specify the password.
>>> PASS user@host.org
<<< 230 Login successful.
>>> PWD
<<< 257 "/"
>>> CWD pub/FreeBSD/ports/amd64/packages-8.0-release/Latest
<<< 250 Directory successfully changed.
>>> MODE S
<<< 200 Mode set to S.
>>> TYPE I
<<< 200 Switching to Binary mode.
binding data socket
>>> PORT 192,168,1,5,207,230
<<< 200 PORT command successful. Consider using PASV.
initiating transfer
>>> RETR pidgin.tbz
<<< 425 Failed to establish connection.
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.0-release/Latest/pidgin.tbz: Can't open data                                       connection
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.0-release/Latest/pidgin.tbz' by URL
pkg_add: 1 package addition(s) failed
```


----------



## hydra (Jun 26, 2010)

You are sending PORT 192,168,1,5,207,230 (active mode FTP) and I if there is no proxy in the way, I barely believe the ftp server will be able to communicate with you. Read pkg_add(1) how to switch to passive FTP and try again.


----------



## Onoir (Jun 26, 2010)

> Note: If you wish to use passive mode ftp in such transfers, set the
> variable FTP_PASSIVE_MODE to some value in your environment.  Otherwise,
> the more standard ACTIVE mode may be used.  If pkg_add consistently fails
> to fetch a package from a site known to work, it may be because you have
> a firewall that demands the usage of passive mode ftp.


Set the variable FTP_PASSIVE_MODE to some value in your environment...I'm a BSD noob... I have no idea where the "environment" is, or what value to set FTP_PASSIVE_MODE to. Not to mention this is a fresh install of FreeBSD, I havent set up any firewall or proxies of any sort. I'm just trying to get a working system. 

Every time I've tried to use *BSD I run into some issue that I can't figure out, and have been able to get little help solving them. I'd really like to give BSD a go, and thank you for the help so far, but please keep in mind I haven't the slightest idea how BSD works. I'm a Linux person. Only thing they seem to have in common is that they're Unix based, and can run a lot of the same programs. The inner workings are not something I'm familiar with.

If you can tell me where the "environment" is, if its a file or something, and what random value I need to set this to, I might be able to get started on solving this issue. Otherwise I'm up a creek without a paddle. I'm trying to dive into BSD but without direction I have no chance.


----------



## hydra (Jun 26, 2010)

Try to play with:
[CMD=""]env[/CMD] [CMD=""]setenv[/CMD] [CMD=""]unsetenv[/CMD]


----------



## DutchDaemon (Jun 27, 2010)

environ(7)


----------



## Onoir (Jun 27, 2010)

Ok I did a little reading and decided to try an 
	
	



```
echo $FTP_PASSIVE_MODE
```
It returns yes. The poster of the thread I read was having the same issue as I am, and also returned that he was already running in passive mode. At the end of the post there's an edit that said "firewall was disabled :wink:". Now I might be looking into his wink the wrong way, but perhaps the firewall being disabled was the problem with it. Ironically enough, as I haven't installed a firewall (knowingly), I'm not sure what I should check.

The only thing I can think of is that during the process of installing Opera via the remote servers, it downloaded a firewall that was installed but not turned on. I don't know how accurate that assumption is but its the only one I have.

Any ideas as to where to go from here?


----------



## hydra (Jun 27, 2010)

Switch to root (sudo su -) and show the output of:
[cmd=]env[/cmd]

And also:
[cmd=]pkg_add -rv pidgin[/cmd]


----------



## Onoir (Jun 27, 2010)

Thanks so much hydra. It would seem I didn't realize the difference FreeBSD made between the capabilities of sudo and su -. From su I can once again install programs like I'm supposed to. I should have seen the over-obvious solution.

Thanks for the help and sorry for being such a noob


----------

