How to install geos_c on Amazon Linux when it is not appearing in EPEL? - geos

I'm running some python code on EC2 that uses shape files and has a dependency on the geos_c library. It's raising a Could not find lib geos_c or load any of its variants error.
I've applied updates and followed the steps from https://libgeos.org/usage/install/#amazon-linux, namely:
# Apply updates
sudo yum update -y
# Install geos
sudo yum install -y amazon-linux-extras
sudo amazon-linux-extras enable epel
sudo yum search geos
sudo yum install geos geos-devel
Unfortunately this returns Warning: No matches found for: geos, so it looks like this package is not currently available in the EPEL version in Amazon Linux.
This is a vanilla instance of Amazon Linux using Amazon Linux 2 AMI (HVM) - Kernel 5.10 with 64-bit (Arm) architecture.
What's the best way to install the geos library?

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

How to install JavaPackage on ubuntu

I came across a debian application by the name JavaPackage which can create a debian installation file (.deb) form a java binary (.tar.gz) which you can then install using dpkg -i application_name.deb. With Ubuntu being a debian-based linux distribution, it is possible that it can be installed on ubuntu as well.
How do I go about installing it on Ubuntu/Kubuntu 16.04.2 LTS?
java-package is available in the official ubuntu repositories. All you need to do is update the repository with the latest version then install it as shown below:
sudo apt-get update
sudo apt-get install java-package

How to install python3-devel on red hat 7

I am trying to install something in my virtual environment, which uses anaconda python 3.6. I get the gcc failed with exit status 1, hinting on the absence of the right python3-devel package, as described in error: command 'gcc' failed with exit status 1 while installing eventlet.
To fix the error, I tried to install the python3-devel package on my server running RHEL 7.3.
I did yum install python3-devel, but got a 'package not found' error. Then I found https://serverfault.com/questions/710354/repository-for-python3-devel-on-centos-7, which hints to the python34-devel package in the EPEL repository. I installed it using yum, but upon trying to install something in my virtual environment, I still get the gcc failed with exit status 1 error.
Does someone know how I can fix this? All help would be much apprechiated.
Search for the package in yum , use the following command:
yum search python3 | grep devel
It will list all the available devel packages. The result will be somewhat like this
python3-cairo-devel.x86_64 : Libraries and headers for python3-cairo
python3-devel.x86_64 : Libraries and header files needed for Python 3
: development
python34-devel.x86_64 : Libraries and header files needed for Python 3
: development
Then you can choose the package you want to install from the list , suppose if you want to to install python3-devel , execute the following
yum install -y python3-devel.x86_64
I thought I might update this for 2020. As of RHEL 7.7, python-devel is not available in EPEL, it has been retired by Fedora Project. All I wanted for today was the python h files, and this got me there:
# yum install python3-devel.x86_64 --enablerepo=rhel-7-server-optional-rpms
We do have one of the Redhat No-Cost Developer licenses, but I am not sure that is required for the optional-rpms.
PS, this was helpful in verifying which packages of interest were in optional-rpms
# yum repo-pkgs rhel-7-server-optional-rpms list | grep python3
There are no python3-* packages from Red Hat in Red Hat Enterprise Linux 6 or 7.
However there are python3-* packages available if you enable third party repos like EPEL or IUS. But, these are not supported by Red Hat. Chances are if you are running RHEL, your organization has a preference for supported packages.
You can get supported Python 3 packages from Red Hat via Red Hat Software Collections (RHSCL). Currently Python 3.6 is the newest available, the package name is rh-python36. Installing the RHSCL package will also install rh-python36-devel and a number of other packages.
See How to install Python 3, pip, venv, virtualenv, and pipenv on RHEL
Don't forget to install #development first, so you have gcc, make, etc. for building any dynamically loaded shared objects.
To install:
$ su -
# subscription-manager repos --enable rhel-7-server-optional-rpms \
--enable rhel-server-rhscl-7-rpms
# yum -y install #development
# yum -y install rh-python36
# yum -y install rh-python36-numpy \
rh-python36-scipy \
rh-python36-python-tools \
rh-python36-python-six
# exit
The blog linked above has lots of tips for working with Python, virtual environments, as well as software collections on Red Hat.

Amazon Web Services (AWS) - Amazon Linux: How to install libel-dev and g++?

I just started an AWS EC2 instance using an Amazon linux instance. I tried installing libel-dev and g++ like sudo yum libel-dev g++ make, but I get:
No package libssl-dev available.
No package g++ available.
So how can I install libel-dev and g++?
Thank you and will be sure to vote up/accept answer!
For libssl equivalent, this one worked sudo yum install openssl-devel -y
For g++, sudo yum install gcc -y
Since you have tagged yum, I'm assuming it the package manager you're using on your OS.
Whenever you install a fresh OS, it's always a good idea to update your package manager, be it apt-get or yum.
Do an update on the same (yum update -y) and if does not, you might have to compile the same from source.
You can learn more about compiling from source here: https://unix.stackexchange.com/questions/173/how-to-compile-and-install-programs-from-source
#Efren's command sudo yum install gcc -y didn't install g++ for me, and why should it?
I was able to get g++ by switching my OS from Amazon Linux 2 to Deep Learning AMI GPU PyTorch 1.12.0 (Amazon Linux 2). It comes pre-installed.

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.

Resources