I'm trying to install nvm / node on an AMZ Linux 2 EC2 Instance using the following userData script:
#!/bin/bash
curl https://raw.githubusercontent.com/creationix/nvm/v0.39.1/install.sh | bash
. ~/.nvm/nvm.sh
nvm install 16.17.0
nvm use 16.17.0
However, when I SSH into the Instance, neither nvm nor node are installed. If I run the commands manually while SSH'd into the Instance, they work fine.
Anyone have any thoughts on why the installs don't work in the userData script? Thanks for any thoughts!
Although I still haven't figure out why the userData Script above doesn't work (it used to, so I'm not sure what changed), I was able to install Node using the following as userData, so I thought I'd share.
#!/usr/bin/env bash
yum update -y
curl -sL https://rpm.nodesource.com/setup_10.x | bash -
yum install -y nodejs git
I'd still be interested to know why the first script no longer works, if anyone has any idea.
Cheers!
Rob
Related
On a Ubuntu 20.04 server - I've also tried removing and reinstalling curl as per This SO answer.
This
is also open.. So no idea how to install Node v14 LTS under nvm now..
The readme on the github for NVM says to use the provided install script for Linux installs. This can be achieved with curl or wget:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
I recommend that you click the link and read, as their is quite a bit of related info there.
I was interested and just tested it out in a clean docker container (ubuntu:20.04) (as I dont use node that often), and it looked pretty straight forward:
apt-get update -y
apt-get install -y curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.bashrc
nvm version
# none
nvm install --lts --default
nvm version
# v14.17.0
If it not that, then I would also assume, that the issue is related to your general environment, like network inspection, proxy access or else.
As it is visible from the logs, the checksum process keeps failing in a repeated manner. And there have been issues highlighting that some ISO images can show issue with hashing process due to Windows 10 components. , which implicitly effects the checksum process under a guest environment on VirtualBox.
You can complete the steps provided by VirtualBox team there to resolve this issue, as pointed out on Virtual Box's forum:
it's Hyper-V that is causing the checksum problem you posted about, not the version of Virtualbox.
I'm writing a basic script in bash to automatically install a few packages on new machines (basically, the first script to run on a new machine before doing anything else). I'm downloading openssh-server and python for example.
My goal is just to launch the script in sudo mode, wait a few minutes and get started. The only problem I'm facing is the machine requires the user to input "y" when needed and I can't find a way to bypass this.
This is just a sample of my script :
#!/bin/bash
sudo apt update
sudo apt install openssh-server
sudo apt-get install python3
what I expect is just run this command and let it roll without the user to have and put "y" when needed
sudo bash start-script.sh
Use the -y option of apt-get. From the apt-get man page:
-y, --yes, --assume-yes
Automatic yes to prompts; assume "yes" as answer to all prompts and
run non-interactively. If an undesirable situation, such as
changing a held package, trying to install a unauthenticated
package or removing an essential package occurs then apt-get will
abort. Configuration Item: APT::Get::Assume-Yes.
I do not know how to check for this via command line. I do know that you can do this for through the GUI; however, I want to implement this in my script. Anyone know how to do this? (I haven't found anything about this).
Ubuntu updates are managed through the apt package manager.
If you're looking to run daily updates you'll want to do something like:
sudo apt update # updates apt packages index
sudo apt upgrade # runs upgrades on all packages
I am using "MacOS High Sierra".
I installed the aws cli tool a long time ago, don't remember how I installed it.
The installation is a little unusual.
I can run aws from any folder, this is working
$ aws --version
aws-cli/1.11.121 Python/2.7.13 Darwin/17.4.0 botocore/1.7.12
However running
$ which aws
this returns nothing.
I thought it might be an alias, but running
$ alias | grep aws
This also returns nothing.
Its not installed with homebrew either
$ brew list | grep aws
The reason why this is a problem, because there have now been a few cli programs I have ran (Including "AWS Sam" and a build script from my work) which are complaining because aws is not in the path.
I would much rather have a "regular installation" of the aws cli, where I put the executable in some bin folder and then put it in the environment path.
But instead its using some "magic" which I am unfamiliar with. And not even AWS owns tools ("AWS Sam") seem to like the way its installed.
Any advice would be appreciated.
I solved the problem by running
$ pip uninstall awscli
$ brew upgrade
$ brew install awscli
Now I get this result
$ which aws
/usr/local/bin/aws
"AWS Sam" and the other build script I use at work are now working.
I recently ran the following command to install the Amazon Elastic Beanstalk Command Line Interface (EB CLI). I would now like to remove it from my Windows 10 machine.
C:\Users\Cale>pip install --upgrade --user awsebcli
What is the best command to run to ensure that its fully removed from my machine?
I was able to uninstall using the following command:
C:\Users\Cale>pip uninstall awsebcli
I was uncertain how to do the uninstall since I specified --user in the original install command. This stackoverflow article helped me understand that the --user option would not matter during the uninstall process.
How to uninstall a package installed with pip install --user
For me, the awsebcli is not present in the pip list command that references the $PATH. I get this error:
Skipping awsebcli as it is not installed.
Apparently, it's on the pip executable(s) in this location (Windows, PowerShell format):
$env:userprofile\.ebcli-virtual-env\Scripts\
The uninstall command worked properly using one of those executables.
After that, it it seems that deleting the .ebcli-virtual-env will remove it fully from the machine: How do I remove/delete a virtualenv? (disclaimer: I'm not a pythonista :) )