2019-04-14 21:20:26 +00:00
<!-- # set var="title" value="apt caching for debootstrap" -->
2019-04-25 02:45:09 +00:00
<!-- # set var="date" value="2016 - 04 - 02" -->
2019-04-14 21:20:26 +00:00
<!-- # include file="include/top.html" -->
< p > If you’ re building system images, you’ re going to do a lot of debootstrap, which is going to fetch a lot of packages. On a fast system, that’ ll be the slowest part of the process. Here’ s how to cache.< / p >
2019-04-25 03:18:54 +00:00
< h2 > Install apt-cacher-ng< / h2 >
2019-04-14 21:20:26 +00:00
2019-04-14 22:45:25 +00:00
< pre > < code > sudo apt-get install squid-deb-proxy
< / code > < / pre >
2019-04-14 21:20:26 +00:00
2019-04-25 03:18:54 +00:00
< h2 > Tell programs to use the proxy< / h2 >
2019-04-14 21:20:26 +00:00
2019-04-14 22:45:25 +00:00
< pre > < code > export http_proxy=http://127.0.0.1:8000
# Note that you'll need to re-export this before any use of debootstrap
< / code > < / pre >
2019-04-14 21:20:26 +00:00
2019-04-25 03:18:54 +00:00
< h2 > Tell sudo to pass through http_proxy< / h2 >
2019-04-14 21:20:26 +00:00
2019-04-14 22:45:25 +00:00
< pre > < code > sudo visudo
2019-04-14 21:20:26 +00:00
# Add the line after the env_reset line:
2019-04-14 22:45:25 +00:00
Defaults env_keep += "http_proxy"
< / code > < / pre >
2019-04-14 21:20:26 +00:00
<!-- # include file="include/bottom.html" -->