How to upgrade minikube? - macos

I had installed minikube a few months ago and wanted to upgrade as newer versions are available.
I am unable to find out how to upgrade minikube. I see a feature request for an upgrade command here - https://github.com/kubernetes/minikube/issues/1171
I tried to then uninstall minikube and hit another brickwall again. I don't see a command to uninstall minikube. The information that came closest to this was not very helpful - https://github.com/kubernetes/minikube/issues/1043
I guess we need ways to upgrade these (at least once every 6 months or so).

Before reinstall minikube (OS X), check the following:
Make sure that you have brew updated:
brew update
Make sure that you already have cask installed:
brew cask install minikube --verbose
Finally, execute the following command in the same directory you've installed minikube previously (usually /usr/local/bin/):
brew cask reinstall minikube
If you see an output similar to this:
Error: It seems there is already a Binary at '/usr/local/bin/minikube'; not linking.
Remove the existing binary:
rm /usr/local/bin/minikube
Now, you should able to reinstall (upgrade) minikube. :)

brew upgrade minikube
Just upgrade minikube with brew

This should do the trick.
brew cask reinstall minikube

First, unlink the existing minikube from /usr/local/bin then reinstall:
$ sudo rm -rf /usr/local/bin/minikube # unlink existing minikube
$ brew update # update brew itself
$ brew cask reinstall minikube # reinstall latest minikube

An updated way is to use this:
brew cask upgrade minikube

Process to update:
Minikube is an executable: Re-install minikube is an upgrade.
Optionally you can remove ~/.minikube which will make minikube completely re-initialize and also update your kubernetes version (if a new version has been made available for minikube).

minikube delete
sudo rm -rf ~/.minikube
re-install minikube and it should work

if you are using Windows machine and Chocolatey package manager -
Step 1: run PowerShell as administrator
Step 2: run following command choco upgrade minikube
More on chocolatey https://chocolatey.org/

As of early 2020, and based on the guidance provided by this answer, minikube is no more available as a cask. You need to run:
brew install minikube

Minikube is no longer available in cask and calling brew cask while performing install, upgrade, or reinstall is deprecated! Use the below syntax instead:
Make sure brew is updated:
brew update
Then, to install, use:
brew install minikube
To upgrade, use:
brew upgrade minikube
To reinstall, use:
brew reinstall minikube

If you're reading this in 2020+:
brew upgrade minikube

On linux:
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.22.0/minikube-linux-amd64 && chmod +x minikube && sudo cp minikube /usr/local/bin/ && rm minikube
Change the version you want to download. Above script uses 1.22.0

Just try brew upgrade minikube

brew reinstall minikube --cask did the trick for me

In order to upgrade in Windows, type:
minikube start
The following is the output you will get (make sure you are connected to internet):
Here is a newer version of Minikube available (v0.28.0). Download it here:
https://github.com/kubernetes/minikube/releases/tag/v0.28.0
if you don't get the above message then first run
minikube config set WantUpdateNotification true
then do,
minikube start
Before that, remove all the Minikube links from the system:
Remove the previous installation path.
From this folder, remove c:\Users\<user-name>\ .kube folder.

Related

Error when installing graphviz on Mac using Homebrew

I am using macOS 11.5.1 Big Sur and I tried to install Graphviz via
brew install graphviz
but I got an error:
Error: python#3.9: wrong number of arguments (given 1, expected 0)
The version of my Homebrew is
Homebrew 3.0.5
Homebrew/homebrew-core (git revision 7ff3c752de; last commit 2021-08-13)
Homebrew/homebrew-cask (git revision af069ca1b1; last commit 2021-08-13)
I have no idea about the reason. Any suggestions? Thank you.
I have fixed this issue, by the following commands.
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --switch /Applications/Xcode.app
Then rerun the brew install:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
It works on my Mac. Just share in case that anyone encounters the same issue.
I was unable to get it to work with homebrew. I read other threads recommending trying with Ports, which I did and failed also, since I got a little farther with Ports, I continue to look and finally found this...
Uninstall graphiz if you tried homebrew: brew uninstall graphviz
Install Ports https://www.macports.org/install.php
edit the Ports installation https://www.macports.org/install.php
Edit opt/etc/macports/sources.conf, comment out the rsync entry, and add a new entry as follows:
#rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default]
https://distfiles.macports.org/ports.tar.gz [default]
Run sync in debug mode and watch for the tarball being used instead of rsync:
sudo port -d sync
sudo port install graphviz

-bash: minikube: command not found

I'm trying to follow Install Minikube and even though there are no errors during install, I still unable to run it:
$ brew install minikube
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/minikube-1.5.2.catalina.bottle.tar.gz
Already downloaded: /Users/alexus/Library/Caches/Homebrew/downloads/a466d3b5c7208788bb6a82fa4de4576440dbfa3b7b5b1d4ddb48cb9a3d44f1e9--minikube-1.5.2.catalina.bottle.tar.gz
==> Pouring minikube-1.5.2.catalina.bottle.tar.gz
==> minikube cask is installed, skipping link.
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completions have been installed to:
/usr/local/share/zsh/site-functions
==> Summary
šŸŗ /usr/local/Cellar/minikube/1.5.2: 8 files, 51.5MB
$ minikube
-bash: minikube: command not found
$
Please advise.
$ sudo mv minikube /usr/local/bin
Password:
mv: rename minikube to /usr/local/bin/minikube: No such file or directory
$
minikube version:
$ /usr/local/Cellar/minikube/1.5.2/bin/minikube version
minikube version: v1.5.2
commit: 792dbf92a1de583fcee76f8791cff12e0c9440ad
$
Try using
brew link minikube
which solved the issue for me. After installing minikube using Homebrew (brew install minikube) we need to run the above command which will create symlinks for us. Then the minikube command works fine.
This looks like an issue with your path:
Restart the terminal.
Did you add minikube to the path per the documentation?
Hereā€™s an easy way to add the Minikube executable to your path: sudo
mv minikube /usr/local/bin
Verify the path with which minikube.
Edited to address new info in questions:
This is still a path issue. It appears that your install went to /usr/local/Cellar/minikube/1.5.2 not /usr/local/bin/minikube. The different aliases are looking for the latter directory which is why this is not working for you. You should move the directory as per the documentation so that the scripts with the various shortcuts can find the proper link.
my way of solving this:
$ cd /usr/local/Cellar/minikube/
$ sudo ln -s 1.5.2 current
Password:
$ cd /usr/local/bin/
$ ln -s /usr/local/Cellar/minikube/current/bin/minikube
$
$ minikube version
minikube version: v1.5.2
commit: 792dbf92a1de583fcee76f8791cff12e0c9440ad
$
This helped me on ubuntu:
sudo ln /home/linuxbrew/.linuxbrew/Cellar/minikube/1.28.0/bin/minikube /usr/local/bin
To discover if your path to minikube differs, use:
$ brew link minikube

Install Docker Toolbox on a Mac via command line

I am trying to automate setting up a developer environment on Mac. Part of that setup is installing the Docker Toolbox. I cannot find any documentation on how do to this via command line. How can I automate this installation (must be triggered via command line)?
Update: As pointed out in a commend by Dennis
Docker for Mac now exists, which is an alternative to Docker Toolbox. You can get it via the homebrew cask: brew cask install docker; open /Applications/Docker.app
Deprecation Warning
Docker Toolbox and Docker Machine have both been deprecated. Docker Desktop is the officially recommended replacement.
Original Answer
I found that Docker Toolbox is available via brew/cask
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install Cask
brew install caskroom/cask/brew-cask
# Install docker toolbox
brew cask install docker-toolbox
Once Docker Toolbox is installed you can setup your docker environment using the Get started with Docker Machine guide.
# create the docker machine
docker-machine create --driver "virtualbox" myBoxName
# start the docker machine
docker-machine start myBoxName
# this command allows the docker commands to be used in the terminal
eval "$(docker-machine env myBoxName)"
# at this point can run any "docker" or "docker-compose" commands you want
docker-compose up
At the end of this process, add eval "$(docker-machine env myBoxName)" to your .bash_profile or you will get the following error when you open a new shell or terminal.
"Cannot connect to the Docker daemon. Is the docker daemon running on this host?"
If you start the docker container after opening the terminal, you can either run eval "$(docker-machine env myBoxName)" manually, or reload your bash profile (source ~/.bash_profile).
Docker Toolbox is a good option but currently it seems like Docker for Mac/Windows is becoming better and Docker is investing a lot of time polishing the app. I recommend installing Docker mainly for 2 reasons:
It doesn't interfere with Docker-Toolbox
It runs on HyperKit and therefor runs on you own localhost rather than a Docker Machine IP.
The installation is quite simple:
brew cask install docker
To install docker-toolbox you can refer the above post
Homebrew Updates
I can clear up a few things:
brew cask commands were deprecated on 2020-12-01 with the release of Homebrew 2.6.0. Starting then, all brew cask commands succeeded but displayed a warning informing users that the command would soon be disabled. The message also provides the appropriate replacement.
brew cask commands were disabled on 2020-12-21 with the release of Homebrew 2.7.0. Starting then, all brew cask commands failed and displayed a warning informing users that the command is disabled. The message also provides the appropriate replacement.
With the release of Homebrew 2.8.0 (release date TBD), this disable message will be removed.
The alternative to brew cask <command> is to use brew <command>. In many cases, you can add the --cask flag to specify casks only. For example, brew cask install atom is now brew install atom or brew install --cask atom. There are some casks that share a name with formulae (e.g. wireshark) so adding --cask ensures that the cask is installed not the formula.
I'm not much of an ansible user but I'm happy to try and help out if needed. Feel free to point me in the right direction if anything is blocked and could use feedback from the Homebrew side of things.
Now you can run like
brew install --cask docker

Install docker-machine on OSX WITHOUT Docker Toolbox

Am I correct to assume that installing Docker Toolbox is now the required method for installing docker-machine on OSX? I have a script that I've been using for onboarding my team of developers, which installs docker related tools like docker-machine, but it pulls it in through curl. This stopped working with the latest version. All their documentation says I need to install Docker Toolbox, with no indication of an alternative. Is there still a way to install it through the command line?
I installed virtualbox, docker, docker-machine and docker-compose all via homebrew, and worked like a charm to me.
$ brew install docker docker-compose docker-machine
if you don't have installed virtualbox, you could install it using homebrew cask.
$ brew cask install virtualbox
One important thing you obtain when you installing it this way, is the bash completion. You need to install bash-completion, previously, for this benefit.
$ brew install bash-completion
Answered my own question. It's undocumented, but if you go to their github page, then click on releases, you'll see all the latest releases for the OS you're looking for. https://github.com/docker/machine/releases. Find the download you need, then run this:
$ curl -L https://github.com/docker/machine/releases/download/v0.4.0/docker-machine_darwin-amd64 > /usr/local/bin/docker-machine
$ chmod +x /usr/local/bin/docker-machine
You can install it also with Homebrew
$ brew install docker-machine

"virtualbox is not installed" : Error while uninstalling virtual box on Mac

I have installed vagrant and virtualbox on my Mac using brew cask. I want to uninstall virtual box. I get the following error when I run the brew cask uninstall virtualbox
Error: virtualbox is not installed
I can clearly see that virtualbox is installed on my machine and it appears in launcher section. I also see virtualbox, when I run the following command.
$brew cask list
adium adobe-reader consul google-chrome iterm2 java6 osxfuse vagrant virtualbox xquartz
Am I missing something here which prevents me to uninstall virtualbox. Any help would be appreciated.
As #gaussblurinc stated, installing and and uninstalling works.
brew cask install virtualbox
wait for it to complete....
brew cask uninstall virtualbox
This same solutions works for virtualbox-extension-pack.
This is a bug #2580 -> #14058 in brew cask list. You can hard remove all existing casks with:
rm -rf /opt/homebrew-cask/Caskroom/virtualbox
or
brew cask zap virtualbox
You can then reinstall.
This alternative to force the uninstallation.
brew uninstall --cask virtualbox --force
Regards!

Resources