zsh: command not found: mkfs on macOS - macos

Hi i entered it in terminal macOS
dd if=/dev/zero of=img.1440 bs=1k count=1440
mkfs img.1440
And got this error
zsh: command not found: mkfs

mkfs is a Linux command, but if you have Homebrew installed, you can install e2fsprogs:
brew install e2fsprogs
Then run mkfs.ext3:
$(brew --prefix e2fsprogs)/sbin/mkfs.ext3 img.1440

Related

ERROR: The Python zlib extension was not compiled. Missing the zlib?

I'm trying to install Python 2.7.7 using Homebrew AND pyenv on my Mac (MacBook Air, OSX 12.5 Monterrey, 1.6 GHz Dual-Core Intel Core i5) but keep getting this “Missing zlib” error.
Just for reference, I have done the following:
When I Installed pyenv, I ran command nano ~/.bashrc (I'm using bash shell) - and pasted and saved on /.bashrc ---> eval "$(pyenv init -)"
then I ran pyenv install 2.7.7 (didn't work and found online step 3.)
CPPFLAGS="-I$(brew --prefix zlib)/include" pyenv install -v 2.7.7 (Again, same error and did step 4.)
ran brew reinstall zlib and overrode on "/.bashrc" eval "$(pyenv init -)" to:
export PATH="/usr/local/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/bzip2/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include"
-------------Start of Error ----------------
rm -f /Users/victor/.pyenv/versions/2.7.7/bin/python2
(cd /Users/victor/.pyenv/versions/2.7.7/bin; ln -s python2.7 python2)
rm -f /Users/victor/.pyenv/versions/2.7.7/bin/python2-config
(cd /Users/victor/.pyenv/versions/2.7.7/bin; ln -s python2.7-config python2-config)
rm -f /Users/victor/.pyenv/versions/2.7.7/bin/python-config
(cd /Users/victor/.pyenv/versions/2.7.7/bin; ln -s python2-config python-config)
test -d /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig || /usr/bin/install -c -d -m 755 /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig
rm -f /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig/python2.pc
(cd /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig; ln -s python-2.7.pc python2.pc)
rm -f /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig/python.pc
(cd /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig; ln -s python2.pc python.pc)
rm -f /Users/victor/.pyenv/versions/2.7.7/share/man/man1/python2.1
(cd /Users/victor/.pyenv/versions/2.7.7/share/man/man1; ln -s python2.7.1 python2.1)
rm -f /Users/victor/.pyenv/versions/2.7.7/share/man/man1/python.1
(cd /Users/victor/.pyenv/versions/2.7.7/share/man/man1; ln -s python2.1 python.1)
ERROR: The Python zlib extension was not compiled. Missing the zlib?
Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems
BUILD FAILED (OS X 12.5 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/__/1_b0871s7fl7fpwydg4ycjj80000gn/T/python-build.20220729111901.75727
Results logged to /var/folders/__/1_b0871s7fl7fpwydg4ycjj80000gn/T/python-build.20220729111901.75727.log
Last 10 log lines:
(cd /Users/victor/.pyenv/versions/2.7.7/bin; ln -s python2-config python-config)
test -d /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig || /usr/bin/install -c -d -m 755 /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig
rm -f /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig/python2.pc
(cd /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig; ln -s python-2.7.pc python2.pc)
rm -f /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig/python.pc
(cd /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig; ln -s python2.pc python.pc)
rm -f /Users/victor/.pyenv/versions/2.7.7/share/man/man1/python2.1
(cd /Users/victor/.pyenv/versions/2.7.7/share/man/man1; ln -s python2.7.1 python2.1)
rm -f /Users/victor/.pyenv/versions/2.7.7/share/man/man1/python.1
(cd /Users/victor/.pyenv/versions/2.7.7/share/man/man1; ln -s python2.1 python.1)
Victors-MacBook-Air:~ victor$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Victors-MacBook-Air:~ victor$
Victors-MacBook-Air:~ victor$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Victors-MacBook-Air:~ victor$
Victors-MacBook-Air:~ victor$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Victors-MacBook-Air:~ victor$
Victors-MacBook-Air:~ victor$ software update
-bash: software: command not found
------------- End of Error -----------------
Any idea?.... Please let me know... I'd highly appreciate it
With a similar configuration, 2018 MBA on Monterey, I was having the same problem as you with pyenv install 2.7.6
I was able to go past the missing zlib issue with the following additions to the shell's profile:
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export LDFLAGS="-L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include"
export PKG_CONFIG_PATH="/usr/local/opt/zlib/lib/pkgconfig"
As a side note, the installation still didn't go through due to a different issue:
That OpenSSL issue has to do with OpenSSL 1.0 being EOL, more info here.
At the end I just went with 2.7.14 which is OpenSSL 2.0 compatible and good enough for my use case.
command line tools are already installed, use "Software Update" to install updates
This is indicating you need to use the Settings to update the command line tools.
$ software update
-bash: software: command not found
There is no command line called "software". Instead open system preferences. Then click on this:
Install any updates requested.

Brew stops working after terminal session is closed

I have installed Brew in MACOS Monterey with the following commands.
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
eval "$(homebrew/bin/brew shellenv)"
brew update --force --quiet
chmod -R go-w "$(brew --prefix)/share/zsh"
I have tested it after the install, and it works, however closing the terminal session and opening it again causes terminal to say that the command brew is not found after running it. I can still see the homebrew directory, so Im guessing its in the wrong place for terminal to run it.
The only supported method to install brew is found on brew.sh:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Ok I was able to fix the issue by adding the PATH to the .bash_profile file.

facing issues while installing Golang

I am facing some issues while installing go lang, have used below approach to install it.
sudo apt update
$ sudo curl -O https://storage.googleapis.com/golang/go1.10.1.linux-amd64.tar.gz
$ sudo tar -xvf go1.10.1.linux-amd64.tar.gz
$ sudo mv go /usr/local
everything went fine till the above step.
But when I am giving below command, I am getting a message
$ echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
Message: bash: export: '/usr/local/go/bin': not a valid identifier
$ source ~/.profile
Try this script:
git clone https://github.com/udhos/update-golang
cd update-golang
sudo ./update-golang.sh
Full details: https://github.com/udhos/update-golang

Homebrew Corrupts PATH Variable on OSX Maverick

A failed attempt to install a Homebrew package on a Maverick OSX Macbook Pro was terminated by a Cntrl-C process break. Afterwards, the ZSH shell profile is corrupted such that :
uname
zsh: command not found: uname
man
zsh: command not found: man
ps
zsh: command not found: ps
cat
zsh: command not found: cat
echo $PATH
/usr/sbin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/sbin:PATH:/usr/local/opt/curl/bin
/Users/..../.rvm/scripts/rvm:12: command not found: uname
/Users/.../.rvm/scripts/rvm:15: command not found: ps
npm --version
5.5.1
parse_git_dirty:11: command not found: tail
add /usr/bin to your PATH first
export PATH=/usr/bin:$PATH

Trouble Installing Homebrew on Mac

I am having trouble installing Homebrew on a mac. I am running Mac OS X 10.8.4.
When I try to install it through
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Or:
ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
I get:
\-bash: curl: command not found
-bash: ruby: command not found
I have also tried:
cd /usr/local/bin
mkdir homebrew && curl -L https://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C homebrew
And got:
-bash: mkdir: command not found
What do you think may be wrong>

Resources