# pkg install very slow



## casianbsd (Oct 21, 2021)

1 day ago my freebsd pkg install worked fine now i just wanted to install thunar and it took 5 minutes to check the repository and 40 minutes to install and my internet spped also shows as 3mb/s on the installation but still very slow


----------



## Geezer (Oct 21, 2021)

Whichever geographically close pkgmir.geo.freebsd.org you are using might not be too good. The one nearest me is often slow, or not even working. I do not know where Alba Iulia is.

You can always find one a bit further away that is more reliable and add it to your /etc/hosts .


----------



## SirDice (Oct 21, 2021)

Browse to http://pkg.freebsd.org. You will find a list of mirrors at the bottom.

Create a /usr/local/etc/pkg/repos/FreeBSD.conf:

```
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly"
}
```
Change the pkg.freebsd.org to another mirror. But note that individual mirrors are not guaranteed to be up and running.


----------



## casianbsd (Oct 21, 2021)

SirDice said:


> Browse to http://pkg.freebsd.org. You will find a list of mirrors at the bottom.
> 
> Create a /usr/local/etc/pkg/repos/FreeBSD.conf:
> 
> ...


i got into that site, what do i need to download and how should i download it?


----------



## SirDice (Oct 21, 2021)

You don't download anything, just look at the bottom of the page for package mirrors you can use.


----------



## casianbsd (Oct 21, 2021)

SirDice said:


> You don't download anything, just look at the bottom of the page for package mirrors you can use.


okay i found this one : http://pkg0.pkt.freebsd.org
now what do i need to do?


----------



## SirDice (Oct 21, 2021)

See post #3.


----------



## astyle (Oct 21, 2021)

Right now, my connection is rated at 1.5 MB up AND down combined, by my ISP. Best I can get in practice is 435 KB/sec download. It's a cheap connection, but enough for my place... Normally, it took about 20-30 seconds to parse packagesite.txz (Back when I was using packages, I use ports nowadays). But once a package was downloaded, no way it would take even 5 minutes to install.

Geezer : Your link redirects to Google Maps. Did you know that you can zoom out and pinpoint on the continent the pinned/linked location?


Geezer said:


> I do not know where Alba Iulia is.


It's in SE EU.


----------



## seirios (Oct 21, 2021)

If your FreeBSD environment is on hypervisor like XCP-ng or any other qemu based vm, so you try to config followings.

ifconfig xxx -txcsum -rxcsum -tso -lero

because the tcp offliad and checksum offload cause problems.

I hope to solve your problems.


----------



## astyle (Oct 21, 2021)

seirios said:


> If your FreeBSD environment is on hypervisor like XCP-ng or any other qemu based vm, so you try to config followings.
> 
> ifconfig xxx -txcsum -rxcsum -tso -lero
> 
> ...


Let me see if I got that straight:

If OP's FreeBSD installation is on a VM. Highly unlikely that it is, wouldn't hurt to ask.
Your ifconfig(8) command - have you checked it yourself? I was unable to find the "-lero" option. 
In response to analysis of "tcp offload": TCP offload engine is something implemented by the hardware driver for the network card.  To the best of my knowledge, the API is only available in ifconfig(8) to communicate with the card's hardware driver. It's a rarely used option. I imagine it would useful for an *emulated* card for the scenarios where you want a specific virtual NIC for the VM, and that NIC requires some tuning to work right. But even the Wikipedia page points out that the info on "tcp offload" is outdated.
The Wikipedia page also points out that in consumer NICs (which is most likely what OP has) the offloading options went away in 2012, because the NICs have gotten much better at handling data loads at a wide range of speeds.


----------



## Geezer (Oct 22, 2021)

astyle said:


> Geezer : Your link redirects to Google Maps. Did you know that you can zoom out and pinpoint on the continent the pinned/linked location?
> 
> It's in SE EU.



You have shown me something new. I just copied the location from casianbsd 's profile and the link was there.

I have tried it with my location, and google maps shows me that I am in SMAK Museum of Contemporary Art in Knust. I did not think I was there.


----------



## seirios (Oct 22, 2021)

astyle said:


> Your ifconfig(8) command - have you checked it yourself? I was unable to find the "-lero" option.


-lero is only typo. replace to -lro

I’m using FreeBSD 13-RELEASE on XCP-ng, and faces tcp checksum error, so I configured that options, it solved.


----------



## Letheposting (Oct 20, 2022)

Is your system defaulting to IPv6? I had a similar problem (my ISP has shoddy IPv6 support) and I fixed it by running `pkg -4` instead of just `pkg` to force it to use IPv4 instead.


----------



## smithi (Oct 20, 2022)

astyle said:


> In response to analysis of "tcp offload": TCP offload engine is something implemented by the hardware driver for the network card.  To the best of my knowledge, the API is only available in ifconfig(8) to communicate with the card's hardware driver. It's a rarely used option. I imagine it would useful for an *emulated* card for the scenarios where you want a specific virtual NIC for the VM, and that NIC requires some tuning to work right. But even the Wikipedia page points out that the info on "tcp offload" is outdated.
> The Wikipedia page also points out that in consumer NICs (which is most likely what OP has) the offloading options went away in 2012, because the NICs have gotten much better at handling data loads at a wide range of speeds.


Nevertheless, if using ipfw with kernel NAT, you must disable TSO (with -tso) for nics that enable it; I've had one.  See third last para of ipfw(8). cheers


----------



## patmaddox (Oct 21, 2022)

tso (and I think lro) will slow your network to a crawl on cloud hosts.


----------

