Skip to content

Cannot run "brew init" while following getting-started guide #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
aloyr opened this issue Sep 7, 2024 · 7 comments
Open

Cannot run "brew init" while following getting-started guide #285

aloyr opened this issue Sep 7, 2024 · 7 comments

Comments

@aloyr
Copy link

aloyr commented Sep 7, 2024

to reproduce

run:

brew init

after having installed it with brew install rcmdnk/file/brew-file and adding the following lines to ~/.bashrc:

if [ -f $(brew --prefix)/etc/brew-wrap ];then
  source $(brew --prefix)/etc/brew-wrap
fi

results

brew init
Do you want to set a repository (y)? ((n) for local Brewfile). [y/n]: n
Traceback (most recent call last):
  File "/opt/homebrew/bin/brew-file", line 3646, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/bin/brew-file", line 3633, in main
    b.execute()
  File "/opt/homebrew/bin/brew-file", line 2954, in execute
    _ = self.initialize()
        ^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/bin/brew-file", line 2165, in initialize
    self.get_installed_packages()
  File "/opt/homebrew/bin/brew-file", line 1970, in get_installed_packages
    p, info[p]
       ~~~~^^^
KeyError: 'python-certifi'

also, no files nor folders under ~/.config/brewfile. not even that folder exists.

expected results

no errors

my environment (from neofetch)

OS: macOS 14.5 23F79 arm64
Host: MacBookPro18,2
Kernel: 23.5.0
Uptime: 5 days, 19 hours, 34 mins
Packages: 1 (port), 318 (brew)
Shell: bash 5.2.32
Resolution: 1728x1117@2x
DE: Aqua
WM: Quartz Compositor
WM Theme: Blue (Light)
Terminal: tmux
CPU: Apple M1 Max
GPU: Apple M1 Max
Memory: 5472MiB / 32768MiB
Disk (/): 12G / 1.8T (15%)
Battery: 91%
@rcmdnk
Copy link
Owner

rcmdnk commented Sep 7, 2024

It seems same problem as #265.

Could you please run:

command brew update & command brew upgrade

then try:

brew init

@aloyr
Copy link
Author

aloyr commented Sep 29, 2024

i ran command brew update & command brew upgrade then re-ran

brew install rcmdnk/file/brew-file

and added the following to my ~/.bashrc file:

if [ -f $(brew --prefix)/etc/brew-wrap ];then
  source $(brew --prefix)/etc/brew-wrap
fi

running brew init and selecting no repo or repo option give me the same output:

brew init
Do you want to set a repository (y)? ((n) for local Brewfile). [y/n]: n
Traceback (most recent call last):
  File "/opt/homebrew/bin/brew-file", line 3646, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/bin/brew-file", line 3633, in main
    b.execute()
  File "/opt/homebrew/bin/brew-file", line 2954, in execute
    _ = self.initialize()
        ^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/bin/brew-file", line 2165, in initialize
    self.get_installed_packages()
  File "/opt/homebrew/bin/brew-file", line 1970, in get_installed_packages
    p, info[p]
       ~~~~^^^
KeyError: 'python-certifi'

@rcmdnk
Copy link
Owner

rcmdnk commented Sep 30, 2024

Could you please check and give me the result of following command?

$ brew ls | grep certifi

@tygore587
Copy link

tygore587 commented Oct 4, 2024

I have the same issue.

The output of

command brew update & command brew upgrade

was:

command brew update & command brew upgrade
[1] 26104
==> Updating Homebrew...
Already up-to-date.

[1]  + 26104 done       command brew update

but the problem still persists.

The output of:

$ brew ls | grep certifi

is:

ca-certificates
certifi
python-certifi

@rcmdnk
Copy link
Owner

rcmdnk commented Oct 4, 2024

python-certifi and certifi are formulae
for the same package.
I'm not sure why both of them can exist in the same time.
Any special taps are there...?

Anyway, there is something wrong in brew system (not brew-file),
I think it is better to do something like:

$ brew rm python-certifi
$ brew rm certify
$ brew cleanup
$ rm -rf $(brew --cache)

Then re-install certify again.

@tygore587
Copy link

tygore587 commented Oct 4, 2024

I didn't install it myself, so maybe its part of some other dependency?

I have the following taps:

homebrew/bundle
homebrew/cask-versions
homebrew/services
oven-sh/bun
rcmdnk/file
superatomic/bundle-extensions

I will try running the commands and will report. Thanks for your help.

EDIT:
Running brew rm python-certifi results in the following error:

Error: Refusing to uninstall /opt/homebrew/Cellar/certifi/2024.8.30
because it is required by streamlink and yt-dlp, which are currently installed.
You can override this and force removal with:
  brew uninstall --ignore-dependencies python-certifi

and running brew rm certifi in:

Error: Refusing to uninstall /opt/homebrew/Cellar/certifi/2024.8.30
because it is required by streamlink and yt-dlp, which are currently installed.
You can override this and force removal with:
  brew uninstall --ignore-dependencies certifi

And got another hint:

brew rm python-certifi
Warning: Formula python-certifi was renamed to certifi.
Warning: Formula python-certifi was renamed to certifi.
Warning: Formula python-certifi was renamed to certifi.
Error: No such keg: /opt/homebrew/Cellar/python-certifi

Maybe the rename created this bug that both can exist.

@tygore587
Copy link

Thanks, it worked :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants