PHP 开发的小伙伴都清楚,当你运行 apt-get install php7.1-fpm 的之前,必须先将源加进来
apt-get install php7.1-fpm
通常的做法是:add-apt-repository ppa:ondrej/php
add-apt-repository ppa:ondrej/php
本来,这个步骤没有什么不妥,但是,实在太慢了!!
所以,想问一下,如何在本地缓存这些包呢?
添加只有一次而已啊。。。搞不懂你,下载包慢基本是你网络问题
APT安装软件的cache目录 /var/cache/apt/ 你可以直接去里面翻出刚才安装的软件包。
/var/cache/apt/
下载软件包的命令apt-get download <package-name>
apt-get download <package-name>
创建本地源的命令dpkg-scanpackages /home/ubuntu-local/wily /dev/null |gzip > /home/ubuntu-local/wily/Packages.gz -rdpkg-scanpackages /home/ubuntu-local/wily /dev/null |gzip > /home/ubuntu-local/wily/Packages.gz -r本地源echo "deb http://localhost/ubuntu-local/wily /" > /etc/apt/source.list.d/local.list本地源echo "deb http://localhost/ubuntu-local/wily /" > /etc/apt/source.list.d/local.list
dpkg-scanpackages /home/ubuntu-local/wily /dev/null |gzip > /home/ubuntu-local/wily/Packages.gz -r
echo "deb http://localhost/ubuntu-local/wily /" > /etc/apt/source.list.d/local.list
备份已安装软件包列表sudo dpkg --get-selections > /home/package.selectionssudo dpkg --get-selections > /home/package.selections根据软件列表批量下载软件包for req in $(cat ~/package.selections | cut -f 1 | cut -f 1 -d ":" ); do apt-get download $req; done根据软件列表批量下载软件包
sudo dpkg --get-selections > /home/package.selections
for req in $(cat ~/package.selections | cut -f 1 | cut -f 1 -d ":" ); do apt-get download $req; done
添加只有一次而已啊。。。搞不懂你,下载包慢基本是你网络问题
APT安装软件的cache目录
/var/cache/apt/
你可以直接去里面翻出刚才安装的软件包。下载软件包的命令
apt-get download <package-name>
创建本地源的命令
dpkg-scanpackages /home/ubuntu-local/wily /dev/null |gzip > /home/ubuntu-local/wily/Packages.gz -r
dpkg-scanpackages /home/ubuntu-local/wily /dev/null |gzip > /home/ubuntu-local/wily/Packages.gz -r
本地源
echo "deb http://localhost/ubuntu-local/wily /" > /etc/apt/source.list.d/local.list
本地源echo "deb http://localhost/ubuntu-local/wily /" > /etc/apt/source.list.d/local.list
备份已安装软件包列表
sudo dpkg --get-selections > /home/package.selections
sudo dpkg --get-selections > /home/package.selections
根据软件列表批量下载软件包
for req in $(cat ~/package.selections | cut -f 1 | cut -f 1 -d ":" ); do apt-get download $req; done
根据软件列表批量下载软件包for req in $(cat ~/package.selections | cut -f 1 | cut -f 1 -d ":" ); do apt-get download $req; done
🎜