# Cannot install packages



## sigh (Apr 22, 2011)

Hey all, 
I  just installed FreeBSD 8.2 and am having an issue installing packages. I do `pkg_add -r (someapp)` and it starts downloading but then usually stops and just hangs there. Happens with all packages I try to install.  Was I suppose to do something else beforehand?


----------



## mamalos (Apr 22, 2011)

Have you got a reliable network connection? Can you *fetch* files yourself (can you *ftp* to ftp.freebsd.org and get some file)? You can download the package you wish from a site and install it using *pkg_add pkgname*. Try ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages/ if your machine is 32-bit or just change i386 with amd64 if your machine is 64-bit, and see if you can fetch the file on your system.


----------



## Beastie (Apr 22, 2011)

It often happens with me and has happened before with other people on these forums if memory serves me right. I've never reported the problem as I don't think it's *pkg_add*'s or even *fetch*'s problem. I once tried to download multiple files using ftp/wget and got the same problem. It seems to only happen when downloading large files (> 1 MB). The FTP just doesn't respond anymore until you manually close the connection by terminating the application and retry.


----------



## hangover (Apr 22, 2011)

You can try to enable verbose mode (pkg_add -vr ...) and see what's happens with ftp connection.


----------



## Beastie (Apr 22, 2011)

hangover said:
			
		

> You can try to enable verbose mode (pkg_add -vr ...) and see what's happens with ftp connection.


I've tried that and IIRC it hangs right before closing the connection.


----------



## mamalos (Apr 22, 2011)

beastie,

If things are as you say, then it's serious. Do you have a standard way to recreate the problem? If so, you should maybe send a PR or contact the freebsd-stable mailing list.


----------



## da1 (Apr 22, 2011)

sigh said:
			
		

> Hey all,
> I  just installed freebsd 8.2 and am having an issue installing packages. I do pkg_add -r (someapp) and it starts downloading but then usually stops and just hangs there. Happens with all packages I try to install.  Was I suppose to do something else beforehand?



Try a CTRL+T when it hangs as it might give you some hints as to what's wrong.


----------



## Beastie (Apr 22, 2011)

Of course I've considered reporting it. But what to report and where. It's not even clear what the problem is. And I don't have a "standard way to recreate the problem". I've had this problem from time to time since, I don't know, 5.x?! Sometimes it behaves normally, sometimes not ...

It may have something to do with FreeBSD, I don't know, but one thing is sure, it has nothing to do with "high-level" tools such as fetch and pkg_add. I just tested it with
`% wget -i list.txt`
list.txt contains these:

```
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/All/xorg-server-1.7.5,1.tbz
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/All/gnutls-2.8.6_2.tbz
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/All/libsamplerate-0.1.7_1.tbz
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/All/iso-codes-3.23.tbz
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/All/font-bh-75dpi-1.0.1.tbz
```

Once the first file (xorg-server-1.7.5,1.tbz) reached 100% wget "froze".

da1 proposed to check the info screen (ctrl+t). Here it is:

```
load: 0.00  cmd: wget 1838 [select] 655.83r 0.04u 0.10s 0% 1924k
```

Try it yourself and report back.


----------



## mamalos (Apr 22, 2011)

I've tried it and I didn't come into any issues...strange! To be honest, I've never had such problems in my life, and I've been working with FreeBSD since 4.x. Can it be related to your providers', maybe? Strange!


----------



## da1 (Apr 22, 2011)

I tried it too and it works but I have to admit that the problem Beastie is describing happened to me several times too.


----------



## sigh (Apr 23, 2011)

Thanks for the responses guys. I know my network connection is good, never have any issues downloading or connection problems. In release 8.1 I had the same issue but only with certain packages, now that I installed 8.2 it seems to happen with all of them. Guess I'll just manually download or install from ports.


----------

