Here I put the final solution. I tried many methods on my mac M1, the best method is re-install homebrew.
Step1:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
Step2: Install homebrew
cd /opt
mkdir homebrew # if not exist, just create one.
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
Then, the problem solved.
Answer from Frank on Stack OverflowI have downloaded a game and and everytime i open, it says “The application cant be opened”. And when i try to run the executable file of the app i got this.
While Trying to run the app from terminal, i get zsh permission denied.
Thanks in advance.
Here I put the final solution. I tried many methods on my mac M1, the best method is re-install homebrew.
Step1:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
Step2: Install homebrew
cd /opt
mkdir homebrew # if not exist, just create one.
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
Then, the problem solved.
I used the below commands:
brew uninstall git
brew update
brew reinstall pcre2 gettext
brew install git
Git worked after.
Hi, I'm pretty new to homebrew and the whole command line thing on the Mac, so please be kind ;) Every time I try to use YouTube-DL this happens:
youtube-dl --verbose "https://www.youtube.com/watch?v=lKeUCkBO8QA" zsh: killed youtube-dl --verbose "https://www.youtube.com/watch?v=lKeUCkBO8QA"
I spend hours googling for help, but I couldn't find anything. Can someone please explain to me what's going on there and wtf is killing that process?
Btw I got Vidl installed also.
When I type brew, I get the output:
zsh: killed brew
Writing out the whole path still gives the same output, so it doesn't seem like a path problem.
Furthermore, running /bin/bash gives the output:
zsh: killed /bin/bash
I changed the names of .zshrc and .zprofile, yet the problem still persisted.
To add on, this problem also occurs with programs like pyenv.
When I run my python program in zsh using python3 Mosesh.py I get the message zsh: killed python3 Mosesh.py after a few seconds. All the program is doing at the moment is creating a list of data to work with but at most that should be about 14kB so being out of ram doesn’t seem to be the issue as most of my googling has suggested. I’ve also noticed the issue persists in other shells such as bash. Any ideas what the issue is or how to fix it? Thanks.
First, zsh (and as such all other shells) isn't killing python, it's only reporting that is has been killed.
The message 'killed' is a definitive info that the child process (python3 here) has received the uncatchable SIGKILL (9) signal. Unless there's user code that sends itself that signal, it would need a bit of debugging to determine the cause. You could use strace python3 ... to get an idea of what the program was doing at the time. Sometimes, the kernel kills a process, it would report that in the kernel messages available with dmesg.
Show us the script header and summarize what the script does, and whether the script runs as user or root.
I’ve also noticed the issue persists in other shells such as bash.
Do you mean same Python script in a different shell environment?
I suspect the Python script is overflowing the stack or some other programming no-no, thereby precipitating its own termination.
Also, the Python script should have a header that obviates the need to explicitly call the script as an argument to Python 3. A header like this:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# your program here
I was able to solve this problem. I suspected that some login item made my /bin/bash turn weird. So under someone's recommendation I ran mac in safe mode, and found that everything ran perfectly. Thus, it was a specific login item which screwed up my bash.
For me, it was the yabai window management utility, as there must have been something in the startup script which screwed up my shell.
The first two things I check is uptime and ps -ef | wc to make sure you don’t have runaway processes and the default limits. If the system is not healthy enough to run that, restart and if it still immediately kills the shell, start again but in safe mode.
https://support.apple.com/guide/mac-help/start-up-your-mac-in-safe-mode-mh21245/mac
Hopefully these triage steps let you know the Mac is configured and runs well after a start and you can watch for something that’s added that exhausts your process count.
Once you’re sure it’s not process count and repeatably just brew that crashes or gets killed, restart normally, and look in the console for what specifically is crashing.
Pay particular attention to the status of Rosetta 2 and which brew tools are installed for which processor architecture on your Mac.
softwareupdate --install-rosetta
The output of brew doctor might be particularly helpful in this situation once obvious things are ruled out.