How to install an old package version with brew

in #macos4 years ago (edited)

How to install an old package version with brew

<p dir="auto">Sometimes you need to roll back to a previous version of a brew package.<br /> If the brew package maintainers do versioning this is as easy as typing <code>brew install <packageName>@1.2.3.<br /> Often times, there's no versioning system though and the only available version is the latest one. <p dir="auto">In previous <code>brew versions you could install a package by directly linking to the GitHub repo that hosts the <code>Formula/<packageName>.rb file.<br /> The repository is usually called <code>homebrew-<packageName> and you can browse through the git commits to find an old <code>Formula/<packageName>.rb file.<br /> For example, you could install an old version of <a href="http://localhost:8000/how-to-rollback-to-an-older-eosio-cdt-version-with-brew/" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">EOSIO.CDT by doing: <pre><code>brew remove eosio.cdt brew install https://raw.githubusercontent.com/EOSIO/homebrew-eosio.cdt/d0f0320017315bd5ac69aa1e1ce001c6567af6b3/eosio.cdt.rb <p dir="auto">Recent <code>brew versions, however, <a href="https://en.wiktionary.org/wiki/verschlimmbessern" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><em>verschlimmbessert this behavior and the brew police tells you that you're not allowed to do this anymore. <pre><code>Error: Calling Installation of <packageName> from a GitHub commit URL is disabled! Use 'brew extract <packageName>' to stable tap on GitHub instead. <h2>What to do now? <p dir="auto">Just do what the error message hints at and use <code>brew extract to <strong><em>stable tap on GitHub. <p dir="auto">To save you some time, here's how to do it: <ol> <li>You create a local "tap" - which I assume is something like a local brew repository <li>You extract the desired version of the package into this local tap <li>You install your local tap <pre><code># use $USER variable to mimick userName/repoName structure # this does not actually create any git repositories # 1. create a new tap brew tap-new $USER/local-<packageName> # 2. extract into local tap brew extract --version=1.2.3 <packageName> $USER/local-<packageName> # 3. run brew install@version as usual brew install <packageName>@1.2.3 <hr /> <p dir="auto">Originally published at <a href="https://cmichel.io/how-to-install-an-old-package-version-with-brew/" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://cmichel.io/how-to-install-an-old-package-version-with-brew/
Sort:  

Congratulations @cmichel! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

<table><tr><td><img src="https://images.hive.blog/60x70/http://hivebuzz.me/@cmichel/posts.png?202009241935" /><td>You published more than 90 posts. Your next target is to reach 100 posts. <p dir="auto"><sub><em>You can view your badges on <a href="https://hivebuzz.me/@cmichel" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">your board and compare yourself to others in the <a href="https://hivebuzz.me/ranking" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Ranking<br /> <sub><em>If you no longer want to receive notifications, reply to this comment with the word <code>STOP <p dir="auto"><strong><span>Do not miss the last post from <a href="/@hivebuzz">@hivebuzz: <table><tr><td><a href="/hivebuzz/@hivebuzz/pud-202010"><img src="https://images.hive.blog/64x128/https://i.imgur.com/805FIIt.jpg" /><td><a href="/hivebuzz/@hivebuzz/pud-202010">Hive Power Up Day - Let's grow together!<tr><td><a href="/hive-192847/@hivebuzz/update-for-regular-authors"><img src="https://images.hive.blog/64x128/https://i.imgur.com/Bkdl8Vk.png" /><td><a href="/hive-192847/@hivebuzz/update-for-regular-authors">Update for regular authors