Amazon Linux 2 OpenVPN client package unavailable? - amazon-web-services

When I try to run sudo yum install openvpn on an Amazon Linux 2 instance that I just created, I receive the message
No package openvpn available
Do I need to add a package repository? I don't find mention of needing to do so anywhere.

Its in epel. To install it on AL2:
# setup epel
sudo amazon-linux-extras install epel
# and
sudo yum install openvpn

Related

How to install unavailable python packages in aws ec2

I gonna install pyaudio and sounddevice packages via requirements.txt in EC2.
But it says raise OSError('PortAudio library not found')
So I tried to install libasound-dev for sounddevice...
Yum install libasound-dev
But it also said :
No package libasound-dev available
How should I do? I am in AWS EC2.
libasound-dev is for Ubuntu. For Amazon Linux 2 it should be:
sudo yum install alsa-lib-devel
For portaudio:
sudo amazon-linux-extras install epel -y
sudo yum install -y portaudio-devel portaudio
If you are in Window and gonna use pyaudio, you would use like this:
pip install pipwin
pipwin install pyaudio
This works well on Window.

Problem installing Microsoft ODBC Driver 17 for SQL Server with .ebextensions on AWS ElasticBeanstalk

I am trying to install Microsoft ODBC Driver 17 for SQL Server, gcc-c++ and unixODBC-devel using .ebextensions with the below config file. When I try to create the environment with eb create from the command line, the environment goes to a state where I got no choice but to kill the environment. I can't even see the logs. Can anyone tell me why this is happening?
install_odbc.config file
commands:
010_install_odbc:
command: |
# Enable epel
sudo yum-config-manager --enable epel epel-source epel-debuginfo
# Install Microsoft ODBC Driver 17 for SQL Server
# Also disable "annoying" priorities plugin while installing
curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
sudo yum remove unixODBC-utf16 unixODBC-utf16-devel #to avoid conflicts
sudo ACCEPT_EULA=Y yum install --disableplugin=priorities -y msodbcsql17
# Insall gcc-c++ and unixODBC-devel
# Also disable "annoying" priorities plugin while installing
sudo yum install --disableplugin=priorities gcc-c++
sudo yum install --disableplugin=priorities unixODBC-devel
test: "! yum list installed unixODBC unixODBC-devel"

Can't install UFW on Amazon Linux server

I'm trying to install UFW on my amazon linux server with yum and here's what I'm getting:
[root#ip-XXX-31-43-YYY ~]# sudo yum install ufw
Failed to set locale, defaulting to C
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package ufw available.
Error: Nothing to do
[root#ip-XXX-31-43-YYY ~]#
What am I doing wrong?
I can't install via apt-get.
There is no ufw package for Yum.
Lighten the load on your server, and don't install a firewall on it. Instead, control which ports are open in an AWS Security Group.
Here is the easiest way to install ufw in Amazon Linux 2.
Install UFW on Amazon Linux 2
Step 1. Update Amazon Linux 2 system packages.
sudo yum update
Step 2. Install and enable epel repository on Amazon Linux 2.
sudo amazon-linux-extras install epel
Step 3. Now, install UFW.
yum install --enablerepo="epel" ufw
Step 4. To check the version and installation as well, run:
ufw --version
Output:
ufw 0.35
Copyright 2008-2015 Canonical Ltd.
And B0o0ommm. UFW is installed... Here are some more steps to enable the UFW before using it.
Step 5. If the installation is fine you can enable it.
sudo ufw enable
Step 6. Check the status with:
sudo ufw status

How to install docker on Amazon Linux2

I wanna create docker image for Amazon ECR.
but yum can't find it in my Amazon Linux2.
[root#*** ~]# yum install -y docker
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
No package docker available.
Error: Nothing to do
Next, I tried to use amazon-linux-extras.
but amazon-linux-extras is not found, too.
[root#*** ~]# amazon-linux-extras install docker -y
-bash: amazon-linux-extras: command not found
[root#*** ~]# find / -name 'amazon-linux-extras'
[root#*** ~]$ cat /proc/version
Linux version 4.14.77-81.59.amzn2.x86_64 (mockbuild#ip-10-0-1-59) (gcc version 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC)) #1 SMP Mon Nov 12 21:32:48 UTC 2018
How can I install amazon-linux-extras or create docker image?
Install Docker
sudo yum update -y
sudo yum -y install docker
Start Docker
sudo service docker start
Access Docker commands in ec2-user user
sudo usermod -a -G docker ec2-user
sudo chmod 666 /var/run/docker.sock
docker version
So sorry, it was my misunderstanding.
My OS is Redhat Linux.
I get to install docker by
yum-config-manager --enable rhui-REGION-rhel-server-extras
yum -y install docker
systemctl start docker
systemctl enable docker
docker version
Make sure you have amazon-linux-extras installed
[root#ip-20-0-0-112 ~]# which amazon-linux-extras
/usr/bin/amazon-linux-extras
If not install amazon-linux-extras using yum
yum -y install amazon-linux-extras
Then install docker using
amazon-linux-extras install docker
I'm on amazon linux (RHEL 7.2) - ami-035b3c7efe6d061d5,
cat /proc/version
Linux version 4.14.123-86.109.amzn1.x86_64 (mockbuild#koji-pdx-corp-builder-64004) (gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC)) #1 SMP Mon Jun 10 19:44:53 UTC 2019
Following script works without having to install amazon-linux-extras install
sudo yum -y install docker
sudo service docker start
sudo chmod 666 /var/run/docker.sock
I had to fix permission issue. Also described here How to fix docker: Got permission denied issue
Then I can check containers,
[ec2-user#ip-30-0-0-196 ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
For the Amazon Linux AMI, access to the Extra Packages for Enterprise Linux (EPEL) repository is configured, but it is not enabled by default.
To install amazon-linux-extras, verify connection to the internet from within the instance then check the instance's OS:
cat /etc/os-release
If the OS is amazon linux version 2 run
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Or run sudo yum-config-manager --enable epel
To use the EPEL repository. You can now install available packages... e.g. sudo amazon-linux-extras install docker
see aws documentation for more details.
You can use the below script to install docker inside Amazon Linux 2 Instance. Also, you can mention the below script in the ec2 user data section so at the time of server bootstrap docker will be installed automatically.
#!/bin/bash
sudo yum update -y
sudo yum -y install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo chmod 666 /var/run/docker.sock
Amazon Linux 2 comes with amazon-linux-extras installed. If you think that you are running Amazon Linux 2, and amazon-linux-extras is not on the path of the ec2-user, you might be running an older version of Amazon Linux. Run this command:
grep PRETTY_NAME /etc/os-release
It should output
PRETTY_NAME="Amazon Linux 2"
If you don't see that, go back to the ec2 console and drill-down into the details of the instance. Clicking on the AMI should reveal that it corresponds to an older version of Amazon Linux. Some AWS facilities, notably CDK, currently default to Amazon Linux instead of Amazon Linux 2 when creating new instances.
I came across this question when trying to set up a docker image, based on Amazon Linux 2.
What I didn't find in the current answers is that the docker needs to be enabled in amazon-linux-extras before installing.
Dockerfile commands that worked for me:
RUN yum install -y amazon-linux-extras
RUN amazon-linux-extras enable docker
RUN yum install -y docker

need help to install php 7.2 yum packages on aws ec2

I haven't seen any yum packages for php 7.2 on AWS EC2 and the release has been out over a month.
I have tried yum list | grep php7 and only able see php70 and php71 packages.
Has anyone installed php72 on AWS EC2?
Is there another yum repo to connect to?
Does AWS have a delivery scheduled?
Although the #amzn-main repo doesn't have PHP 7.2 yet (as far as I know), you can use remi-php72. According to his release blog you can install the EPEL and Remi repositories via:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm
rpm -Uvh epel-release-latest-6.noarch.rpm
And then enable remi-php72 using yum-config-manager:
yum install yum-utils
yum-config-manager --enable remi-php72
After that, you can simply search and install php and all the needed extensions like normal:
sudo yum install --disablerepo="*" --enablerepo="remi,remi-php72" php php-fpm php-cli ...
As #Typel says in a comment on the other answer - if you're using Amazon Linux 2 AMI then
sudo amazon-linux-extras install -y php7.2
Beats installing multiple external repos and has most of th basics, including mariadb and vim (everything I need to feel happy!).
See the list: sudo amazon-linux-extras list