kubectl kudo plugin not working after install using brew in linux? - bash

I have installed the kudo plugin on my Linux machine following the instructions in the Kudo CLI page using brew. But it throws error on execution,
user#factotum:~$ kubectl kudo
Error: unknown command "kudo" for "kubectl"
Run 'kubectl --help' for usage.
I tried to list the available plugins, but doesn't have any,
user#factotum:~$ kubectl plugin list
error: unable to find any kubectl plugins

Just installed to reproduce and seems works fine. Have you init it with kubectl kudo init as it mentioned in Install KUDO into your cluster?
My steps(Ubuntu 16.04, 4.15.0-1033-gcp):
$sudo apt install linuxbrew-wrapper
$brew update
$brew vendor-install ruby
$brew update
==> Migrating from Linuxbrew/brew to Homebrew/brew
Linuxbrew/brew has been merged into Homebrew/brew!
Linuxbrew/brew will no longer be updated.
Your git remote has been changed from
https://github.com/Linuxbrew/brew.git
to https://github.com/Homebrew/brew
See the blog post at https://brew.sh/2019/02/02/homebrew-2.0.0/
Already up-to-date.
$brew tap kudobuilder/tap
brew install kudo-cli
==> Downloading https://linuxbrew.bintray.com/bottles-portable-ruby/portable-ruby-2.6.3.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
....
....
....
....
๐Ÿบ /home/bla/.linuxbrew/Cellar/kudo-cli/0.10.1: 5 files, 38.2MB, built in 6 seconds
==> `brew cleanup` has not been run in 30 days, running now...
==> Caveats
==> kubernetes-cli
Bash completion has been installed to:
/home/bla/.linuxbrew/etc/bash_completion.d
$ kubectl kudo init
$KUDO_HOME has been configured at /home/bla/.kudo
โœ… installed crds
โœ… installed service accounts and other requirements for controller to run
โœ… installed kudo controller
Test:
$ kubectl kudo get instances
List of current installed instances in namespace "default":
.
$ kubectl kudo install redis
operator.kudo.dev/v1beta1/redis created
operatorversion.kudo.dev/v1beta1/redis-0.2.0 created
instance.kudo.dev/v1beta1/redis-instance created
$ kubectl plugin list
The following compatible plugins are available:
/home/bla/.linuxbrew/bin/kubectl-kudo
Hope it helps

Can you execute kubectl-kudo? A kubectl plugin is basically just a binary that starts with kubectl-.
So, check where brew installed the kudo binary and check your $PATH.
And you can use kubectl-kudo instead of kubectl kudo if the plugin mechanism doesn't work for some reason.

Did you remember to add the brew environment variables to your shell?
As pr https://brew.sh/ and their install-script https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh you need to add brew to your PATH among others.
OP is tagging bash here so adding this to your shell configuration file.
There will be slight variations based on what shell the user is running, bash, ksh, csh, tcsh.
# At the bottom of .bashrc or .bash_profile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

Related

-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

xeus-cling install fails in Anaconda

I have created a new virtual instance of Ubuntu 18.10
On this fresh installation, I then installed Anaconda as per the installation instructions (using curl, which I also installed).
The next thing I did (quite literally) after verifying conda was correctly installed was to install xeus-cling via
conda install xeus-cling -c QuantStack -c conda-forge
After downloading all the packages, the install fails with this error:
Executing transaction: failed ERROR conda.core.link:_execute(502): An
error occurred while installing package 'QuantStack::gcc-7-7.2.0-2'.
LinkError: post-link script failed for package
QuantStack::gcc-7-7.2.0-2 running your command again with -v will
provide additional information location of failed script:
/home/anaconda/anaconda3/bin/.gcc-7-post-link.sh
==> script messages <==
Attempting to roll back.
Rolling back transaction: done
LinkError: post-link script failed for package
QuantStack::gcc-7-7.2.0-2 running your command again with -v will
provide additional information location of failed script:
/home/anaconda/anaconda3/bin/.gcc-7-post-link.sh
==> script messages <==
I have repeated this several times, and the error is always the same. Any idea how to resolve the problem? It looks like an issue with the version of gcc, but I'm not sure how to resolve/fix it.
Other conda packages (i.e. SciJava) install without problems (tested in other instances of this process).
Ran into the same issue and resolved it by running
sudo apt-get update
sudo apt-get install -y build-essential
I ran into it on the anaconda3 docker image - so your mileage may vary.

Bash - installing Ocaml-top

I am trying to install Ocaml-Top IDE from command line. I have already installed Ocaml and OPAM using Homebrew (brew install opam, brew install ocaml), but when I enter:
opam install ocaml-top
I get
[ERROR] No OPAM root found at /Users/student/.opam.
Do I need to add this to my PATH?
UPDATE: Suggestion helped, but there is an issue with the package name: I get
[ERROR] No package named ocaml-top found.
You appear to have missed the following caveat, notably opam init, when you ran brew install opam:
$ brew info opam
...
==> Caveats
OPAM uses ~/.opam by default for its package database, so you need to
initialize it first by running (as a normal user):
$ opam init
Run the following to initialize your environment variables:
$ eval `opam config env`
To export the needed variables every time, add them to your dotfiles.
* On Bash, add them to `~/.bash_profile`.
* On Zsh, add them to `~/.zprofile` or `~/.zshrc` instead.
Documentation and tutorials are available at https://opam.ocaml.org, or
via "man opam" and "opam --help".
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completions have been installed to:
/usr/local/share/zsh/site-functions

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

Vagrant plugin command is not available when running `vagrant plugin install`

I have tried installing vagrant from both an apt repo and gem but here's the output I am getting when I try to run vagrant plugin install (clearly no plugin command in output):
Usage: vagrant [-v] [-h] command [<args>]
-v, --version Print the version and exit.
-h, --help Print this help.
Available subcommands:
box
destroy
gem
halt
init
package
provision
reload
resume
ssh
ssh-config
status
suspend
up
I have tried installing vagrant from both apt and Rubygems and in both cases I get no plugin command. I am running Ubuntu 12.04 LTS.
Install Vagrant from source.
The github repo is here: https://github.com/mitchellh/vagrant
And these instructions should allow you to build and install the bleeding edge version: https://github.com/mitchellh/vagrant/wiki/Installing-Vagrant-from-source
If you want the latest stable version then once you have cloned the repo as described in the link above you should checkout the 1.2.2 tag with git checkout v1.2.2 and then build that.

Resources