Git Large File Storage / How to install git lfs on AWS EC2 Linux 2 / "No package git-lfs available." - linux

How to install git-lfs on an Amazon EC2 (Amazon Linux 2) instance?
Based on https://github.com/git-lfs/git-lfs/blob/main/INSTALLING.md did I tried:
sudo yum install git -y;
cd /home/ec2-user;
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
-> which tells me afterwards:
The repository is setup! You can now install packages.
sudo yum install git-lfs
-> gives me:
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package git-lfs available.
Error: Nothing to do
Future commands (not possible yet duo git: 'lfs' is not a git command. See 'git --help'. after git lfs install) would than be based on https://git-lfs.github.com/
git lfs install
...
git clone https://yourrepo.git;
Amazon Linux 2 AMI (HVM) - Kernel 5.10, SSD Volume Type / Arm

With Amazon Linux 2, you can use the Extras Library to install application and software updates on your instances. These software updates are known as topics.
Below are the steps:
Connect to your EC2 Linux instance using SSH.
Use the which command to confirm that the amazon-linux-extras package is installed:
$ which amazon-linux-extras
/usr/bin/amazon-linux-extras
If the amazon-linux-extras package isn't installed, you can use yum to install it:
$ sudo yum install -y amazon-linux-extras
To list the available topics, you can use the following command:
$ amazon-linux-extras list
git-lfs usually comes as part of the epel-release, so you need to first to install epel release for Amazon Linux:
$ sudo amazon-linux-extras install epel -y
For the Amazon Linux AMI, access to the Extra Packages for Enterprise Linux (EPEL) repository is configured, but it is not enabled by default.
sudo yum-config-manager --enable epel
Now you can install git-lfs or whatever else you like from epel-release:
$ sudo yum install git-lfs

As described on packagecloud[1], you need to run:
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
to install the dependencies and the repos. Alternatively you can take the script from [1] directly. You can then simply install with yum:
sudo yum install git-lfs
[1] https://packagecloud.io/github/git-lfs/install#bash-rpm

You need to directly install the ARM64 git-lfs binaries:
wget https://github.com/git-lfs/git-lfs/releases/download/v3.1.2/git-lfs-linux-arm64-v3.1.2.tar.gz
sudo yum install git -y
tar -xvf git-lfs-linux-arm64-v3.1.2.tar.gz
sudo ./install.sh
git lfs install
Now, enjoy your GIT-LFS on ARM64.

Related

How to Install Postgresql 11 in Amazon Linux AMI?

How do I install Postgresql 11 on Amazon Linux 2018.03 (specifically, not AMZ Linux 2) on Elastic Beanstalk?
I want to install a package and not manually build a binary. If an autoscale machine boots and has to build the entire PG binary, it'll take significantly longer on a t2/t3.micro.
I'm looking for pg_dump.
[Edit] Making more verbose, explain why building does not work for my situation.
The key was the PGDG is no longer available to Amazon Linux's yum since 9.3 so the individual pieces must be installed.
# Remove old Postgres
yum remove -y postgresql postgresql-server
# Install Postgres 11
yum install -y https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6-x86_64/postgresql11-libs-11.4-1PGDG.rhel6.x86_64.rpm
yum install -y https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6-x86_64/postgresql11-11.4-1PGDG.rhel6.x86_64.rpm
yum install -y https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6-x86_64/postgresql11-server-11.4-1PGDG.rhel6.x86_64.rpm
[edit]
Replace the 11.4 in each link above with any version you need available at https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6-x86_64/
sudo yum update
sudo amazon-linux-extras install postgresql11
Looks like there's no PostgreSQL 11 pre-built binary distribution for Amazon Linux. The way I solve it was to build from source code:
wget https://ftp.postgresql.org/pub/source/v11.5/postgresql-11.5.tar.gz
tar zxvf postgresql-11.5.tar.gz
cd postgresql-11.5
./configure --without-readline
make
make install
By default, it will install pg_dump into /usr/local/pgsql/bin/pg_dump.
This is an extended version of #nitsujri answer. I can't comment their comment, so I will create new answer here.
Install prerequisites:
sudo yum install readline-devel
sudo yum group install "Development Tools"
Download PostgreSQL source code and install the distro:
wget https://ftp.postgresql.org/pub/source/v11.5/postgresql-11.5.tar.gz
tar zxvf postgresql-11.5.tar.gz
cd postgresql-11.5
./configure
make
sudo make install
Add this line to your ~/.bashrc. After that relogin to an EC2 instance.
export PATH=/usr/local/pgsql/bin:$PATH

Unable to install libsasl2-devel on Amazon Linux 2 machine

I am running Ansible playbook and trying to install OS dependencies packages for python. I am trying to run the following:
sudo yum install gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel libsasl2-devel openldap-devel
However, it fails at installing libsasl2-devel with the message:
"No package matching 'libsasl2-devel' found available, installed or updated"
All my instances are Amazon Linux 2 machines. Is there any alternative package for this? I tried to look into this but I found solutions for Ubuntu only.
I was able to get it to work in a series of steps. Its a yum issue after other databases are installed and not cleaned up before installing mysql
clear sasl first: sudo yum remove cyrus-sasl
if you have installed maria, there will be conflicts, remove that as well
sudo yum remove mariadb mariadb-server mariadb-libs
take note of anything uninstalled by this to re-add later. If this is too much, you can take a risk and not remove sasl, but it might not reset the availability of the package.
Start here to clean up the dependency issues: https://serverfault.com/questions/873955/how-solve-mysql-5-7-dependency follow the command given by clean all as sudo rm -rf /var/cache/yum/*
This can possibly resolve your issues right there, if not continue the installation below.
delete all data left in /var/lib/mysql/ or you may have upgrade issues.
resinstall sasl:
sudo yum install cyrus-sasl cyrus-sasl-devel and any other packages removed above.
Establish mysql5.7 with the yum services.
wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm
sudo yum localinstall -y mysql57-community-release-el6-11.noarch.rpm
sudo yum repolist enabled | grep "mysql.*-community.*"
sudo yum repolist enabled | grep mysql
sudo yum install -y mysql-community-common mysql-community-libs mysql-community-server mysql-community-client
if that doesn't work, re-clear the yum cache again and re-run sudo yum install -y mysql-community-server
if that works, then
sudo service mysqld start
IF the /var/lib/mysql is empty, it will have created a temporary password in the /var/log/mysqld.log (use sudo to read)
run sudo mysql_secure_installation and establish your real password and security settings.
now you should have access via mysql -u root -p

How can I install a recent version of GDAL on Amazon Linux?

I'd like to install GDAL on an EC2 instance running Amazon Linux (which I think is based on RHEL 6). I'd like to avoid compiling from source if possible.
The version of GDAL included in the EPEL Yum repository is too old for my purposes (gdal-1.7.3-15.el6.x86_64). EPEL 7 includes gdal-1.11.4-1.el7.x86_64 which would be perfect. Is there any way I could use this repo on Amazon Linux?
So far I've also tried:
Adding GDAL from the ELGIS 6 repo (which has version 1.9.2). However this failed to install – as found / by others. The ELGIS Wiki advises people to use EPEL now anyway.
Downloading and installing the more recent GDAL RPM from EPEL 7, but it fails due to mismatches between GDAL's dependencies and the available packages in my enabled repos.
I'm not at all experienced with Amazon Linux (or Yum) so any hints much appreciated.
This worked for me.
sudo yum -y update
sudo yum-config-manager --enable epel
sudo yum -y install make automake gcc gcc-c++ libcurl-devel proj-devel geos-devel
cd /tmp
curl -L http://download.osgeo.org/gdal/2.0.0/gdal-2.0.0.tar.gz | tar zxf -
cd gdal-2.0.0/
./configure --prefix=/usr/local --without-python
make -j4
sudo make install
cd /usr/local
tar zcvf ~/gdal-2.0.0-amz1.tar.gz *
From https://gist.github.com/mojodna/2f596ca2fca48f08438e
I faced the same problem. It is quite a bit challenging to install with yum.
Required packages
Using yum, you can install GDAL's required packages:
cpp
sqlite3
libtiff
cmake3
like so:
sudo yum install cpp.x86_64 sqlite-devel.x86_64 libtiff.x86_64 cmake3.x86_64
PROJ and GDAL
These two have to be installed from source (tarball) and they also depend on the build you want.
As for me, I was able to install GDAL 3.2.1 on Amazon Linux 2. I also have not tried installing it on an Amazon Linux 1 so it may or may not differ.

Install nodejs 4 on redhat

Nodejs version 4 has been released and installed on my windows machine.
I'm trying to install the package trough yum on redhat but i'm not getting the latest version.
i tried: sudo yum install -y nodejs but the lastest 4.0 version is not installed.
How do i install nodejs 4.0 on a redhat machine?
NodeJS 4.X for EL7 repos located at https://rpm.nodesource.com/pub_4.x/el/7/
To install with yum change baseurl in nodesource-el.repo file to:
baseurl=https://rpm.nodesource.com/pub_4.x/el/7/$basearch
/etc/yum.repos.d/nodesource-el.repo content:
[nodesource]
name=Node.js Packages for Enterprise Linux 7 - $basearch
baseurl=https://rpm.nodesource.com/pub_4.x/el/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
[nodesource-source]
name=Node.js for Enterprise Linux 7 - $basearch - Source
baseurl=https://rpm.nodesource.com/pub_4.x/el/7/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
gpgcheck=1
You can compile and install from its source.
ver=4.0.0
wget -c https://nodejs.org/dist/v$ver/node-v$ver.tar.gz #This is to download the source code.
tar -xzf node-v$ver.tar.gz
cd node-v$ver
./configure && make && sudo make install
https://github.com/nodejs/node-v0.x-archive/wiki/Installation
Try npm install n -g and then n latest for downloading it with this version manager.
Edit:
The official distributions are managed by Nodesource. For RHEL the setup is supposed to be (take from the repo):
Current instructions for installing, as listed on the Node.js Wiki:
Note that the Node.js packages for EL 5 (RHEL5 and CentOS 5) depend on the EPEL repository being available. The setup script will check and provide instructions if it is not installed.
Run as root on RHEL, CentOS, CloudLinux or Fedora:
curl -sL https://rpm.nodesource.com/setup | bash -
Then install, as root:
yum install -y nodejs
But be aware that 4.0 is currently not in their rpm distribution
This was my solution and it worked:
Distrubution url: Distr: https://nodejs.org/dist/v4.2.1/node-v4.2.1.tar.gz (v4.2.1 for now)
Unpack the package (tar Jxf node-v4.2.1.tar.xz).
Some package could be too old and will cause problems during installation.
cd to the unpacked file and run ”./configure”. if the warming “C++ compiler too old, need g++ 4.8 or clang++ 3.4” is displayed you need to execute the following commands:
curl http://linuxsoft.cern.ch/cern/scl/slc6-scl.repo > /etc/yum.repos.d/slc6-scl.repo
rpm --import http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/51/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern
yum install -y devtoolset-3
And to utilize it without having to set environment variables execute this command:
scl enable devtoolset-3 bash
Now restart the process:
./configure
make
make install
You can try this solution.
First, update software repository to the latest versions:
yum -y update
Intall "Development Tools". It's a group of tools for compiling software from sources.
yum -y groupinstall "Development Tools"
Move to /usr/src directory - the usual place to hold software sources.
cd /usr/src
Now, we pick the latest compressed source archive from Node.js website at http://nodejs.org/download/.
wget http://nodejs.org/dist/v4.2.4/node-v4.2.4.tar.gz
tar zxf node-v4.2.4.tar.gz
cd node-v4.2.4
./configure
make
make install

Installing Docker on CentOS 6.6

I'm trying to install Docker on CentOS 6.6 64 bit version. When execute
sudo yum install docker
I get this
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.psychz.net
* extras: centos-distro.cavecreek.net
* updates: distro.ibiblio.org
No package docker available.
Error: Nothing to do
Epel repository is not installed.
Run
sudo yum install epel-release
and then run
sudo yum install docker-io
I found the answer here
I needed to add the EPEL repository where Docker can be found.
Log into your machine as a user with sudo or root privileges.
Make sure your existing yum packages are up-to-date.
$ sudo yum update
Run the Docker installation script.
$ curl -sSL https://get.docker.com/ | sh
This script adds the docker.repo repository and installs Docker.
Start the Docker daemon.
$ sudo service docker start
If you are coming here for the same issue with RedHat, use
sudo yum install yum-utils
sudo yum-config-manager --enable rhui-REGION-rhel-server-extras
sudo yum install docker

Resources