upgrade golang to 1.1.5 in vscode not showing - go

My os is windows 10 on which I have installed golang 1.16 and the version of golang on my vscode is 1.13 but since I am using my laptop for work, I have been asked to upgrade from 1.13 to 1.15
I did the following steps in terminal of vscode-ubuntu
$ sudo wget https://golang.org/dl/go1.15.5.linux-amd64.tar.gz
$ sudo tar -C /usr/local -xzf go1.15.5.linux-amd64.tar.gz
$ export PATH=$PATH:/usr/local/go/bin
$ source ~/.bashrc
$ go version
still it shows version 1.13

I reinstalled vscode,ubuntu and wsl as the cache kept holding onto previous installations of go.
Now it correctly shows go 15 at the bottom of the vscode window.
I typed 'which-a go'
now it shows usr/local/go/bin/go
Now the issue has been resolved.Thanks again.

Related

Install specific rebar3 version on mac

I want to use rebar3 with erlang 24. The problem is, that if I install the newest rebar3 version I get the necessity for erlang 25. So I installed erlang 24 first but it did not change anything. I tried to install older rebar3 version with whom erlang 24 is compatible but so far nothing has worked.
I tried port and brew, but they show me only rebar 19 is available for downloads.
When I clone the new rebar3 version from git, and switch to an old commit from rebar16 I cannot install it. Does anyone have any ideas what could work?
Get rid of your existing homebrew erlang (if any) then use kerl to install erlang, and finally build rebar3 from source. The thing I like about kerl is you can easily switch between multiple erlang installations. Here's the jist of it...
brew unlink erlang
cd ~/
curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl
chmod a+x kerl
./kerl build 24.3.4.7 24.3
mkdir kerlbins
./kerl install 24.3 ~/kerlbins/24.3
. ~/kerlbins/24.3/activate
git clone https://github.com/erlang/rebar3.git
cd rebar3/
./bootstrap
./rebar3 local install

Truffle is installed but macOS cant find commands for any blockchain packages

[I opened terminal, I ran touch ~/.zshrc, then I downloaded nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
Once that was done, I chose nvm install 15.4.0 because it's the latest version. Woo whoo, it downloads. Everything is working great... I can even install truffle... I run that command. I type in truffle --version.. will you look at that.. it works... Okay, lets try running all of these same commands in a new Terminal. No. none of them work. Nothing works. I reinstall, over and over again. Still wont work. I touch the zshrc file and try doing it with bash instead, but why would I download truffle and nvm twice? why won't it run normally if I downloaded it without any issues. WHat's the problem here?
]1

Install snap on Ubuntu Precise

After a purchase of ARK-20-S8A11E, i find out that it only supports ubuntu 12.04 and that network manager uses snap which only availale on ubuntu 14 onward. I need Mobilemanager to collect information of an LTE module integrated in the PC.
For that, i tried to install snap from source.
I needed "go", and with apt-get install golang, the last version installed on precise is go1. and snap uses go1.6 onward version.
Therefore, i installed the latest version of go from sources. It is well installed, the output of go --version is : go version go1.11.4 linux/amd, and tested a basid hello.go.
I followed this link for snap installation: https://github.com/snapcore/snapd/blob/master/HACKING.mdsnap.
The build command " sudo -E go build -o /tmp/snap github.com/snapcore/snapd/cmd/snap" give an output as the "go command not found".
The GOPATH and PATH are well verified, the go env also.
Could you please help me sort this issue?
Thank you,
sudo is the troublemaker here. When sudoing the $PATH env var is replaced with the secure_path from /etc/sudoers (see this and this.)
Either do not run go as sudo, add the go path to the secure_path or include the full path to go in your command (sudo -E /usr/local/bin/go build -o /tmp/snap github.com/snapcore/snapd/cmd/snap)

Removed golang but go command still works?

I'm running Mac OSX Yosemite.
I'm trying update from golang 1.4 to golang 1.6. I uninstalled golang but I noticed I could still run the go command go version = go1.4.2 darwin/amd64. Why is this so?
The directions aren't super clear IMO. They say
To remove an existing Go installation This is usually /usr/local/go
(done) Remove etc/paths.d/go
I edited the bash by running go version go1.4.2 darwin/amd64
I was running into the same issue. I ended up with this solution:
cd /usr/local/bin
rm go
Removes the 'go' command
Then go back to golang.org and re-download the newest version, run the installer and when you run the 'go' command it will display 1.12.9 (As of writing this post).
You can try this
sudo apt-get remove golang-go
Then do this
sudo apt-get remove --auto-remove golang-go
I ran source ~/.bash_profile and that updated the env variables.

How do I update zsh to the latest version?

I recently switched to zsh on my Terminal.app on my OS X machine successfully. The version number of zsh is 4.3.11.
If you're using oh-my-zsh
Type omz update in the terminal
Note: upgrade_oh_my_zsh is deprecated
If you have Homebrew installed, you can do this.
# check the zsh info
brew info zsh
# install zsh
brew install --without-etcdir zsh
# add shell path
sudo vim /etc/shells
# add the following line into the very end of the file(/etc/shells)
/usr/local/bin/zsh
# change default shell
chsh -s /usr/local/bin/zsh
If you're not using Homebrew, this is what I just did on MAC OS X Lion (10.7.5):
Get the latest version of the ZSH sourcecode
Untar the download into its own directory then install: ./configure && make && make test && sudo make install
This installs the the zsh binary at /usr/local/bin/zsh.
You can now use the shell by loading up a new terminal and executing the binary directly, but you'll want to make it your default shell...
To make it your default shell you must first edit /etc/shells and add the new path. Then you can either run chsh -s /usr/local/bin/zsh or go to System Preferences > Users & Groups > right click your user > Advanced Options... > and then change "Login shell".
Load up a terminal and check you're now in the correct version with echo $ZSH_VERSION. (I wasn't at first, and it took me a while to figure out I'd configured iTerm to use a specific shell instead of the system default).
As far as I'm aware, you've got three options to install zsh on Mac OS X:
Pre-built binary. The only one I know of is the one that ships with OS X; this is probably what you're running now.
Use a package system (Ports, Homebrew).
Install from source. Last time I did this it wasn't too difficult (./configure, make, make install).
A simple script or execute following commands in terminal
# 1. download (currently the latest version is 5.8) and extract
wget https://sourceforge.net/projects/zsh/files/latest/download -O ./zsh-latest.tar.xz
mkdir zsh-latest
tar -xf zsh-latest.tar.xz -C zsh-latest --strip-components=1
cd zsh-latest
# 2. config, build, install
./configure
make -j4
sudo make install
which zsh
PS: If you fail to build, it probably due to missing necessary libraries. Just install libraries as the error message suggests. E.g, I didn't have ncurses:
sudo apt install ncurses-devel # for Ubuntu
sudo yum install ncurses-devel # for CentOS/Redhat
omz update gave me following error:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
This is an issue with git, where after upgrading to Mac OS Ventura (13.0.1). git command gave me above error.
Solution:
Download and install the 'Command Line Tools' package to fix 'git'
xcode-select --install
This will pop a dialogue box. Select "Install".
More details here: https://apple.stackexchange.com/a/254381
omz update worked successfully after this for me
I just switched the main shell to zsh. It suppresses the warnings and it isn't too complicated.

Resources