pip
1 Get the pip package on the current machine
pip freeze --all >package.txt
2 Download the package to a directory
pip install --download /home/xxx/pip-packages -r package.txt
3 Restore on another machine
pip install --no-index --find-index=/home/xxx/pip-packages -r package.txt
For ubuntu words.
sudo apt-get install xxx
After downloading, the data will be stored in
/var/cache/apt/archives
Copy all the debs. to a directory deb-packs
1 Generate package information
dpkg-scanpackages deb-packs /dev/null |gzip >deb-packs/Packages.gz -r
2 Modify the local source
sudo vi /etc/apt/sources.list
deb file:///home/xxxxx/deb-packs
Note that there are two // in front of the path
3更新sudo apt-get update
Then you can install the corresponding package with sudo apt-get install xxxx