# Copying pkgs from one system to another



## balanga (May 3, 2021)

What is the simplest way of copying pkgs from one system to another?

I guess I can get a list from one system and subsequently pipe that list into pkg install on the other system using

`cat pkg-listfile | xargs pkg install -y`

Not sure how to get that list in the first place.... maybe `pkg prime-list > pkg-listfile` ....

Does that sound right?


----------



## SirDice (May 3, 2021)

balanga said:


> maybe `pkg prime-list > pkg-listfile` ....


That's probably the best way. That way you don't install any dependencies non-automatic, which means pkg-autoremove(8) will do the right thing if you remove something.


----------

