search

Home  >  Q&A  >  body text

ubuntu16.04 - How to use tools such as apt-mirror to cache ppa:ondrej/php to the local server in ubuntu?

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?

扔个三星炸死你扔个三星炸死你2718 days ago881

reply all(2)I'll reply

  • 滿天的星座

    滿天的星座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

    reply
    0
  • 阿神

    阿神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 package
    apt-get download <package-name>

    Command to create local source
    dpkg-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 packages
    sudo dpkg --get-selections > /home/package.selections
    Download software packages in batches according to the software list
    for req in $(cat ~/package.selections | cut -f 1 | cut -f 1 -d ":" ); do apt-get download $req; done

    reply
    0
  • Cancelreply