# pkg_add login error



## tamazero (Oct 2, 2013)

Hi I have a problem when I tries to install a package with a fresh FreeBSD 9.2 installation: 


```
root@splunk:~ # pkg_add -r wget
Error: Unable to get [url]ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.2-release/Latest/wget.tbz:[/url] Not logged in
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.2-release/Latest/wget.tbz' by URL
root@splunk:~ # pkg_add -rv wget
scheme:   [ftp]
user:     []
password: []
host:     [ftp.freebsd.org]
port:     [0]
document: [/pub/FreeBSD/ports/i386/packages-9.2-release/Latest/wget.tbz]
---> ftp.freebsd.org:21
looking up ftp.freebsd.org
connecting to ftp.freebsd.org:21
<<< 220 FTP Server ready.
>>> USER anonymous
<<< 331 Password required for anonymous
>>> PASS root@splunk
<<< 530 Login incorrect.
Error: Unable to get [url]ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.2-release/Latest/wget.tbz:[/url] Not logged in
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.2-release/Latest/wget.tbz' by URL
pkg_add: 1 package addition(s) failed
```

I think it's a silly problem but I can't find any  solutions.

Best regards.
Fabio.


----------



## SirDice (Oct 2, 2013)

Don't use the -RELEASE packages, they are never updated. Set PACKAGESITE to ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-stable/Latest/ and try again.


----------



## tamazero (Oct 2, 2013)

Thanks, I tried but I have the same problem.

<code>

```
root@splunk:~ # setenv PACKAGESITE [URL]ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-stable/Latest/[/URL]
root@splunk:~ # pkg_add -rv wget                                                scheme:   [ftp]
user:     []
password: []
host:     [ftp.freebsd.org]
port:     [0]
document: [/pub/FreeBSD/ports/i386/packages-9-stable/Latest/wget.tbz]
---> ftp.freebsd.org:21
looking up ftp.freebsd.org
connecting to ftp.freebsd.org:21
<<< 220 FTP Server ready.
>>> USER anonymous
<<< 331 Password required for anonymous
>>> PASS root@splunk
<<< 530 Login incorrect.
Error: Unable to get [URL]ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-stable/Latest/wget.tbz:[/URL] Not logged in
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-stable/Latest/wget.tbz' by URL
pkg_add: 1 package addition(s) failed
```
</code>


----------



## SirDice (Oct 2, 2013)

Did you set FTP_PASSWORD, FTP_LOGIN or FTP_PROXY? None of them should be set. Also try with the fetch(1) command (that's what pkg_add(1) uses):

```
dice@armitage:~% fetch ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-stable/Latest/wget.tbz
wget.tbz                                      100% of  583 kB 1031 kBps 00m01s
```


----------



## tamazero (Oct 2, 2013)

I haven't set any environment variable, I've just installed the OS. I tried with the `fetch` command as you suggested but I have the same error: "Not logged in". The only strange thing I do is that the OS is installed in a KVM container, but I don't think this is a problem.


----------

