Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to cache packages which have been installed via `apt-get` in Travis CI?

So, with my .travis.yml, I'm installing some packages via apt-get which doesn't take too long to download, but a very long time to install.

Is there a way to make Travis CI remember the installed packages, so I won't have to install them from scratch for every build?

like image 694
finefoot Avatar asked Dec 01 '17 23:12

finefoot


1 Answers

There seems to be no easy or convenient way to cache all of the packages you need to install via apt-get. According to the Caching Dependencies and Directories documentation, Travis CI currently only provides "convenience" caching for Bundler, CocoaPods, Yarn (and a few others).

However! If you can determine where apt-get installs each of the packages you need (as install locations vary from one package to the next), you can cache each of those install directories individually by following the steps in the Arbitrary directories documentation.

I hope this helps. Please let me know if you have any other questions and I'd be happy to help in any way I can. Cheers!

like image 120
Luna G. Avatar answered Sep 28 '22 04:09

Luna G.