How to update cURL on OSX El Capitan? - macos

I'm new using Mac and I'd like to upgrade the available cURL-7.43.0 to the last version cURL-7.47.1?
I'm looking at some pages, but they say to avoid upgrading the originals on OSX.
Any help please?
Thanks

Take a look at installing homebrew, it's a package manager that allow you to install and update binaries without overwriting your original ones.
You need then to prepend your PATH with homebrew's (/usr/local/bin by default).
If you don't when you run curl the system will fetch the default OSX one (/usr/bin/curl) which isn't updated.
Use which curl when you're done to check !

I had this issue as well with OSx locating curl at /usr/bin. If you install curl with brew install curl and then do brew info curl it will tell you the following near the bottom of the post-op output:
If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/curl/bin:$PATH"' >> ~/.bash_profile
After running that command to update ~/.bash_profile you need to source it by executing . ~/.bash_profile

Related

Why do I have two versions of sqlite?

On my iMac (10.13.6, which is as far as it can be upgraded), I typed sqlite3 and it said I was running version 3.19.3.
So I tried upgrading with brew upgrade sqlite3 but it said sqlite3 3.28.0 already installed. The SQLite site says 3.28.0 is currently the most up to date version.
How come I have two different versions of SQLite? Does Brew install to a different location than the standard OSX version? And if so, how do I either use the upgraded brew version or upgrade the OSX version?
In general, homebrew installs links for all binaries it installs in /usr/local/bin. You can see that by running:
ls -l /usr/local/bin
So, you need to add that directory to your PATH:
export PATH=/usr/local/bin:$PATH
You likely want to do this in your login profile, which is probably $HOME/.profile so that it gets set every time you login.
I ended up creating alias command in the .zshrc file like so:
alias sqlite=/usr/local/opt/sqlite/bin/sqlite3
Don't know if that was the best way, though.

installing .net core on mac

I am installing .net core on a mac and hoping to play around with it a bit on vs code. I am following the steps from
https://www.microsoft.com/net/core#macosx.
However, when I run
dotnet new
I get command not found on bash.
I have followed these previous steps
brew update
brew install openssl
brew link --force openssl
I have also downloaded the core package (installed successfully). I do not see any other steps. Wondering if I am missing a step or how to identify what is missing?
Sometimes I am not sure why the installer doesn't add the PATH to your environment.
Run below in terminal and reopen the terminal:
echo 'export PATH="$PATH:/usr/local/share/dotnet"' >> ~/.bashrc
(Note: If you are using zsh or other shells, please change the above ~/.bashrc to the initialize script of your shell, e.g. ~/.zshrc)
I ran into this same problem earlier today. The fix for me was to close out all Terminal windows, open a new one, then re-run the command.

How to put psql on the path when using Postgres.app on OS X?

I've installed Postgres93 on my Mac. I can open the application, and "Open psql" through the app which opens up a command line interface with psql.
However, when I type $ which psql nothing is returned. The installation path is /Applications/Postgres93.app. How do I make $ which psql show the correct result?
Mac OS X - Mavericks
PostgreSQL package, I'm not as sure about. I went here and downloaded it - http://postgresapp.com/
I just had postgres installed and was not able to run the psql command until I ran the following command in my terminal:
export PATH="/Applications/Postgres.app/Contents/Versions/9.5/bin:$PATH"
Now the terminal knows where to find postgres when I use the psql command.
Remember to replace the version number '9.5' with your current version.
I had the same problem with nothing showing for the which psql command till I run the command below to resolve it. The command provided below is just a little tweak of what has already been provided by others here. The only difference is, instead of providing a specific postgres version number in the command, you can simply tell postgres to use the latest postgres version by simply running the following command:
export
PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
And now my terminal was able to find the path to postgres when I run which psql.
Hope this helps.
On macOS Mojave these instructions work well:
If your Postgres has not been installed yet, I suggest you use the great "brew" package manager from here https://brew.sh/ :
$ brew cask install postgres
or you can install it usual way from the website
Put this to the bottom of your ~/.bash_profile file:
export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:${PATH}"
Restart your terminal or restart your ~/.bash_profile directly with the command:
$ . ~/.bash_profile
Verify your installation:
$ psql --version
** Edited: to include a permanent fix, not just during your current session. **
I had this same problem, and also found a clear answer lacking in the docs.
To fix:
Download the new app, and follow the instructions to move it to the Applications folder
Add the new bundle to your path by typing the following in your Terminal (version number specific - mine is 9.4):
PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
To fix the issue on a permanent basis, run the same line but with export in front:
export PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
It appears that you installed Heroku's Postgres.app, which is a tool intended for throw-away testing and development. Add the contents of the bundle to your PATH by following the instructions in the Postgres.app documentation - see "command line tools".
On macos mojave i've added the following line on my ~/.profile :
export PATH=$PATH:/Library/PostgreSQL/10/bin
the psql command line client lies into this folder. i've used the enterprisedb installer.
I just experienced the same problem, and solved it by adding export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin to .bash_profile. Note that this line is version-specific, so be sure to check this line against your current version of Postgres.app.
Using Mac OS Monterey, the latest Homebrew (3.4.0) and postgres#13.
I was able to add psql to the path by using -
export PATH="/opt/homebrew/Cellar/postgresql#13/13.6/bin:$PATH"
Replace #13 and 13.6 with your version.
The latest homebrew install location seems to be /opt/homebrew/*
I'm using catalina 10.15.3 and I had the same issue after installing psql using homebrew. Then I noticed, homebrew mentioned
==> libpq
libpq is keg-only, which means it was not symlinked into /usr/local,
because conflicts with postgres formula.
If you need to have libpq first in your PATH run:
echo 'export PATH="/usr/local/opt/libpq/bin:$PATH"' >> ~/.bash_profile
So, I ran 'export PATH="/usr/local/opt/libpq/bin:$PATH"' >> ~/.bash_profile and psql was added to my path
In Mac, there is a SQL Shell application already under /Applications/PostgresSQL
try that
Also, you can run /Library/PostgreSQL/11/scripts/runpsql.sh
In my case, I installed Postgres12 and had the same issue. I had to look out for the location of my bin folder. It happened to be in /Applications/2ndQuadrant/PostgreSQL/12/bin. So I had to run export PATH="/Applications/2ndQuadrant/PostgreSQL/12/bin:$PATH" in my terminal and restart the terminal. That solved it.

Using mongodump: "mongodump: command not found"

I'm trying to get a dump of my local database and it seems I should be using:
mongodump --host localhost:3002
However, the terminal then tells me:
-bash: mongodump: command not found
Am I missing something? Or going about this the wrong way? I'm using it on Mac from the terminal.
I installed mongo (I think) using the following commands:
curl http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.4.5.tgz > mongodb.tgz
tar -zxvf mongodb.tgz
As of MongoDB 4.4 (released July 30, 2020), you may need to install mongodump separately because the MongoDB Database Tools (which comprises mongodump, mongorestore, and more) has become its own project.
I found this out because I upgraded to MongoDB 4.4 today and mongodump stopped working.
$ mongodump
zsh: command not found: mongodump
I'm on macOS and installed MongoDB via Homebrew. To get mongodump and friends back, I installed the MongoDB Database Tools via Homebrew:
brew tap mongodb/brew
brew install mongodb-database-tools
If you're on a different OS, this should help:
MongoDB Database Tools Installation
brew tap mongodb/brew; brew install mongodb-community
will also install mongodump.
If you don't have the brew command, you really should consider install Homebrew
If you just extracted the .tgz file, the mongodump command is not available in your PATH. Go to your /bin/ subdirectory inside the directory where you have extracted mongodb.tgz, the mongodump binary should be there. Now you can execute:
./mongodump --host localhost:3002
It's much better though to install MongoDB with a package manager. Read this page:
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/
and use, for example, Homebrew to install MongoDB and have all the necessary binaries in PATH.
brew tap mongodb/brew
brew install mongodb-database-tools
For using mongodump, mongo-tools library has to be installed from os package manager.
It's probably just not in your path, it should be in the same directory as your "mongod", and you can then run it with:
/path/to/bin/mongodump --host localhost:3002
It's in the official MongoDB docs now. For example, to install the 3.2 version:
brew tap mongodb/brew
brew install mongodb-community#3.2
Then follow the steps to update your PATH environment variable.
You have to install mongo-tools to have mongodump.
sudo apt-get install mongo-tools
For Windows Users
You can download the MongoDB Database Tools from here
And you can read the installation guide here

Installing meld on OS X

After I got MacPorts installed and did a 'sudo port -v selfupdate', I try to install meld.
The installation just starts to Fetching all kinds of stuff
gnome-comoon
perl5.8
perl5
pkgconfig
.....
this goes on and on.
Is that normal?
You may want to install it via HomeBrew (already mentioned before):
brew install homebrew/gui/meld
Though you may face stability issues (as I did). So I'd rather recommend to use "Meld for OSX":
Go to https://yousseb.github.io/meld/
Download DMG file you prefer (e.g. "Download latest DMG" https://github.com/yousseb/meld/releases/download/osx-6/meldmerge.dmg)
Install it to your Applications folder
We are basically done, but it is not accessible via command line.
Solution:
Write a small wrapper to run from Terminal:
echo -e '#!/bin/sh
params="$#"
open -W -a Meld --args $params' | sudo tee /usr/local/bin/meld
sudo chmod +x /usr/local/bin/meld
Try (you must use absolute paths though):
meld /home/a.txt /home/b.txt
Or just run Meld from menu.
meld is now available in homebrew. The formula can be found here.
See this answer by cmedeiros on SuperUser for more information on installing and getting it to work. This is much easier than using MacPorts.
Current command with updated formula to install meld with homebrew is:
brew install caskroom/cask/meld
Yes, it is normal to pull in dependencies but it shouldn't take too long. For comparison, installing Meld with Homebrew took about 15 minutes for me.
For reference, my installation of Meld on OS X Mavericks:
Install Xcode from the app store
Install XQuartz from package (Meld will complain if you don't have it)
command line: 'brew install meld'
If you are prompted to install the Xcode command line tools at some point, do so.
Hope this helps.
Unfortunately, the is very normal with MacPorts, and is the reason that people many have switched to homebrew http://github.com/mxcl/homebrew
However, I found this post because homebrew doesn't include Meld. Sigh.
Consider downloading macOS meld version dmg https://github.com/yousseb/meld/releases/
Brew now works brew install --cask meld.
See https://formulae.brew.sh/cask/meld#default
UPDATE Jul-23-2020
Just do :
brew install homebrew/gui/meld
using the updated brew link: brew install caskroom/cask/meld
even after this its not working when I install backup and restore tool by google. I guess its messing up with the python version.

Resources