-
I am not familar with apt cache. Just started a ubuntu container from command line, and run
apt update, but nothing gets cached in/var/cache/apt/archives(it only contains filelockand directorypartial). What command are you using to populate the cache? -
I think you also need /var/lib/apt/lists to cache indexes. /Var/cache/apt/archives are for packages, iirc...
-
@robin @markkrj Thank you for the help, I tried also caching
/var/lib/apt/lists, as well as the whole/var/cache/aptdirectory. I am installing packages withapt install. I realized thataptdoes not keep the packages by default, whileapt-getdoes, so I tried applying the following fix:- echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/98keep-debs - echo 'APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/99keep-debsSomehow I still get
Get:requests and it does not seem any faster, it still takes a good 6 minutes for the actual building to start.Not sure what is going on...
-
Thanks for the info @markkrj. Just cached
/var/lib/apt/lists, and runapt-get update, the cache works as expected. The second run finishes very fast with all cache hit message.Not sure why
aptcache does not work. But at OneDev side, it is doing the job as expected (remount cache to specified directory in container). Also please note that cache may gets cleared from time to time (one week by default, and can be tuned in job executor). So do not assume it should contain any particular files. -
Previous Value Current Value Open
Closed
-
@robin @markkrj Re-investigating this, my issue was that in the
ubuntu:18.04Docker image that I am using,/etc/apt/apt.conf.d/docker-cleancontains the following:DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; }; APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; }; Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";Removing that file at the beginning of my build spec solved the issue.
| Type |
Question
|
| Priority |
Normal
|
| Assignee |
I have the following cache set up:
Yet I don't notice any improvement speeding up the builds and see outputs like
Get:1 http://archive.ubuntu.com/ubuntu. It takes a good 6 minute for the actual building to start.Am I doing something wrong? Thank you.