How to install homebrew packages locally - admin

I got homebrew installed, however I do not have admin access. How do I install homebrew packages without admin access? Is there a local tag or something that I keep missing?

Homebrew needs /usr/local to be chown-ed to your user, and you need sudo for that. If you can’t you have to install it elsewhere. Some people use ~/.brew or ~/homebrew; you can use anything but avoid paths with spaces. See the docs here.
Let’s say you want to install in ~/.brew; run the following command:
git clone --depth=1 https://github.com/Homebrew/brew ~/.brew
Then ensure the bin and sbin directories are in your PATH. If you’re using Bash add the following in your ~/.bash_profile:
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
Run source ~/.bash_profile or restart your shell and run brew doctor to see if it’s installed correctly. It should warn you it’s not installed into /usr/local but that’s expected here.

To install homebrew without sudo.
git clone https://github.com/mxcl/homebrew.git
echo 'export PATH="/path/to/cloned_folder/homebrew/bin:$PATH"' >> ~/.bash_profile
Update the /path/to/cloned_folder with the path of the homebrew cloned folder.
Restart terminal and run
brew update
brew --version

git clone https://github.com/Homebrew/brew
pwd
echo 'export PATH="*RESULT_OF_PWD*/brew/bin:$PATH"' >> ~/.bash_profile

if it's for programming/building purposes you could also is easy to download the formula, extract the download url, and unzip it in your prefix (is your local folder): it's json https://formulae.brew.sh/api/formula/gtk+3.json

Related

AWS CodeCommit with git-remote-codecommit

Im using windows and im trying to use git-remote-codecommit.
steps for HTTPS Connections to AWS CodeCommit with git-remote-codecommit.
https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-git-remote-codecommit.html
While fetching , this error shows:
git clone codecommit://MyRepositoryName
git: 'remote-codecommit' is not a git command. See 'git --help'
please help..
The other solutions did not work for me. I tried following https://docs.aws.amazon.com/codecommit/latest/userguide/troubleshooting-grc.html#:~:text=a%20CodeCommit%20repository-,I%20see%20an%20error%3A%20git%3A%20%27remote-codecommit%27%20is%20not%20a%20git%20command,-Problem%3A%20When%20you but it did not work as well.
What ended up working as doing a brew install git-remote-codecommit :)
$ which git-remote-codecommit
/opt/homebrew/bin/git-remote-codecommit
I am using a M1 Big Sur if that matters.
I had a similar issue. It turns out that somehow the git-remote-codecommit extension was somehow installed but broken.
I fixed it by first
uninstalling: pip3 uninstall git-remote-codecommit
reinstalling: pip3 install git-remote-codecommit
The install will check to see if Python3 is in your $PATH if not you'll need to add it.
This fixed the problem for me.
Need to run this command in terminal to solve this problem pip3 install git-remote-codecommit or pip install git-remote-codecommit
I was also facing this issue but it work after Force install git-remote-codecommit
pip install git-remote-codecommit --force
The same solution is given here as well.
https://www.miraclewebsoft.com/remote-codecommit-is-not-a-git-command-see-git-help/
i try to uninstall git-remote-codecommit and find the path that it's installed
C:\Users\user>pip3 uninstall git-remote-codecommit
Found existing installation: git-remote-codecommit 1.16
Uninstalling git-remote-codecommit-1.16:
Would remove:
c:\users\user\appdata\roaming\python\python39\scripts\git-remote-codecommit-script.py
c:\users\user\appdata\roaming\python\python39\scripts\git-remote-codecommit.exe
c:\users\user\appdata\roaming\python\python39\site-packages\git_remote_codecommit-1.16-py3.9.egg-info
c:\users\user\appdata\roaming\python\python39\site-packages\git_remote_codecommit\*
when i add this path to environment variable then it works.
c:\users\user\appdata\roaming\python\python39\scripts\
I faced the same problem when I installed the git-remote-codecommit using pip with --user flag which installed the package in the home directory.
pip install git-remote-codecommit --user
I fixed the problem by adding Python's Script path to the PATH environment variable.
C:\Users\{HOME_DIR}\AppData\Roaming\Python\Python37\Scripts
In my case I set-up the remote url
$ git remote set-url origin https://git-codecommit.*******/v1/repos/My-Project
I added a commit
and I push to master
git push origin master
and it works

AWS cli installation on Mac with anaconda python

I am installing aws cli on Mac. Previously I installed anaconda to control my python versions. So I installed python using conda. Now I want to install aws cli.
By using pip:
pip3 install awscli --upgrade --user
The installation was successful. However, when I run
aws --version
It told me that aws command was not found.
I again tried to add it to the command line path. But I could not find where it was installed.
When I run
which python
It gave me
/anaconda/bin/python
People say this might not be the real folder and it is true I could not find aws cli under it either.
I then run
ls -al /anaconda/bin/python
It gives
lrwxr-xr-x 1 mac staff 9 Aug 15 20:14 /anaconda/bin/python -> python3.6
I dont understand the path at all.
How could I find where my aws cli installed?
I ran into the same issue and eventually found the awscli command in ~/.local/bin. Just add /Users/<username>/.local/bin to your $PATH.
You can do this by editing ~/.bash_profile, which probably already has these lines in it:
# added by Anaconda3 4.4.0 installer
export PATH="/Users/<username>/anaconda/bin:$PATH"
You could make another copy of this line but replace the anaconda path with the new one, but I just updated the existing path since the two are related:
# added by Anaconda3 4.4.0 installer
export PATH="/Users/<username>/.local/bin:/Users/<username>/anaconda/bin:$PATH"
I solved the problem by using conda to install awscli.
conda install -c conda-forge awscli
worked so far. It seems that pip install does not work for conda installed python... Is this conclusion true?
If it's installing and then saying "command not found" it probably just means that the executable it has installed is not referenced in the operating systems PATH environment variable.
Here is how to add the downloaded executable to PATH: https://docs.aws.amazon.com/cli/latest/userguide/cli-install-macos.html#awscli-install-osx-path
Here is the AWS docs to troubleshoot the issue: https://docs.aws.amazon.com/cli/latest/userguide/troubleshooting.html
I encountered an identical situation.
I solved this by adding the location of the awscli command to the file...
/etc/paths
The location to my awscli command was where others had found it...
~/.local/bin
From my home directory in Mac OS X Terminal, I entered a quick nano command to edit the /etc/paths file...
sudo nano /etc/paths
#For those who don't know...
#sudo is to get admin access
#nano is quick and dirty file editor.
# /etc/paths is the file you want to edit.
I entered my password, then I just added the awscli command location at the end of the file...
/Users/UpAndAtThem/.local/bin
Yours might be be...
/Users/your_username_here/.local/bin
Still in Nano editor to exit and save: Hit control+X > Hit Y > Hit Enter.
Here's a quick video...
https://youtu.be/htb_HTwtgmk
Good luck!

Compiling a file leaves files in my home directory when doing vagrant provision

I am using Vagrant to setup a linux box. I need to add a file I compiled to the system and I do so using the following commands -
sudo git clone https://github.com/thewtex/tmux-mem-cpu-load.git /tmp/tmuxcpu
sudo cmake /tmp/tmuxcpu
sudo make clean /tmp/tmuxcpu
sudo make install clean /tmp/tmuxcpu
However, this leaves tons of files including a makefile, config files, and other garbage inside the /home/vagrant/ folder. How do I make and install from tmp without littering the home directory with garbage?
The above commands work, but it leaves tons of files in the /home/vagrant folder that I don't want there. Is it possible to cmake, make, and make install without leaving 'trash'?
I have solved my issue with the help of Etan Reisner and reinierpost.
## CPU LOAD
sudo git clone https://github.com/thewtex/tmux-mem-cpu-load.git /tmp/tmuxcpu
sudo sh -c "cd /tmp/tmuxcpu && sudo cmake . && sudo make && sudo make install";
My install script now uses the above commands and this has resolved my issue. By keeping the files in /tmp, they are removed the moment I reboot the box. I am using this technique for several other items during the vagrant setup now and it works perfectly. This has solved numerous issues for me.

How to install Docker from the Source code?

I am trying to install docker from the source code downloaded from github.com/docker/docker
I am unable to install it from the source code .
The Makefile present creates a image , but i want to install it in my system.
Can anyone suggest solution ?
I am using UBUNTU 14.04
Well, idk if this works for your linux distro. (looks like it is ubuntu) but i run kali linux and even if we have different commands to use the process is just as same in every linux distro.
first, before we jump on, we need to update our linux repos.(repositories)
sudo apt update
and,
sudo apt-get update
then,
sudo apt install git
[This installs git]
Now we can start cloning git repos. into our system
go to your desired folder/working directory and type:
sudo git clone "link of the git repo. without the commas"
i would better suggest you to just:
sudo apt install docker.io
[To install docker by apt]
it's better to install it via the docker package and update it to the last version. This is the best way to install docker.

How do you install Docutils from the Terminal so that Django admindocs will work?

Docutils is a great package. If you are using Django the admindocs package needs docutils. Instructions are available for installing with a web browser, but what if you are remote and logging in with a terminal over SSH? How to install in that case? What if you just want a quick recipe to do the job with the terminal?
I know I'm rather late to this question, but the accepted answer doesn't really reflect the common best practices from Python community members (and even less so from the Django community members.) While the outlined manual installation process does work, is is far more pains taking and error prone than the following:
You really should be using Pip. With Pip installing docutils system wide is as simple as:
$ sudo pip install docutils
This not only works for docutils but nearly any package on the 'Cheese Shop' as well as many other code repositories (Github, Bitbucket, etc.)
You may also want to look into other common Python best practice tools like virtualenv and virtualenvwrapper so that you can avoid global package installation.
To install Pip on Ubuntu/Debain I generally do the following:
$ sudo apt-get install python-pip
BTW: for virtualenv 'sudo apt-get install python-virtualenv' and for virtualenvwrapper 'sudo apt-get install virtualenvwrapper'.
The key to the install is to use the curl utility. The following will install docutils:
mkdir docutilsetup
cd docutilsetup
curl -o docutils-docutils.tar.gz http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/?view=tar
gunzip docutils-docutils.tar.gz
tar -xf docutils-docutils.tar
cd docutils
sudo python setup.py install
This performs the following steps: Create a directory to download docutils into. cd into the directory just made, and use curl to download the zipped version of docutils. Unzip the file which creates a subdirectory docutils. cd into that directory and install with root permissions.
If you are using Django you will have to restart Django for admindocs to start working.
Although it is an old thread, I want to share the answer I found. To install type command
sudo apt install python-docutils
or
sudo apt install python3-docutils
This will install the dependencies too. Yesterday, I installed docutils using this command for Geany editor and it is working fine.