PHP development friends all know that before you run apt-get install php7.1-fpm
, you must first add the source
The usual approach is: add-apt-repository ppa:ondrej/php
Originally, there was nothing wrong with this step, but it was too slow! !
So, I would like to ask, how to cache these packages locally?
滿天的星座2017-06-14 10:52:02
You only need to add it once. . . I don’t understand you, the slow downloading package is basically a problem with your network
阿神2017-06-14 10:52:02
The cache directory of the APT installation software /var/cache/apt/
You can directly go there to find the software package you just installed.
Command to download software packageapt-get download <package-name>
Command to create local sourcedpkg-scanpackages /home/ubuntu-local/wily /dev/null |gzip > /home/ubuntu-local/wily/Packages.gz -r
local sourceecho "deb http ://localhost/ubuntu-local/wily /" > /etc/apt/source.list.d/local.list
Back up the list of installed software packagessudo dpkg --get-selections > /home/package.selections
Download software packages in batches according to the software listfor req in $(cat ~/package.selections | cut -f 1 | cut -f 1 -d ":" ); do apt-get download $req; done