# How to build a pkg mirror in China?



## zoujiaqing (Aug 7, 2019)

I use FreeBSD pkg, but it's so slow.

I want use my server to build a pkg mirror.

How to do it?


----------



## unitrunker (Aug 7, 2019)

https://www.freebsd.org/doc/handbook/ports-poudriere.html


----------



## hukadan (Aug 7, 2019)

You might want to read this : https://www.freebsd.org/doc/en_US.ISO8859-1/articles/hubs/article.html
Basically, you have two choices :

you can use pkg-fetch(8) to fetch the packages you want to mirror;
you can use caching (e.g. using Squid like described here : http://stafwag.github.io/blog/blog/2015/06/23/using-squid-to-cache-freebsd-packages/).
-- Edit --
You can also have a look at this post for an other example of caching.


----------

