Last active
February 16, 2024 08:57
-
-
Save onewheelskyward/7228938 to your computer and use it in GitHub Desktop.
brew reinstall commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brews = [] | |
out = IO.popen("brew list", "r") do |io| | |
brews = io.read.split "\n" | |
end | |
def parse(brew, brew_info) | |
in_options = false | |
print "brew reinstall -v #{brew} " | |
brew_info.split("\n").each do |m| | |
#puts m.inspect | |
if in_options | |
m.scan(/(--[a-zA-Z-]+)/).each do |x| | |
print x[0] + " " | |
end | |
#puts matchdata.inspect | |
in_options = false | |
end | |
if /\*$/.match m | |
in_options = true | |
end | |
end | |
puts | |
end | |
brews.each do |brew| | |
#puts "brew info #{brew}" | |
IO.popen("brew info #{brew}", "r") do |info| | |
parse(brew, info.read) | |
end | |
end |
I had a problem with incompatible with the standard library, libstd c++. To fix this, found the incompatible formulary, uninstall it, and reinstall it. Then go back to the formulary that has the install error and resintall it. Keep doing this until there is no error.
Error
Error: gdal dependency proj was built with the following
C++ standard library: libstdc++ (from clang)
Fix
$ brew reinstall proj
$ brew install gdal
Not familiar with much of brew
and ruby
, so there could be a more simpler and easy way. Hope this helps.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doesn't this script simply reinstall all installed packages (preserving options)?
I found a link to this script on the wiki (https://github.com/Homebrew/homebrew/wiki/C++-Standard-Libraries) which claims that it only reinstalls root packages, whatever that means:
However,
brew list
does list all installed formulas (according toman brew
), and AFAIK each listed formula is also listed in the output.