# MacOS containers must upgrade Homebrew package location every build!

**URL:** <https://discuss.circleci.com/t/macos-containers-must-upgrade-homebrew-package-location-every-build/27250>\
**Category:** Build Environment\
**Tags:** macos, ios\
**Created:** [December 19, 2018, 7:45pm UTC](https://discuss.circleci.com/t/macos-containers-must-upgrade-homebrew-package-location-every-build/27250 "2018-12-19T19:45:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrista](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jrista/32/20005_2.png) [@jrista](https://discuss.circleci.com/u/jrista)\
**Post date:** [December 19, 2018, 7:45pm UTC](https://discuss.circleci.com/t/macos-containers-must-upgrade-homebrew-package-location-every-build/27250/1 "2018-12-19T19:45:11Z")

</div>

It appears that Homebrew made a major update, changed how casks work and where they are stored. As a result of this every time a build runs on a MacOS container that uses brew, it spends 7-10 minutes moving the cask files, before continuing on to do anything else. This has about doubled our build times. We have tried to use the save state feature, however it does not seem to be applying for any path outside of the working folder.

 ![16%20PM](https://global.discourse-cdn.com/circleci/original/3X/1/a/1a082e450e0ecfa136baf1b3445520e1e2166631.png)

Is there any way we could get the MacOS base container updated with the latest Homebrew, so that this migration of packages is done once and no longer needs to be done on each run?

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [December 19, 2018, 11:18pm UTC](https://discuss.circleci.com/t/macos-containers-must-upgrade-homebrew-package-location-every-build/27250/2 "2018-12-19T23:18:44Z")

</div>

Could you downgrade your version of Homebrew in every build?

---

<div class="post-metadata">

**Author:** ![jrista](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jrista/32/20005_2.png) [@jrista](https://discuss.circleci.com/u/jrista)\
**Post date:** [December 21, 2018, 6:19pm UTC](https://discuss.circleci.com/t/macos-containers-must-upgrade-homebrew-package-location-every-build/27250/3 "2018-12-21T18:19:41Z")

</div>

Not that I know of. I need to install new packages with brew. I am not trying to update brew itself explicitly, simply the act of installing a package at all forces the upgrade process, and brew moves its casks to the new location.

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [December 21, 2018, 7:05pm UTC](https://discuss.circleci.com/t/macos-containers-must-upgrade-homebrew-package-location-every-build/27250/4 "2018-12-21T19:05:21Z")

</div>

Ah, revealed with some [Duckduckgoing](https://duckduckgo.com/?q=prevent+homebrew+from+automatically+updating&ia=web), it seems there is [an env var to disable Brew auto-updating](https://github.com/travis-ci/travis-build/pull/1062/commits/9bb777e7951ca0e291f59a04b68d8f2b5fbc17a6).

---

<div class="post-metadata">

**Author:** ![jrista](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jrista/32/20005_2.png) [@jrista](https://discuss.circleci.com/u/jrista)\
**Post date:** [December 22, 2018, 1:18am UTC](https://discuss.circleci.com/t/macos-containers-must-upgrade-homebrew-package-location-every-build/27250/5 "2018-12-22T01:18:44Z")

</div>

Thanks! That is helpful.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [March 22, 2019, 1:18am UTC](https://discuss.circleci.com/t/macos-containers-must-upgrade-homebrew-package-location-every-build/27250/6 "2019-03-22T01:18:46Z")

</div>

Closed on March 22, 2019, 1:18am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
