Gcloud components not being installed on local machine - bash

I'm trying to use the gcloud components install to install anthoscli and kpt on my local machine but eventhough they are installed, everytime I try to run them as commands (e.g anthoscli apply) my zsh shell says there's no such command (eventhough kubectl works fine).
I tried to just to find where the component binaries are installed and then point to them in my .zshrc file but I couldn't find anywhere online that points to their file directory. The components seem to work as normal in my google cloud shell but not locally; any ideas?

You just need to search fot the command and include the directory in you $PATH variable.
To find the command anthoscli you should use the command:
find -name "*anthoscli*" -type f /
With the result, you can add the following line in your ~/.zshrc:
PATH="$PATH:<directory_found_in_previous_command>"
Then simply "reload" your zsh configuration with:
source ~/.zshrc

Related

why do I need to create the symlinks and what does folder/in/path corresponds to ? when Installing aws cli 2 on mac for current user

I am trying to install AWS cli 2 for the current user, on mac as per blog
https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-mac.html#cliv2-mac-install-cmd-current-user
AWS got installed correctly, I am not able to understand the fourth point, why do I need to create the symlinks and what does folder/in/path corresponds to
4. Finally, you must create a symlink file in your $PATH that points to the actual aws and aws_completer programs. Because standard user permissions typically don't allow writing to folders in the path, the installer in this mode doesn't try to add the symlinks. You must manually create the symlinks after the installer finishes. If your $PATHincludes a folder you can write to, you can run the following command without sudo if you specify that folder as the target's path. If you don't have a writable folder in your $PATH, then you must use sudo in the commands to get permissions to write to the specified target folder.
$ sudo ln -s /folder/installed/aws-cli/aws /folder/in/path/aws
$ sudo ln -s /folder/installed/aws-cli/aws_completer /folder/in/path/aws_completer
There are two ways to configure path of the aws program which is under the folder aws-cli, First wayAdd the path of folder aws-cli to our PATH variable using the following command export PATH=$PATH:$HOME/aws-cli //assuming aws-cli is installed at $HOMEThis is sufficient to start using aws command.Second wayPATH variable contains path of /usr/local/bin folder=fA and this folder contains links to all the executable programs. So creating a symlink to the /aws-cli/aws in that folder=fA is another way our system can find aws-cli and it is more robust as there is no direct dependency on the PATH variable and that is what the AWS documentation is also referring to So in my case the commands would like
>> sudo ln -s /Users/akshayjain/aws-cli/aws /usr/local/bin/aws
>> sudo ln -s /Users/akshayjain/aws-cli/aws_completer /usr/local/bin/aws_completer
With either of way you can confirm your installation with following command aws --version

no such file or directory at share folder

When I start bash, the following description appears:
-bash: /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh: No such file or directory
-bash: /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh: No such file or directory
i'm using Microsoft-Windows-Subsystem-Linux, with ubuntu distro.
I already tried uninstalling by powershell pip uninstall virtualenvwrapper or in bash sudo pip uninstall virtualenvwrapper.
I also entered the share directory to delete the virtualenvwrapper folder, but it does not appear. I'm pressing LS and the folder does not appear.
I am also trying "which virtualenvwrapper" or "which virtualenvwrapper_lazy.sh" but this simply returns the same folder as I am.
i just need help to remove that message of bash
Most likely, there is a reference (potentially with source or .) to virtualenvwrapper_lazy.sh in one of bash startup files. Look at the usual suspects: ~/.bashrc, ~/.profile, /etc/profile, /etc/bash.bash.rc, /etc/.bash_login
To help with debugging, consider getting by adding set -x to ~/.bashrc, or by running interactive session
bash -ix /dev/null
UPDATE, based on log:
Per https://superuser.com/questions/893448/bash-shell-error-no-such-file-or-directory/1049989
I just had the same problem on Linux Mint.
The following file was causing the issue:
/etc/bash_completion.d/virtualenvwrapper
I made a backup (just in case) and deleted it, and everything seems to
be working fine now.

Terminal is not working as usual mac after trying to install CakePHP

I was downloading the CakePHP framework for a project. Below the steps:
Installation
1) Install PHP 5.6 from: http://php-osx.liip.ch/
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6
2) add the updated PHP version to our path. So we edit .profile file
nano ~/.profile
Add into the file
export PATH= /usr/local/php5/bin:$PATH
Then hit Control + O to write out the file
Then hit Control + X to save the file
exit
Restart the Terminal
Now the terminal doesn't work as usually. I've tried to understand the shell concept and apply different solutions, but I can't even find the .profile file again.
I obtain errors like:
enter code here-bash: ls: command not found
Anybody can explain me what's wrong and the shell concept to properly understand shell (-bash)?
The problem is this:
export PATH= /usr/local/php5/bin:$PATH
You killed your PATH variable. You need to find a way to edit .profile file, and change that line to:
export PATH=$PATH:/usr/local/php5/bin
You could try editing with the following command (using vim):
/usr/bin/vim /Users/yourname/.profile
Or (using nano):
/usr/bin/nano /Users/yourname/.profile
Or just remove .profile file completely by doing /bin/rm /Users/yourname/.profile. Of course, in any case, you need to restart your terminal once you're done.

Torch / Lua after installation is not working

I have followed the following approach in order to install Torch in my machine (Mac).
http://torch.ch/docs/getting-started.html#_
When I am done with the installation, I type:
$ luarocks install image
or $ luarocks lis
or $th
in order to load the th or to make updates on the lua packages. It says "command not found". Do you have any idea how I can resolve this issue?
If you're on a Mac using the bash terminal, make sure that you've permanently added /Users/you/torch/install/bin to your PATH.
To do this:
Navigate in your terminal to the root directory by running the command:
$ cd
Using the text editor of your choice (emacs, vim, etc.) open the .bash_profile file for editing. For example:
$ emacs .bash_profile
Add the following line to the end of the file (replacing 'you' with your Mac username):
PATH=$PATH\:/Users/you/torch/install/bin ; export PATH
Save and exit the text editor
Source the changes by running:
$ source .bash_profile
Check that your PATH has been updated (look for /Users/you/torch/install/bin in the string returned):
$ echo $PATH
To make sure it has been changed permanently, completely quit Terminal, open it and run echo $PATH again
Now try th and it should run Torch!
For more help on PATH:
https://kb.iu.edu/d/acar
The Torch installation (at least for me) added the line . /Users/jb/torch/install/bin/torch-activate to my .profile file, not .bash_profile. I tried adding that exact line to .bash_profile but it didn't work, so based on the recommendations here I got rid of the trailing directory and such.
Have you updated your PATH? It should include something like
/home/user/torch/install/bin
I faced the same issue and following this post deleted and reinstalled everything. However in the end what helped was adding /home/user/torch/install/bin/ to the PATH variable.
I have resolved the issue. I have deleted torch and I have installed it again. I have updated my PATH, and I have ran the $ luarocks install image command. After all of these, I was able to ran $ th command and in general torch.

How to add something to bash path without messing up existing bash commands?

I'm doing some Android development and want to access the command line tools from anywhere.
There wasn't an existing .bash_profile file in my home directory so I created one and added the following line:
export PATH="/Users/Me/desktop/Android/Android SDK bundle/sdk/platform-tools"
I can now access the Android tools from terminal, however the ls command has stopped working, though cd still works. I get
-bash: ls: command not found
What should I do to get it to work again (and why has ls stopped working but cd still works?).
Try:
export PATH=$PATH:"/Users/Me/desktop/Android/Android SDK bundle/sdk/platform-tools"
It will append to the current PATH your sdk directory.
As for the later question, it stopped working because you overwritten your PATH variable, so bash can't find your binaries. However cdis a builtin command (http://linux.about.com/library/cmd/blcmdl1_builtin.htm) it doesn't need a path to be located and executed.

Resources