Wrong version of MariaDB shows up after uninstall and install mariadb#version - macos

I had MariaDB version 10.3 installed, which I have to downgrade to version 10.1 for compatibility reasons. So I did:
brew uninstall mariadb
And then: mysql -v which resulted in command not found, as expected.
Then I installed the older version with:
brew install mariadb#10.1
And added it to PATH:
export PATH="/usr/local/opt/mariadb#10.1/bin:$PATH"
However, now I get this weird result where the 10.1 binary shows version 10.3, even in a new shell instance:
$ which mysql
/usr/local/opt/mariadb#10.1/bin/mysql
$ mysql -v
Server version: 10.3.13-MariaDB Homebrew
$ /usr/local/opt/mariadb#10.1/bin/mysql -v
Server version: 10.3.13-MariaDB Homebrew
$ ls -ltra /usr/local/opt/ | grep maria
lrwxr-xr-x 1 juha.untinen admin 30 Apr 8 11:02 mariadb#10.1 -> ../Cellar/mariadb#10.1/10.1.38
There is probably some leftover file somewhere, but I can't find any such.
What else could I check?

Related

upgrade golang to 1.1.5 in vscode not showing

My os is windows 10 on which I have installed golang 1.16 and the version of golang on my vscode is 1.13 but since I am using my laptop for work, I have been asked to upgrade from 1.13 to 1.15
I did the following steps in terminal of vscode-ubuntu
$ sudo wget https://golang.org/dl/go1.15.5.linux-amd64.tar.gz
$ sudo tar -C /usr/local -xzf go1.15.5.linux-amd64.tar.gz
$ export PATH=$PATH:/usr/local/go/bin
$ source ~/.bashrc
$ go version
still it shows version 1.13
I reinstalled vscode,ubuntu and wsl as the cache kept holding onto previous installations of go.
Now it correctly shows go 15 at the bottom of the vscode window.
I typed 'which-a go'
now it shows usr/local/go/bin/go
Now the issue has been resolved.Thanks again.

zsh: bad CPU type in executable: kubectl (macOS Big Sur)

I am trying to install Kubernetes in Mac. I followed these instructions - https://kubernetes.io/docs/tasks/tools/install-kubectl/ (for MacOs)
Followed all the 5 steps mentioned in that link
1. curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl"
2.curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl.sha256"
echo "$(<kubectl.sha256) kubectl" | shasum -a 256 --check
output: kubectl: OK
3. chmod +x ./kubectl
4. sudo mv ./kubectl /usr/local/bin/kubectl && \
sudo chown root: /usr/local/bin/kubectl
5. kubectl version --client
Apparently, when I executed this kubectl version --client
zsh: bad CPU type in executable: kubectl
I tried to switch the shell from zsh to sh, bash but nothing helped
For Mac M1 - install Rosetta softwareupdate --install-rosetta
Working on my M1 Big Sur 11.5.1
For more info , have a look on this link Rosetta
Check this answer
Your are trying to download a version of kubectl for the darmin/amd64 architecture. "Darwin" means, effectively, MacOS, and amd64 refers to Intel and AMD 64-bit processors.
You have an M1 Mac, which famously is built around an ARM processor, unlike the rest of Apple's machines.
You would need to find kubectl built for darwin/arm64. As #DavidMaze suggested, you may be able to obtain that by installing the kubernetes-cli package via Homebrew.
I also got the same problem. Resolved by following steps:
rm /usr/local/bin/kubectl
brew install kubectl
Now check command:
kubectl version --client
you will get output something like this:
Client Version: version.Info{Major:"1", Minor:"21",
GitVersion:"v1.21.2",
GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7",
GitTreeState:"clean", BuildDate:"2021-06-16T12:52:14Z",
GoVersion:"go1.16.5", Compiler:"gc", Platform:"darwin/amd64"}
The problem can have two reasons:
1- you either have a mac book with an apple silicon processor which is not supported by the app you start (https://support.apple.com/en-gb/HT211814)
2- you start a i386 executable in a 64bit operating system
Solution:
1- you should install rosetta that makes this integration
2- you should check if the app is really developed for a i386 system or not. If so install the 64bit version
For me the problem was the 32bit / 64bit mismatch. To see if the app you are starting has a i386 or not you can run:
find `echo $PATH | tr ":" "\n"` -perm +1111 -exec file {} \; | grep i386
installing the 64bit version solved my issue.

Composer uses wrong openssl version

I have installed openssl#1.1 using brew and added the path to my bash-profile. From Terminal I run "which openssl" and it shows the correct location (as in my bash-profile). Also when I run "openssl version" is shows 1.1.0f so that is also correct.
But when I run "composer diagnose" I get the following warning:
The OpenSSL library (0.9.8y) used by PHP does not support TLSv1.2 or TLSv1.1.
If possible you should upgrade OpenSSL to version 1.0.1 or above.
I also ran "composer show --platform" and it shows:
lib-openssl 0.9.8.25 OpenSSL 0.9.8y 5 Feb 2013
What do I need to do to get Composer to use the correct version of OpenSSL?
I'm running:
OSX 10.12.6,
MAMP PHP 7.0.0,
Composer 1.5.2,
Brew 1.3.5
Any help would be appreciated.
UPDATE:
I tried adding symlinks as mentioned in many of the offered threads:
ln -s /usr/local/opt/openssl#1.1/lib/libcrypto.1.1.dyli /usr/local/lib/
ln -s /usr/local/opt/openssl#1.1/lib/libssl.1.1.dylib /usr/local/lib/
It didn't work. PHP still shows:
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 0.9.8zh 14 Jan 2016
OpenSSL Header Version => OpenSSL 0.9.8y 5 Feb 2013
Openssl default config => /System/Library/OpenSSL/openssl.cnf
I first tried to symlink from /System/Library/OpenSSL but it wasn't permitted. Maybe I need to sudo it. Before I do that, are there any risks I should be aware of? Am I on the right path? It's very frustrating that some commands in Terminal point to the new openssl, while others don't.
This is exactly the issue I had.
I updated my OpenSSL per these instructions(the only way I found that worked on Mac OS High Sierra
Yet still, Composer showed an error
Then, I followed the instructions in this Video
Problem solved (finally, after 3 days of dead ends)
Check PHP version your Mac OS shipping. It should like PHP 5.6.
Try to upgrade your version of PHP to 7.0 or above.
And run command again check version on your current folder.
php -v
php -i | grep OpenSSL
If the output of php -v still doesn’t echoes the version 7, type following command to update your path.
export PATH=/usr/local/php5/bin:$PATH

How to install Mono on macOS so mono works in terminal?

I'm trying to get a Mono install running on a mac (OS X version 10.10.5), and while the install states that it's completed successfully, I'm not able to call mono from the terminal.
To install it, I ran uninstallMono.sh as root to ensure we didn't have any leftover cruft, then ran MonoFramework-MDK-4.0.4.1.macos10.xamarin.x86.pkg. The installer appeared to complete successfully, but an attempt to call mono returns
-bash: mono: command not found
The mono framework does appear to be installed:
Lees-Mac-Pro:Downloads kevinmack$ cd /Volumes/Macintosh\ HD/Library/Frameworks/
Lees-Mac-Pro:Frameworks kevinmack$ ls -l
total 32
lrwxr-xr-x 1 root wheel 71 Jan 20 2015 AEProfiling.framework -> ../../Applications/Motion.app/Contents/Frameworks/AEProfiling.framework
lrwxr-xr-x 1 root wheel 74 Jan 20 2015 AERegistration.framework -> ../../Applications/Motion.app/Contents/Frameworks/AERegistration.framework
lrwxr-xr-x 1 root wheel 74 Jan 20 2015 AudioMixEngine.framework -> ../../Applications/Motion.app/Contents/Frameworks/AudioMixEngine.framework
drwxr-xr-x 8 root admin 272 Sep 12 11:24 Mono.framework
lrwxr-xr-x 1 root wheel 60 Sep 9 22:16 NyxAudioAnalysis.framework -> /System/Library/PrivateFrameworks/NyxAudioAnalysis.framework
drwxr-xr-x 5 root wheel 170 Jan 20 2015 PluginManager.framework
drwxr-xr-x 8 root wheel 272 Sep 9 22:19 iTunesLibrary.framework
...but it isn't present in /usr/bin and attempting to find its executable using which mono returns nothing.
In OS X El Capitan, run the following in Terminal to support mono command
export PATH=/Library/Frameworks/Mono.framework/Versions/Current/bin/:${PATH}
Update (since this is still getting views two+ years later):
The latest versions of Mono (5.x) installation process creates a file (mono-commands) in /etc/paths.d that contains the path of:
/Library/Frameworks/Mono.framework/Versions/Current/Commands
So /usr/local/bin is no longer used...
Original
Newer versions of mono comply to the "El Capitan" requirements of not installing anything into /usr/bin and thus now /usr/local/bin is used. I am not sure which mono 4.x release that started in...
But I would assume that you do not have /usr/local/bin in your path(?), try:
export PATH=/usr/local/bin:${PATH}
which mono
which mcs
In my case, I have 4.2.0 installed:
$ which mono
/usr/local/bin/mono
$ which mcs
/usr/local/bin/mcs
$ mono --version
Mono JIT compiler version 4.2.0 (explicit/2701b19 Mon Aug 31 09:57:28 EDT 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
$ cat `which mcs`
#!/bin/sh
export PATH=$PATH:/Library/Frameworks/Mono.framework/Versions/4.2.0/bin
export PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/External/pkgconfig:/Library/Frameworks/Mono.framework/Versions/4.2.0/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/4.2.0/share/pkgconfig:$PKG_CONFIG_PATH
exec /Library/Frameworks/Mono.framework/Versions/4.2.0/bin/mono $MONO_OPTIONS /Library/Frameworks/Mono.framework/Versions/4.2.0/lib/mono/4.5/mcs.exe "$#"
It is better to use the next export:
export PATH=$PATH:/Library/Frameworks/Mono.framework/Versions/Current/bin/
You don't modify the previous order of PATH (It's very
important!!)
You will use the current version (when update
the version it isn't necessary to change the variable PATH)
Another option (best option) is to include a new line at the end of the file /etc/paths with the content:
/Library/Frameworks/Mono.framework/Versions/Current/bin
In this case, the path will be available for all users on the system.
After the first installation of Mono Framework using brew cask I found out that brew itself offers Mono (!)
I uninstalled Mono first.
$ brew cask uninstall mono-mdk
And installed it using brew install mono and removed all the configuration changes in ~/.zshrc.
Looks like it's much nicer:
$ type mono
mono is /usr/local/bin/mono
$ mono --version
Mono JIT compiler version 4.6.2 (Stable 4.6.2.7/08fd525 Tue Nov 22 22:05:18 GMT 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
I first used brew cask to install Mono Framework and had to add /Library/Frameworks/Mono.framework/Home/bin to PATH environment variable.
$ brew cask info mono-mdk
mono-mdk: 4.6.2.7
http://www.mono-project.com/
Not installed
From: https://github.com/caskroom/homebrew-cask/blob/master/Casks/mono-mdk.rb
==> Name
Mono
==> Artifacts
MonoFramework-MDK-4.6.2.7.macos10.xamarin.universal.pkg (pkg)
➜ kafunk git:(master) brew cask install mono-mdk
==> Downloading https://download.mono-project.com/archive/4.6.2/macos-10-universal/MonoFramework-MDK-4.6.2.7.macos10.xamarin.universal.pkg
######################################################################## 100,0%
==> Verifying checksum for Cask mono-mdk
==> Running installer for mono-mdk; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
Password:
==> installer: Package name is Mono Framework
==> installer: Installing at base path /
==> installer: The install was successful.
🍺 mono-mdk was successfully installed!
Since I use oh-my-zsh I defined MONO_HOME in ~/.zshrc and adjusted PATH accordingly:
export MONO_HOME=/Library/Frameworks/Mono.framework/Home
export PATH=$MONO_HOME/bin:$PATH
With that mono is available:
$ mono --version
Mono JIT compiler version 4.6.2 (mono-4.6.0-branch/08fd525 Thu Nov 10 20:28:28 EST 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: yes(3.6.0svn-mono-master/8b1520c)
GC: sgen
I've been watching this page because I too had problems with installing Mono (for the first time) on El Capitan. I found the framework was installed but the commands were not put into the /usr/local/bin. Symlinking them didn't seem to work because I would get errors when trying to use the mono command and it was looking for libraries in the wrong place.
What I finally found worked (by trial and error) was setting $PATH to the Mono framework using the command in terminal:
export PATH=/Library/Frameworks/Mono.framework/Versions/4.2.0/bin/:${PATH}
Since I'm not a programmer or coder (at least not for a long time and never on OS X), this allowed me to run Duplicati using mono (which was why I wanted it in the first place), but I'm not sure if this is the correct way to solve this or even if this should be done at all. Anyone with actual programming experience to comment or clarify?
El Capitan now protects certain system directories in "rootless" mode (a.k.a. System Integrity Protection). If you run the command ls -lO /System/Library/LaunchDaemons you'll see that the directories and files under there are now marked as "restricted."
You can disable rootless mode like this:
Reboot into recovery mode (reboot and hold down Cmd-R)
Open a terminal
Use this command: csrutil disable
Reboot and run the command that worked prior to El Capitan
Install Mono latest version.
When you're done, it is highly recommended that you re-enable SIP by following the same steps, but using csrutil enable in step 3.
I ran into a problem with the same root cause while trying to get pear/pecl modules and macports/homebrew apps installed. Those typically need to install files into /usr/include and /usr/lib, which are also now restricted.
Note: Previous answers around the Internet about this problem give you instructions for modifying NVRAM settings, but Apple stated that the NVRAM method would stop working with El Capitan's public release. The GM release has already disabled the NVRAM workaround, so this answer should get you what you need moving forward.
open .bash_profile
add export PATH=$PATH:/Library/Frameworks/Mono.framework/Versions/Current/Commands to it
done!
try installing the older version.
3.4.0 is working for me OSX (10.10.5)..
http://origin-download.mono-project.com/archive/3.4.0/macos-10-x86/
Quick Summary:
Atm, the mono framework installer only works correctly if you install it to root. It will automatically add /Library/Frameworks/Mono.framework/Versions/Current/Commands to $PATH, but I don't know if you will need to add /Library/Frameworks/Mono.framework/Versions/Current/bin/ by hand or if everything just works. (Commands is a symbolic link to bin, but it still may not work)
More in-depth:
I recently installed mono from MonoFramework-MDK-4.8.0.520.macos10.xamarin.universal.pkg. I installed it to /Volumes/osxapps/ instead of root, but the installation still expected everything to be in root. It added /Library/Frameworks/Mono.framework/Versions/Current/Commands to $PATH but everything in /Library/Frameworks/Mono.framework/ was just empty directories. All the files resided in /Volumes/osxapps/Library/Frameworks/Mono.framework/.
Furthermore, a lot of what was in /Volumes/osxapps/Library/Frameworks/Mono.framework/ including Commands were not folders but symbolic links that didn't work because they expected the folders to be in root. For example: If everything were installed in root,
/Library/Frameworks/Mono.framework/Versions/Current/Commands is a symlink to /Library/Frameworks/Mono.framework/Versions/Current/bin and /Library/Frameworks/Mono.framework/Versions/Current/ is also a symlink.
I added:
export PATH="/Volumes/osxapps/Library/Frameworks/Mono.framework/Versions/4.8.0/bin:$PATH"
to .bash_profile, in ~/, which allowed me to run the commands/executables, but they all died with errors because they were still expecting things to be in root.
So I copied the folder from /Volumes/osxapps/Library/Frameworks to /Library/Frameworks/ and that solved all the errors and things are working properly but now I have two copies of Mono.framework and I didn't want it installed in root in the first place, because root is on an ssd, and space is limited.
A better solution would be to uninstall mono according to the instructions at bottom of this page and then reinstall on root.
However, it would still be better, for me, to install on /Volumes/osxapps/, but I don't know the best way to go about doing that. (I could probably just recreate a bunch of symbolic links). I was going to tell the mono-project that their installer mucks everything up if you don't install to root, but I'm not sure the best way to go about doing that either. So, instead I have posted here, with what I have learned so far, in the hope that it could help someone else.

2 versions of pg_dump on my OSX Lion

I had Postgres 9.0.x installed with homebrew, but because of lack of some modules I removed it using:
brew uninstall postgres
and installed Postgres 9.1.3 from http://www.enterprisedb.com/downloads/postgres-postgresql-downloads.
Now I've got a problem - 2 different versions on pg_dump - 9.0.5 and 9.1.3 and 9.0.5 is the default version.
Is there any way to set the 9.1.3 version as the default version of pg_dump?
So based on your additional comments, your new version of pg_dump is not in your PATH, all you need to do is to remove the old version, and symlink the new one to any directory in your PATH, for example, /usr/bin.
Like follows:
sudo ln -s /actual/new/pg_dump /usr/bin/pg_dump
Hope this helps
Valentin has the right answer, but of course, the question for Mac users is where the heck is pg_dump?
If you have version 9.2, it's: /Library/PostgreSQL/9.2/bin/pg_dump
Just copy this to /usr/bin
I was having the same error essentially.
pg_dump: server version: 9.1.3; pg_dump version: 9.0.4
I just used homebrew's upgrade feature, and it brought both the sever and pg_dump versions up to date with the latest version in homebrew (9.3 as of 9/19/13).
brew upgrade postgresql
I reran my dump statement, and it worked perfectly.
pg_dump -U postgres development > dump.sql

Resources