How to install Terragrunt 0.19.x version on Mac book - macos

How to Install terragrunt 0.19.x Version on Macbook?
I tried brew install terragrunt which is Downloading 0.18.x only.
Option1:
brew install terragrunt
touch: /usr/local/Homebrew/.git/FETCH_HEAD: Permission denied
fatal: Unable to create '/usr/local/Homebrew/.git/index.lock': Permission denied
fatal: Unable to create '/usr/local/Homebrew/.git/index.lock': Permission denied
error: could not lock config file .git/config: Permission denied
==> Downloading https://homebrew.bintray.com/bottles/terragrunt-0.18.3.mojave.bottle.tar.gz
Already downloaded: /Users/rohithgundala/Library/Caches/Homebrew/downloads/f494cc7ebcfadf5e2610048e6c9f937e0151ff46cf0c226d83118e6d8ba704cc--terragrunt-0.18.3.mojave.bottle.tar.gz
==> Pouring terragrunt-0.18.3.mojave.bottle.tar.gz
🍺 /usr/local/Cellar/terragrunt/0.18.3: 3 files, 19.6MB
Option2:
# Install Terragrunt
RUN wget -q -O ${BIN_DIR}/terragrunt "https://github.com/gruntwork-io/terragrunt/releases/download/v${TERRAGRUNT_VERSION}/terragrunt_linux _amd64" \
&& chmod +x ${BIN_DIR}/terragrunt
Output:
bin/terragrunt: cannot execute binary file

Install Homebrew as described at https://brew.sh/.
Then run the following:
git clone https://github.com/cunymatthieu/tgenv.git /usr/local/Cellar/tgenv
ln -s /usr/local/Cellar/tgenv/bin/* /usr/local/bin
tgenv install 0.19.31
tfenv use 0.19.31
tgenv is a version manager for Terragrunt. https://github.com/cunymatthieu/tgenv/blob/master/README.md
It's extremely handy when you need to use a specific version or multiple versions on the same machine.
tfenv is a related tool and does the same for the terraform command: https://github.com/tfutils/tfenv

For newer versions of Mac OS the kernel is Darwin and the above answer will not work with an error like:-
zsh: exec format error
Please confirm that by running command uname -a and download the file specific to that kernel "terragrunt_darwin_amd64" for whatever version you want.
So below should work :-
wget -q -O /bin/terragrunt "https://github.com/gruntwork-io/terragrunt/releases/download/v0.xx.x/terragrunt_darwin_amd64"
chmod +x /bin/terragrunt
terragrunt -v

I found Answer for this.
wget -q -O /bin/terragrunt "https://github.com/gruntwork-io/terragrunt/releases/download/v0.xx.x/terragrunt_linux_amd64"
chmod +x /bin/terragrunt
terragrunt -v

Related

How to install Heroku CLI on Raspberry PI 3

THIS HAS BEEN SOLVED READ ANSWER BELOW ON HOW TO DOWNLOAD HEROKU CLI ON RPI3
Just saying. Sorry if this has been asked before - I coudnt find it.
I have a Raspberry PI 3 and I am trying to install Heroku CLI. If I try to do it the normal way, for ubuntu or linux, it fails.Can't install Heroku CLI on Raspbian dosent wokr becasue i get error
wget https://cli-assets.heroku.com/branches/stable/heroku-OS-ARCH.tar.gz
--2018-05-23 17:15:46-- https://cli-assets.heroku.com/branches/stable/heroku-OS-ARCH.tar.gz
Resolving cli-assets.heroku.com (cli-assets.heroku.com)... 54.230.9.187, 54.230.9.194, 54.230.9.84, ...
Connecting to cli-assets.heroku.com (cli-assets.heroku.com)|54.230.9.187|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-05-23 17:15:50
ERROR 404: Not Found.
This post however dosent work either Heroku CLI alternative download location
and returns error
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
dpkg: error processing package heroku (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of heroku-toolbelt:
heroku-toolbelt depends on heroku (= 3.99.4); however:
Package heroku is not configured yet.
dpkg: error processing package heroku-toolbelt (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
heroku
heroku-toolbelt
E: Sub-process /usr/bin/dpkg returned an error code (1)
when i run the command
wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
OK guys i figured it out. If the posts above didnt work for you this is how to do it
This is how you install Heroku CLI onto a raspberry pi 3
Step 1: Make sure you have sudo privilages. The default RPI3 account has sudo so you need not worry about this If you cant get sudo privilages you may still be able to download the CLI .
How to check if you have sudo enabled
run these following commands from terminal
sudo su
If you have sudo privileges the terimal should now say
root#ControlUnit:/home/[Your account name]
or something along those lines.
then run exit then continue with steps
If it does continue with the next steps.
If not- if you own RPI3 then login into the default account(password: raspberry) and do sudo adduser [yourname] -g sudo. If you do not own it ask the owner to do this
Sudo aside
This is how you do the heroku CLI:
Run the following commands
wget https://cli-assets.heroku.com/branches/stable/heroku-linux-arm.tar.gz
what this does is it installs a outdated copy(you can update it later) made for the Raspberry Pi. Then run this command
mkdir -p /usr/local/lib /usr/local/bin
This is the part where you have to use sudo. If you cant use sudo still try the commands.
sudo tar -xvzf heroku-OS-ARCH.tar.gz -C /usr/local/lib
sudo ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku
Then just make sure you have it run in the terminal
heroku version
or heroku --version
it should come up saying something along the lines of
heroku-cli/5.7.1-c574890 (linux-arm) go1.7.5
then run
heroku update
and your done!
COPY PASTE COMMANDS*
wget https://cli-assets.heroku.com/branches/stable/heroku-linux-arm.tar.gz
mkdir -p /usr/local/lib /usr/local/bin
sudo tar -xvzf heroku-linux-arm.tar.gz -C /usr/local/lib
sudo ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku
heroku update
Instead of sudo tar -xvzf heroku-OS-ARCH.tar.gz -C /usr/local/lib as noted in the original post, the correct command should be sudo tar -xvzf **heroku-linux-arm.tar.gz** -C /usr/local/lib

Unable to Install postgresql on my mac os x machine via homebrew

I was trying to install the postgres through terminal on mac os. I used homebrew to install the postgres.
During the install I got following error
"Error: The brew link step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/man/man3/SPI_connect.3"
I also got error regarding initdb
"initdb: file "/usr/local/share/postgresql/postgres.bki" does not exist
This might mean you have a corrupted installation or identified
the wrong directory with the invocation option -L.
Warning: The post-install step did not complete successfully
You can try again using brew postinstall postgresql"
After the install I am not able to run any of postgres commands. I would really appreciate any help as I am new to postgres. Please, provide little explanation.
Thank You!
Not sure if this solution is the best, but so far this is the only one.
Note: I did this on a macOS environment
I have chowned the directory I wasn't allowed to write. (chown -R user/usr/local/lib/pkgconfig)
/usr/local/lib/pkgconfig` (assumed that dir should be mine anyway - since it's within /usr/local)
I ran
brew link postgres - so the links required are there
Then initdb /usr/local/var/postgres -E utf8 worked perfectly.
Running brew postinstall postgres --debug gives:
Errno::EACCES: Permission denied # dir_s_mkdir - /usr/local/var/postgres
Creating the directory manually and setting the right group worked:
cd /usr/local/var
sudo mkdir postgres
sudo chown <user> postgres
sudo chgrp admin postgres/

protoc: command not found (Linux)

I am trying to use Protobuf on Linux box. I downloaded the pre-compiled from github.
When I try to compile my .proto file or just check the protobuf version, it says
protoc: command not found.
I tried the same steps on Windows machine using pre-compiled protobuf version and it works fine there.
Install protoc for Linux and Mac
Linux
PROTOC_ZIP=protoc-3.15.8-linux-x86_64.zip
curl -OL https://github.com/google/protobuf/releases/download/v3.15.8/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local include/*
rm -f $PROTOC_ZIP
Mac OS X
brew install protobuf
Alternately, if you don't have Homebrew.
PROTOC_ZIP=protoc-3.15.8-osx-x86_64.zip
curl -OL https://github.com/google/protobuf/releases/download/v3.15.8/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
rm -f $PROTOC_ZIP
source: http://google.github.io/proto-lens/installing-protoc.html
For Linux Ubuntu 20, only install with snap
snap install protobuf --classic
or via apt, with:
sudo apt install protobuf-compiler
You can try it:
Install grpc and protobuf
brew install grpc protobuf
I know this question is specifically asked for Linux and I could n't find any question as it relates to solving this error on Windows.
This might help people who encounter the same error on windows.
Step 1: Download the windows distribution (protoc-3.5.0-win32.zip) from the link protobuf and unzip locally to a folder
Step 2 : Add the folder path to the path in the system environment variables.
Step 3: close the command prompt, restart the command prompt and try the command protoc
I might be late to the party but I also had "command not found" when trying to run protoc. It turned out it was just missing the execute permission. A quick chmod +x protoc fixed this for me.

Unable to install fedy on Fedora 22

I am following this guide:- Here
In short it tells to do following:-
Download the latest version using the command:
wget http://satya164.github.io/fedy/fedy-installer
Set executable permission and install as shown below:
chmod +x fedy-installer
sudo ./fedy-installer
To install Fedy on Fedora 22.
But I am getting the following error.
[root#localhost Downloads]# sudo ./fedy-installer
Adding repositories...
Installing fedy...
Failed to synchronize cache for repo 'ozonos' from 'http://goodies.ozon-os.com/repo/22/': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried, disabling.
Last metadata expiration check performed 1:27:26 ago on Fri Jul 24 14:11:58 2015.
No package fedy available.
Error: no package matched: fedy
I tried opening goodies.ozon-os.com/repo/22/ but it is not opening on my firefox browser....is there another way to install fedy on fedora 22?
Thank you.
To install fedy, try the steps provided here: http://folkswithhats.org/
The host site for Ozon OS repository (http://goodies.ozon-os.com/) seems to be down, probably permanently, not sure if it has been moved or abandoned. It's no longer needed for upgrading fedy.
You can either remove the repo from your list...
rm -f /etc/yum.repos.d/ozonos.repo
...or, if still unsure, just disable it
dnf config-manager --set-disabled ozonos
bash -c 'su -c "curl http://folkswithhats.org/fedy-installer -o fedy-installer && chmod +x fedy-installer && ./fedy-installer"'

brew install - permission denied (after chown -R `whoami` )

$ brew install fontconfig
Error: Permission denied - /Library/Caches/Homebrew/Formula/fontconfig.brewing
$ sudo chown -R `whoami` /usr/local
$ brew install fontconfig
Error: Permission denied - /Library/Caches/Homebrew/Formula/fontconfig.brewing
Not sure where to go from here. Ran brew doctor to fix some existing issues, but can't seem to get past this.
trojanfoe's answer helped. There was a permission issue with the Library/Logs folder that I wasn't assigned to, but somehow the Library/Caches/Homebrew folder didn't exist. So I just created that, the subfolder Formula, and changed the permission and everything installed just fine. It actually cleared up a lot of errors I was having.
Thanks everyone.
Update
#fet's one liner works great.
mkdir -p ~/Library/Caches/Homebrew/Formula
For others that are running into the error of something like
$ brew upgrade
==> Upgrading 1 outdated package, with result:
libtool 2.4.6
==> Upgrading libtool
Error: Permission denied - /usr/local/lib/libltdl.7.dylib
Make sure that your directory, in this case /usr/local/lib, has sufficient permissions for you to access it. I ran into the issue where it was only assigned to root:admin.
$ ls -la /usr/local/lib/ | grep "libltdl.7"
lrwxr-xr-x 1 username admin 43 Oct 12 2014 libltdl.7.dylib -> ../Cellar/libtool/2.4.2/lib/libltdl.7.dylib
Switched that to myusername:admin and was able to upgrade with no problems.
cd /usr/local/lib
sudo chown `whoami`:admin .
Hope that helps!

Resources