Installing Yarn through Bash shell WSL1 - bash

When I run curl, it shows this error:
~$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
gpg: can't connect to the agent: IPC connect call failed
I'm unable to install yarn.
I tried killing:
~$ kill -9 gpg-agent
and restarting:
~$ gpg-agent --daemon
but nothing worked so far. Any advice?

I did this from my root -
npm install -g yarn
Checked if the yarn is installed by -
yarn --version
It worked.

The following worked for me:
sudo apt remove gnupg
sudo apt autoremove
sudo apt install gnupg1
This installs GNUPG Classic. Read more here.

Related

Install go-swagger on Linux Ubuntu

I want to install go-swagger on LInux Ubuntu 22.04 but i have blocker. This is my code to install go-swagger.
sudo apt update
sudo apt install -y apt-transport-https gnupg curl
curl -1sLf 'https://dl.cloudsmith.io/public/go-swagger/go-swagger/gpg.2F8CB673971B5C9E.key' | sudo apt-key add -
curl -1sLf 'https://dl.cloudsmith.io/public/go-swagger/go-swagger/config.deb.txt?distro=debian&codename=any-version' | sudo tee /etc/apt/sources.list.d/go-swagger-go-swagger.list
sudo apt update
sudo apt install swagger
but the result on my laptop
Unable to locate package swagger,
please help me to the solving my blocker
This is similar to the bug on Caddy due to changes in CloudSmith. Run
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/go-swagger/go-swagger/gpg.2F8CB673971B5C9E.key' | sudo gpg --dearmor -o /usr/share/keyrings/go-swagger-go-swagger-archive-keyring.gpg
to import the key.

"Yarn: command not found" even after being installed [duplicate]

This question already has answers here:
yarn command not found after installing via npm
(8 answers)
Closed 1 year ago.
I'm trying to install metronic on my computer and for this I need to have yarn installed. So I ran the command :
npm install --global yarn
/Users/cbarrial/.npm-global/bin/yarn -> /Users/cbarrial/.npm-global/lib/node_modules/yarn/bin/yarn.js
/Users/cbarrial/.npm-global/bin/yarnpkg -> /Users/cbarrial/.npm-global/lib/node_modules/yarn/bin/yarn.js
+ yarn#1.16.0
updated 1 package in 0.376s
So I guess the installation is working fine but then if I try the yarn command I'm getting this :
yarn --version
-bash: yarn: command not found
I have no idea where the problem could come from, I already have the latest npm and node.js installed and working fine.
You can install yarn in the next way:
sudo apt-get install curl # Only if you don't have installed curl
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
This way is an alternative to install yarn on debian/ubuntu, but you can find the alternative installation for different operative systems in the official page for Yarn in the section Alternatives

Installing Passenger & Nginx using Vagrant shell script

This is my first post to SO so I hope I'm asking this correctly.
I wrote a shell script to automate the installation of Passenger & Nginx (along with some other components) without any user input on a Vagrant VM running Ubuntu 14.04. It works fine using the following:
echo "****** Adding Passenger & Nginx Repo ******"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
sudo apt-get install apt-transport-https ca-certificates -y
echo "deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main" | sudo tee /etc/apt/sources.list.d/passenger.list
sudo chown root: /etc/apt/sources.list.d/passenger.list
sudo chmod 600 /etc/apt/sources.list.d/passenger.list
sudo apt-get update
echo "****** Installing Passenger & Nginx ******"
sudo apt-get install nginx-extras passenger -y
Now I want to do the same thing for a Vagrant VM running CentOS 6.4. I followed the directions for CentOS found on the Phusion Passenger site but I can't seem to get it working properly. When I do the following, the output from the shell script says "No package passenger available.":
echo "****** Adding Passenger & Nginx Repo ******"
sudo yum install epel-release pygpgme curl -y
sudo 'echo "curl --fail -sSLo /etc/yum.repos.d/passenger.repo https://oss-binaries.phusionpassenger.com/yum/definitions/el-passenger.repo"'
sudo chown root: /etc/yum.repos.d/passenger.repo
sudo chmod 600 /etc/yum.repos.d/passenger.repo
sudo yum update
echo "****** Installing Passenger & Nginx ******"
sudo yum install nginx passenger -y
Looking in the /etc/yum.repos.d directory after the script is run, there is no passenger.repo listed, so it looks like for whatever reason curl is not downloading the repo file. However, if I manually type the commands in my terminal command line after the script finishes it will pull down the repo and run.
I'm probably doing something stupid here, but I'm rather new to shell scripting and can't seem to figure out where the problem is.
Thanks for any help you can give me.
sudo 'echo "curl --fail -sSLo /etc/yum.repos.d/passenger.repo https://oss-binaries.phusionpassenger.com/yum/definitions/el-passenger.repo"'
That is wrong and is not what the manual instructed. It should be:
sudo curl --fail -sSLo /etc/yum.repos.d/passenger.repo https://oss-binaries.phusionpassenger.com/yum/definitions/el-passenger.repo

Error in build from Dockerfile for Ubuntu image with Mono installed

I have the following docker file that I am attempting to use to build a Ubuntu image with mono.
FROM ubuntu:14.04
MAINTAINER John Smith <John.Smith#gmail.com>
RUN sudo apt-get update
RUN sudo /bin/bash -l -c apt-get install wget
RUN sudo /bin/bash -l -c apt-get http://download.mono-project.com/repo/xamarin.gpg
RUN sudo apt-key add xamarin.gpg
RUN sudo echo "deb http://download.mono-project.com/repo/debian wheezy main" > /etc/apt/sources.list.d/mono-xamarin.list
RUN sudo apt-get update
RUN sudo apt-get install mono-complete
When I run the following docker build command...
docker build -t="test/mono" .
It fails building and gives the following errors message:
gpg:can't open 'xamaring.gpg': No such file or directory.
2015/05/27 16:11:01 The command [/bin/bash -c sudo apt-key add xamarin.gpg] returned a non-zero code: 2
Anything obviously wrong sticking out?
It looks like you forgot to use wget instead of apt-get after you installed wget, so 'xamaring.gpg' has not been downloaded and that's why it can't be found.
You need this:
/bin/bash -l -c "wget http://download.mono-project.com/repo/xamarin.gpg"
The is an example of this in docker's website:
Dockerizing MongoDB

Install hadoop on Ubuntu 12.04

I am trying to install Hadoop on Ubuntu 12.04, my system is 32 bit compatible.
I am Linux newbie. I tried this tutorial.
I have done these steps successfully:
Part 1 install Hadoop:
First, install Sun JDK 6. Go to the following page:
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html
Look for x86, agree to the license, and download the file. I did this on my laptop and copied it up to the server via scp. Once it's up there follow these installation instructions:
chmod +x jdk-6u32-linux-x86.bin
./jdk-6u32-linux-x86.bin
sudo mkdir -p /usr/lib/jvm
sudo mv jdk1.6.0_32 /usr/lib/jvm/jdk1.6.0_32
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_32/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_32/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_32/bin/javaws 1
# now we're ready to install hadoop. taken from https://ccp.cloudera.com/display/CDH4DOC/Installing+CDH4+on+a+Single+Linux+Node+in+Pseudo-distributed+Mode
# update apt to be able to access cloudera
wget http://archive.cloudera.com/cdh4/one-click-install/lucid/amd64/cdh4-repository_1.0_all.deb
sudo dpkg -i cdh4-repository_1.0_all.deb
curl -s http://archive.cloudera.com/cdh4/ubuntu/lucid/amd64/cdh/archive.key | sudo apt-key add -
sudo apt-get update
# install hadoop
sudo su
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0_32/
But while I try installing 'hadoop-0.20-conf-pseudo' I get this error:
E: Unable to locate package hadoop-0.20-conf-pseudo
E: Couldn't find any package by regex 'hadoop-0.20-conf-pseudo'
Would you please let me know what causes the problem?

Resources