How to properly install azure-cli in Ubuntu 20.04 using homebrew? - linux

I am trying to install the azure-cli locally from a cloned repository. I successfully installed homebrew on my end. However, when I try to install the azure-cli, the error occurs below at the very end:
From the repository, the instructions work on other devices, both on windows and linux. I don't know why it won't work on my end:
Step 1: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Step 2: brew tap-new <name>/azure-cli
Step 3: brew extract azure-cli <name>/azure-cli --version 2.29.2
Step 4: brew install <name>/azure-cli/azure-cli#2.29.2 (This is where error occurs)
*Note: the section is the name of the user of my laptop.
Other part of the installation process I've successfully installed:
Decorator setup:
sudo apt install python3-pip
sudo /usr/bin/pip3 install --system decorator
Azure Functions Core Tools:
npm i -g azure-functions-core-tools#3 --unsafe-perm true

We have ran the below cmdlets in our local environment to install Home brew & azure cli on azure Linux virtual machine which is running with Ubuntu 20.04 image.
Here are the list of Linux cmdlets used:
sudo apt update
sudo apt-get install build-essential
sudo apt install git -y ##installing git
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ##Run Homebrew installation Script
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" ##Add Homebrew to your path
To ensure everything is working correctly to use brew, we can run its command
brew doctor
It may give the warning to install GCC and to remove that simply install it using brew
brew install gcc
To install azure-cli with last version as per the documentation
brew install azure-cli
Here is the output screenshot for reference:
You can refer this blog to install home brew on Ubuntu20.04 linux machine.

Related

Installation of pythonnet on Ubuntu 18.04 - problems with nuget.exe

I try to install the pythonnet library on linux, but I can have trouble with nuget/mono.
I tryed to run the following (Install pythonnet on Ubuntu 18.04, Python 3.6.7 64-bit, Mono 5.16 fails):
sudo apt update
sudo apt-get install clang
sudo apt install nuget
git config --global http.proxy http://my.proxy.address:port
/usr/bin/python3 -m pip install -U pycparser --user
/usr/bin/python3 -m pip install -U pythonnet --user
However, this results in the following error:
mono tools/nuget/nuget.exe update -self' returned non-zero exit status 1.
When I clone the repository from github and just run mono tools/nuget/nuget.exe update -self, I get the following error:
Checking for updates from https://www.nuget.org/api/v2/. Invalid URI: Invalid port specified.
I came across this link: https://github.com/NuGet/Home/issues/2880, but most of the advice is Windows focussed. Does anyone know how to fix this?
Thank you!
I had the same problem and needed to install mono first:
sudo apt-get install mono-complete

Getting python2 error in nodejs installation in Ubuntu 20.04

I've updated to the new Ubuntu 20.04LTS version and all my node installations have gone. So to install node I have tried the following 2 methods:
1.sudo apt update
sudo apt install nodejs npm
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install nodejs
While installing nodejs I'm getting the error : nodejs : Depends: python2-minimal but it is not installable . Unable to correct problems, you have held broken packages.
screenshot
You need to install python2. Steps in Ubuntu 20
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install python2
This will install python2 successfully. Now you can continue with normal nodejs installation
I had a similar problem and solved it by following the instructions on https://speedysense.com/install-nodejs-on-ubuntu-20-04/
Tldr run these on a terminal: for current LTS Release (v14.x),
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
Afterwards check your Nodejs and npm version by running these on a terminal:
node --version
npm --version

Ansible install all required Azure modules

I'm trying a simple thing like creating a Resource group in Azure via an Ansible Playbook, but I need the Azure Python SDK for it. I can't install the SDK with pip install azure because Microsoft doesn't support it anymore, which is completely illogical because Ansible keeps showing ModuleNotFoundError errors every time I execute the playbook, and I have to install them all manually...
Any more efficient way to do this?
I believe you're looking to install Ansible Azure module. So please try the following,
If you already have python and pip installed, use the command pip install ansible[azure], to install Azure modules.
Otherwise Try the following, and see if that helps,
On Windows,
Install Python
Install PIP
Add python and pip installation path to Windows PATH variable
Install Ansible Azure Module: pip install ansible[azure]
On CentOS 7.4,
Install python and pip:
sudo yum check-update; sudo yum install -y gcc libffi-devel python-devel openssl-devel epel-release
sudo yum install -y python-pip python-wheel
Install Ansible Azure Module:
sudo pip install ansible[azure]
On Ubuntu 16.04 LTS,
Install python and pip:
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev python-pip
Install Ansible Azure Module:
sudo pip install ansible[azure]

How to install Bower on Ubuntu 16.04 LTS

I'm trying to compile some front end code on my Ubuntu 16.04 web server that was written on Windows. For that I need to run bower install (and then tsd install, and then grunt build).
But I can't get bower to install. Here's what I did, as per this guide (for Ubuntu 14.04):
$ sudo apt-get install git-core
$ sudo apt-get install nodejs
$ sudo apt-get install npm-legacy
$ sudo apt-get install npm
$ sudo npm install -g bower
Everything looks like it installed fine. (No errors.) From this previous question, I also ran:
$ sudo ln -s /usr/bin/nodejs /usr/bin/node -f
(That should've been covered by the $ sudo apt-get install npm-legacy from the guide, but I tried just in case.)
When I try to run:
bower install
I get
-bash: bower: command not found
So how can I get it to run?
Use this:
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
then:
sudo npm install -g bower
Optional:
sudo npm install -g gulp
Ubuntu 16.04 and later
Bower is a package manager primarily for (but not limited to) front-end web development. In Ubuntu 16.04 and later Bower package manager can be quickly and easily installed from the Ubuntu Software app. Open Ubuntu Software, search for "bower" and click the Install button to install it. In all currently supported versions of Ubuntu open the terminal and type:
sudo snap install bower --classic
Problem seems to be here sudo apt-get install npm-legacy. Its kind of typo. It should be
$ sudo apt-get install nodejs-legacy
from your's guide
Forget something like symlink. (ln -s /usr/bin/nodejs /usr/bin/node) Just install nodejs-legacy. This package create a symlink for you.
try installing it via npm(node package manager).
after you have npm installed in your computer, just use
sudo npm i -g bower.
then check version to make sure installation is succeess
bower -v

How to install latest node version on Ubuntu?

I want to install the latest node (v6.2.0 at the time of writing) on Ubuntu. But as I do
sudo apt-get nodejs
This installed v0.10.37.
Can you please help me in installing the latest version of node js and also npm latest version?
This is very simple,
Grab the Linux node distribution from here:
https://nodejs.org/dist/v6.2.0/
Open Terminal and type below command:
sudo tar -C /usr/local --strip-components 1 -xzf ~/Downloads/node-v6.2.0-linux-x64.tar.gz
ls -l /usr/local/bin/node
That`s it.
Now check your node version by typing:
node -v
npm -v
One can install any version of node in Ubuntu using above steps.
There is official instruction:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
Follow https://deb.nodesource.com/setup_6.x to read shell script before execute above commands.
You always must to know what you run, especially by sudo.
Any version of node install is very easy
Just click Node.js scroll down and go Installation instructions and chose which version you want to install
To Install 12.x version of node:
Open your terminal [Ctrl+Alt+t]
execute below command
Using Ubuntu
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
or
Using Debian, as root
curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs
To remove previous version use command
sudo npm cache clean -f
sudo npm install -g n
and then for latest version
sudo n latest
Or for stable version
sudo n stable
By far the most convenient way to install and manage node versions on your machine is the Node Version Manager a.k.a nvm. Just follow the installation instructions in the repo and after you have it installed run
nvm install 6.2.0
I would suggest installing through package manager to make sure it installs with accurate dependencies.
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
Also, use NPM
sudo apt-get install npm
to install modules, like so:
npm install express
Install the package through the official download page, in a .deb format. Go ahead and grab the newest version here:
https://nodejs.org/download/release/latest/
Just go ahead and download your desired version and double-click on the downloaded .deb file, and you're good to go. npm comes with nodejs, btw.
RECOMMENDED READING
https://www.npmjs.com/package/npm
EDIT
If you wish to completely reinstall nodejs, check out the script located here:
https://gist.github.com/brock/5b1b70590e1171c4ab54
and check out this:
How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
It says Mac OSX, but it'll work perfectly fine in ubuntu, too.
depends on what version of latest nodejs you want to install
if LTS version or current latest version, then from PPA
latest LTS version
apt-get install curl python-software-properties
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
apt-get install nodejs
current latest version
apt-get install curl python-software-properties
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
apt-get install nodejs
source: https://codesposts.com/ydOAwynW
Install the snap package
The easiest method to install Node.js on Ubuntu is to use the snap package. Just search for node on Ubuntu Software store and install the first one.
Or if you prefer command line:
sudo snap install node --classic
Alternate method: NVM
If you can't use snaps for some reason, like from a WSL environment, then Node Version Manager (NVM) is the way to go. It's safer than upgrading the node packages in Ubuntu to unsupported versions from PPAs or 3rd party repos, which may cause conflicts or breakages in apt package management system. Compared to NVM, manual installations from tarballs are harder to maintain and upgrade. Follow these steps to install the latest node using NVM:
Step 1: Install NVM
Run this command in Terminal:
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
Step 2: Install node
Once NVM installation is complete, close and reopen Terminal. Then run this command:
nvm install node
Step 3: Check node version
Run these commands:
node --version
npm --version
If everything went well, you'll see the latest node and npm versions as output. That's all, node is installed and ready to run! 😊
Note: This question is similar to the AskUbuntu question "How do I install the latest version of node.js?" and my answer equally applies. I'm reproducing my answer here to ensure a full complete answer exists rather than just a link.
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y nano git curl vim htop gnupg2 && curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && sudo apt-get install -y nodejs
Install NodeJS 14x and npm 7x in Ubuntu 2020 LTS
Install Nodesource: curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
Install NodeJS: sudo apt-get install -y nodejs
Install latest npm: npm install -g npm#latest
For certain npm packages to run: sudo apt install build-essential
The easiest way is using a single line command is sudo snap install node --classic
It installs the latest stable node version from snap store.

Resources