Unable to install syslog-ng on amazon linux 2 - amazon-web-services

I have started EC2 instance from L=amazon linux 2 AMI.
I am trying to install syslog-ng with yum but I am getting error.
Commands used :
$ sudo amazon-linux-extras install epel -y
$ sudo yum install syslog-ng
AND
$ sudo yum-config-manager --add-repo=https://copr.fedorainfracloud.org/coprs/czanik/syslog-ng321/repo/epel-7/czanik-syslog-ng321-epel-7.repo"
$ sudo yum install --enablerepo=epel --assumeyes syslog-ng
But I am getting following error in both the cases:
Loaded plugins: dkms-build-requires, extras_suggestions, langpacks, priorities, update-motd
215 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package syslog-ng.x86_64 0:3.23.1-1.el6 will be installed
--> Processing Dependency: libmaxminddb.so.0()(64bit) for package: syslog-ng-3.23.1-1.el6.x86_64
--> Processing Dependency: libpcre.so.0()(64bit) for package: syslog-ng-3.23.1-1.el6.x86_64
--> Running transaction check
---> Package libmaxminddb.x86_64 0:1.2.0-1.el7 will be installed
---> Package syslog-ng.x86_64 0:3.23.1-1.el6 will be installed
--> Processing Dependency: libpcre.so.0()(64bit) for package: syslog-ng-3.23.1-1.el6.x86_64
--> Finished Dependency Resolution
Error: Package: syslog-ng-3.23.1-1.el6.x86_64 (copr:copr.fedorainfracloud.org:czanik:syslog-ng323epel6)
Requires: libpcre.so.0()(64bit)
You could try using --skip-broken to work around the problem
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
cloud-init-19.3-44.amzn2.noarch has missing requires of rsyslog

I wrote these instructions a year ago: https://www.syslog-ng.com/community/b/blog/posts/installing-syslog-ng-in-amazon-linux-2-including-graviton2
I do not have any AWS accounts right now, but if they do not work, the I'll try to get one...
**Update:**
First of all: I double checked your report. You mention adding a repo for EPEL 7 syslog-ng 3.21, however the error below it is about syslog-ng 3.23 for EPEL 6.
OK, I got access. I followed my own instructions and it works:
[ec2-user#ip-xxx ~]$ syslog-ng -V
syslog-ng 3 (3.29.1)
Config version: 3.29
Installer-Version: 3.29.1
Revision:
Compile-Date: Aug 29 2020 08:27:16
Module-Directory: /usr/lib64/syslog-ng
Module-Path: /usr/lib64/syslog-ng
Include-Path: /usr/share/syslog-ng/include
Available-Modules: add-contextual-data,affile,afprog,afsocket,afstomp,afuser,appmodel,basicfuncs,cef,confgen,cryptofuncs,csvparser,dbparser,disk-buffer,examples,graphite,hook-commands,json-plugin,kvformat,linux-kmsg-format,map-value-pairs,pseudofile,sdjournal,stardate,syslogformat,system-source,tags-parser,tfgetent,timestamp,xml,azure-auth-header,http
Enable-Debug: off
Enable-GProf: off
Enable-Memtrace: off
Enable-IPv6: on
Enable-Spoof-Source: on
Enable-TCP-Wrapper: on
Enable-Linux-Caps: on
Enable-Systemd: on
[ec2-user#ip-xxx ~]$ cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
And tried to latest version (3.35), and that works as well.

Tried with specific package and its able to install.
$ sudo yum --enablerepo=epel -y install syslog-ng-3.5.6-3.el7.x86_64

Related

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"

Credential named assume-role-with-web-identity not found

On my amazon linux ec2 instance, I have the iam-role attached with proper permission, I ran the command $ sudo yum update .
After this I started getting the error Credential named assume-role-with-web-identity not found for command aws s3 ls.
But if I add sudo and run the command sudo aws s3 ls then it works fine.
Please help me to find the issue.
Thanks in advance.
Downgraded the version of aws-cli and it got fixed.
commands used:
$ curl https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip -o awscli-bundle.zip
$ unzip awscli-bundle.zip
$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/bin/aws
You need to update botocore==1.12.201
pip install botocore==1.12.201
For detail refer here:
https://github.com/aws/aws-cli/issues/4371#issuecomment-518792844
Looks like a known issue, take a look at https://github.com/aws/aws-cli/issues/4371
I had the same issue on macOS. Upgrading both botocore and awscli did the trick:
pip3 install --upgrade botocore awscli
To downgrade the ubuntu package, you can use:
$ apt-cache madison awscli
awscli | 1.18.69-1ubuntu0.18.04.1 | http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
awscli | 1.18.69-1ubuntu0.18.04.1 | http://us.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages
awscli | 1.14.44-1ubuntu1 | http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
awscli | 1.14.44-1ubuntu1 | http://us.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
Then select the correct one and install using apt-get:
$ sudo apt-get install awscli=1.14.44-1ubuntu1 -V
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be DOWNGRADED:
awscli (1.18.69-1ubuntu0.18.04.1 => 1.14.44-1ubuntu1)
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 482 kB of archives.
After this operation, 4,870 kB disk space will be freed.
Do you want to continue? [Y/n]
I had this same issue on an image that had installed botocore separately from awscli and that was the version (botocore 1.12.172) it seemed to be picking up. Once I upgraded to botocore 1.12.200 and run the image build again, it resolved this issue above.
pip install botocore==1.12.200
{ brew | apt-get } install awscli
This should resolve the issue above without having to downgrade awscli.
See also: https://github.com/aws/aws-cli/issues/4371

Installing Chromium on Amazon Linux

I am trying to install Chromium (or Chrome, whichever) on an Amazon Linux machine.
I have tried many steps, to no avail. Here is what I have tried:
Simple Yum Install
yum install epel # worked
yum install chromium
generated error message:
Error: Package: chromium-31.0.1650.63-2.el6.x86_64 (chromium-el6)
Requires: libgnome-keyring.so.0()(64bit)
Error: Package: chromium-31.0.1650.63-2.el6.x86_64 (chromium-el6)
Requires: libgtk-x11-2.0.so.0()(64bit)
Error: Package: chromium-31.0.1650.63-2.el6.x86_64 (chromium-el6)
Requires: libgdk_pixbuf-2.0.so.0()(64bit)
Error: Package: chromium-31.0.1650.63-2.el6.x86_64 (chromium-el6)
Requires: libXss.so.1()(64bit)
Error: Package: chromium-31.0.1650.63-2.el6.x86_64 (chromium-el6)
Requires: libgdk-x11-2.0.so.0()(64bit)
Error: Package: chromium-31.0.1650.63-2.el6.x86_64 (chromium-el6)
Requires: libcanberra-gtk2(x86-64)
Error: Package: chromium-31.0.1650.63-2.el6.x86_64 (chromium-el6)
Requires: libatk-1.0.so.0()(64bit)
Yum install of specific RPM package
I tried downloading a Chrome RPM, both the latest stable version as well as a specific version, and then running
yum install google-chrome-stable-64.0.3282.119-1.x86_64.rpm
It yielded the same error message
Manual procedure
Downloaded binary from https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Linux_x64/532015/
Running it generated the error message
error while loading shared libraries: libXcursor.so.1: cannot open shared object file: No such file or directory
I ran
yum install libXcursor
yum install libXfixes # because chrome was then complaining about that library
yum install libXdamage # and subsequently that one
which all worked.
However, then Chrome started complaining about a libcups library :
error while loading shared libraries: libcups.so.2: cannot open shared object file: No such file or directory
libcups wasn't found by yum, and it seems that this is because it is a 32 bit library. Some page recommended to install ia32-libs as a solution, but running yum install ia32-libs showed that it was already installed.
I couldn't get past that point.
Other
I also tried steps mentioned here, but that didn't work
some pages point to using dpkg, but that command doesn't exist on Amazon Linux apparently
apt neither
None of these answers , work, and none of them actually solves problem for amazon linux,
To really solve the problem if you are using EC2 instance or any other server where you are running Amazon linux, you should follow the below steps .
Enable and install Extra Packages for Enterprise Linux by running the command
sudo amazon-linux-extras install epel -y
Post installing all the extra packages successfully, Install chromimum as usual
sudo yum install -y chromium
Once you do that Chromium will have all required such as libatk* libgdk* etc ...
You should be able to easily launch Chromium
The missed out packages that you are looking here, are actually not missedout they are kind of default you just have to enable them , this is well documented in AWS documentation .
https://aws.amazon.com/premiumsupport/knowledge-center/ec2-enable-epel/
In order to get headless chrome working on Lambda, I deployed an identical AMI as an EC2 instance (currently amzn-ami-hvm-2017.03.1.20170812-x86_64-gp2). After installing chrome, the usual litany of missing dependencies begins.
Reference: https://medium.com/mockingbot/run-puppeteer-chrome-headless-on-ec2-amazon-linux-ami-6c9c6a17bee6
Navigate to the folder containing the chrome executable and use ldd to check for missing dependencies:
$ ldd chrome | grep not
libpangocairo-1.0.so.0 => not found
libpango-1.0.so.0 => not found
libcairo.so.2 => not found
libXcursor.so.1 => not found
libXdamage.so.1 => not found
libXfixes.so.3 => not found
libcups.so.2 => not found
libXss.so.1 => not found
libXrandr.so.2 => not found
libgconf-2.so.4 => not found
libatk-1.0.so.0 => not found
libgtk-3.so.0 => not found
libgdk-3.so.0 => not found
libgdk_pixbuf-2.0.so.0 => not found
Install the following:
$ sudo yum install cups-libs dbus-glib libXrandr libXcursor libXinerama cairo cairo-gobject pango
Check again:
$ ldd chrome | grep not
libXss.so.1 => not found
libgconf-2.so.4 => not found
libatk-1.0.so.0 => not found
libgtk-3.so.0 => not found
libgdk-3.so.0 => not found
libgdk_pixbuf-2.0.so.0 => not found
We need to grab these dependencies from a maddeningly large set of RPMs:
# Install ATK from CentOS 7
$ sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/atk-2.22.0-3.el7.x86_64.rpm
$ sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/at-spi2-atk-2.22.0-2.el7.x86_64.rpm
$ sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/at-spi2-core-2.22.0-1.el7.x86_64.rpm
# Install GTK from fedora 20
$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/g/GConf2-3.2.6-7.fc20.x86_64.rpm
$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/l/libXScrnSaver-1.2.2-6.fc20.x86_64.rpm
$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/l/libxkbcommon-0.3.1-1.fc20.x86_64.rpm
$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/l/libwayland-client-1.2.0-3.fc20.x86_64.rpm
$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/l/libwayland-cursor-1.2.0-3.fc20.x86_64.rpm
$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/20/Fedora/x86_64/os/Packages/g/gtk3-3.10.4-1.fc20.x86_64.rpm
# Install Gdk-Pixbuf from fedora 16
$ sudo rpm -ivh --nodeps http://dl.fedoraproject.org/pub/archive/fedora/linux/releases/16/Fedora/x86_64/os/Packages/gdk-pixbuf2-2.24.0-1.fc16.x86_64.rpm
That should resolve all the dependencies and chrome should be able to run, finally!!
I use chromium for headless testing via AWS Ubuntu launched through CodeBuild. I found I had to update node and install a set of chromium dependencies.
#!/bin/sh
echo "Installing nodejs (which will include node and npm)"
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs
echo "Installing chromium dependencies"
apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
For those using Amazon Linux 2022, there are several packages missing, running ldd chrome | grep not in the Chromium directory yields:
libnss3.so => not found
libnssutil3.so => not found
libsmime3.so => not found
libnspr4.so => not found
libgbm.so.1 => not found
These packages aren't available for Amazon Linux 2022 but you can find them on https://rhel.pkgs.org/8 which works because this distribution is based on RHEL 8.
So these should fix it:
sudo dnf install http://repo.okay.com.mx/centos/8/x86_64/release/okay-release-1-1.noarch.rpm
sudo dnf install nss
sudo dnf install mesa-libgbm

Installing VirtualBox 5.1 on CentOS 7.3

Has anyone been able to install VirtualBox 5.1 successfully on a CentOS 7.3 x64 box? Installing it via YUM succeeds, but calling "vagrant -v" shows the following:
This system is not currently set up to build kernel modules (system extensions).
Running the following commands should set the system up correctly:
yum install kernel-devel-3.10.0-327.36.3.el7.x86_64
(The last command may fail if your system is not fully updated.)
yum install kernel-devel
kernel-devel is installed already as part of dependencies. So it seems VirtualBox expects the 7.2 kernel modules. Has anyone been able to install VirtualBox 5.1 on kernel 3.10.0-514.2.2.el7.x86_64?
I found a solution to this, in case it might be useful for someone else.
(1) Visit https://www.rpmfind.net/linux/RPM/centos/updates/7.2.1511/x86_64/Packages/kernel-devel-3.10.0-327.36.3.el7.x86_64.html
(2) Download the RPM (kernel-devel-3.10.0-327.36.3.el7.x86_64.rpm)
(3) Run yum localinstall -y /path/to/kernel-devel-3.10.0-327.36.3.el7.x86_64.rpm to install "kernel-devel".
(4) Run /sbin/vboxconfig to further configure VirtualBox.
If you are using Ansible, you need something like the below before installing it via YUM (only if you have a system that does not have the correct kernel sources).
# Required kernel module
- name: Copy required kernel modules
copy:
src: "{{ role_path }}/files/{{ vbox_kernel_devel_rpm }}"
dest: "/tmp/{{ vbox_kernel_devel_rpm }}"
- name: Install kernel-devel module
shell: "yum localinstall -y /tmp/{{ vbox_kernel_devel_rpm }}"
args:
warn: false
- name: Delete uploaded RPM
file: path="/tmp/{{ vbox_kernel_devel_rpm }}", state=absent
I had machines where the kernel version was different so I found it easier to do this in scripts with:
curl -s ftp://fr2.rpmfind.net/linux/centos/7.2.1511/updates/x86_64/Packages/kernel-devel-$(uname -r).rpm -o kernel-devel-$(uname -r).rpm
sudo yum localinstall kernel-devel-$(uname -r).rpm
sudo yum install docker-engine VirtualBox-5.1 kernel-headers gcc
sudo /sbin/vboxconfig
This could be customised further with CentOS version in the url.

not able to install contextBroker via yum on CentOs7

HI everybody i am using CentOs7 and havae some troubles with the installation of the contextBroker. I followed the installation on the added the Fiware Repo in my yum repo.
Here is a list of my yum repo:
repo id repo name status
base/7/x86_64 CentOS-7 - Base 9,007
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 10,368
extras/7/x86_64 CentOS-7 - Extras 356
fiware Fiware Repository 176
mongodb MongoDB repo 279
updates/7/x86_64 CentOS-7 - Updates 2,070
repolist: 22,256
I am always getting an error message that there are some failed dependencies
libboost_filesystem-mt.so.5()(64bit) is needed by contextBroker-0.15.0-1.x86_64
libboost_system-mt.so.5()(64bit) is needed by contextBroker-0.15.0-1.x86_64
libboost_thread-mt.so.5()(64bit) is needed by contextBroker-0.15.0-1.x86_64
Here is the output of my config file for the fiware.repo
[fiware]
name=Fiware Repository
#baseurl=http://repositories.lab.fiware.org/repo/rpm/$releasever
baseurl=http://repositories.lab.fiware.org/repo/rpm/x86_64/
gpgcheck=0
enabled=1
I found a possible solution under this link, but unfortunately this is not working. In the comment section there is an entry which says that there is a problem with CentOs7 but that doesn`t solve my problem
Btw: this is also not working Boost-Libboost is needed in Centos7 (ContexBroker)
So my question is, did someone installed the contextBroker on CentOs7 via yum and if he/she did how can i solve this problem ?
As you mention, there isn't official support for CentOS 7 at the present moment. However, you could do the following to get a running binary with contextBroker in your CentOS 7 system (actually, this a "quick and dirty" receipt based on the build from sources procedure documented in the Orion manual):
sudo yum install git wget
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -i epel-release-latest-7.noarch.rpm
sudo yum install make cmake gcc-c++ scons
sudo yum install boost-devel libcurl-devel gnutls-devel libgcrypt-devel libuuid-devel
# Install mongoDB driver as described in the documentation
# Install rapidjson as described in the documentation
# Install libmicrohttpd as described in the documentation
mkdir ~/src
cd ~/src
git clone https://github.com/telefonicaid/fiware-orion.git
cd fiware-orion
# optionally, you can set an specific version with a checkout command
# e.g. 'git checkout 1.2.1'. Otherwise, you will build the latest
# code from develop branch
make
BUILD_RELEASE/src/app/contextBroker/contextBroker --version
Moreover, you can use the following to generate a RPM file:
sudo yum install rpm-build
make rpm
# The RPM is generated in rpm/RPMS/x86_64/contextBroker-1.2.0_next-dev.x86_64.rpm
# (version number may vary)
That RPM file is supposed to work in other CentOS 7 systems and you can install just using sudo yum install /path/to/contextBroker-1.2.0_next-dev.x86_64.rpm.