yum update from wrong repository i - amazon-web-services

I am running a AWS Linux AMI in AWS, it seems to be RHEL under the covers and uses yum (kernel 3.4.62-53.42.amzn1.x86_64) . The amazon repo includes nginx 1.4.2 which is out of date so I removed it and re-installed using the repo given at nginx website. I did this as such:
sudo yum remove nginx*
sudo yum --disablerepo="*" --enablerepo="nginx" install nginx
Note that yum priorities are disabled. I tried messing around with setting priority= in the repo files but decided disabling priorities made sense after reading up on it.
/etc/yum.repos.d files :
amzn-main.repo contains:
[amzn-main]
name=amzn-main-Base
mirrorlist=http://repo.us-east-1.amazonaws.com/$releasever/main/mirror.list
mirror_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=1
retries=5
timeout=10
report_instanceid=yes
[amzn-main-debuginfo]
name=amzn-main-debuginfo
mirrorlist=http://repo.us-east-1.amazonaws.com/$releasever/main/debuginfo/mirror.list
mirror_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=0
retries=5
timeout=10
report_instanceid=yes
nginx.repo contains:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/rhel/6/$basearch/
gpgcheck=0
enabled=1
priority=1
Now doing the update once nginx 1.4.3 is installed, it tries to install the old version from the amazon main repo:
$ sudo yum update
Loaded plugins: update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 0:1.4.3-1.el6.ngx will be updated
---> Package nginx.x86_64 1:1.4.2-1.12.amzn1 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
So not sure why its picking up the older version. Is there a way to configure yum to only update if the version is newer than currently installed? If there is no way, is there a way to skip nginx package when I do a general update and then update nginx using another command as described above that disables all repos and uses only nginx repo, here it is again:
sudo yum --disablerepo="*" --enablerepo="nginx" install nginx

To ignore any specific package in a single yum repository, one may add the following line to their /etc/yum.repos.d/${amazonreponame}.repo configuration file:
exclude=package_name*
Example:
[amzn-main]
name=amzn-main-Base
mirrorlist=http://repo.us-east-1.amazonaws.com/$releasever/main/mirror.list
mirror_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=1
retries=5
timeout=10
report_instanceid=yes
exclude=nginx*
The exclude=* option may also be added globally (i.e., all repos) to /etc/yum.conf

Related

amazon linux 2 yum missing update (AWS Security Center)

AWS security advisory https://alas.aws.amazon.com/AL2/ALAS-2021-1674.html is causing my security scan to fail. The advice is to yum update httpd to install httpd-2.4.48-2.amzn2.x86_64. However when I do this AWS yum repo only has an old version of this package (httpd-2.4.46-2.amzn2.x86_64).
yum update httpd
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No packages marked for update
yum install httpd
Loaded plugins: extras_suggestions, kernel-livepatch, langpacks, priorities, update-motd
amzn2-core | 3.7 kB 00:00:00
Package httpd-2.4.46-2.amzn2.x86_64 already installed and latest version
Nothing to do
This is a brand new unmodified AWS linux 2 instance. I have tried everything I could find online (making sure I can access yum repo and clearing cache)
Can anyone else using amazon linux 2 see this new package? (2.4.48) or even better have any suggestions how to proceed?
Worked it out - AWS Elastic Beanstalk in all their wisdom append a "-$guid" to the YUM repo list on an instance, which must be stuck in their CDN as was returning an out of date package list. I have resolved via:
sed 's/-$guid//g' /etc/yum.repos.d/amzn2-core.repo -i
AWS security advisory Link mention that we have to do "yum update httpd". If it still does not work I would say we have to update yum repo.

rpm glibc Centos 7

How can I install both of them on CentOS 7? They both depend on each other. The machine is not connected to the internet.
[efe#localhost Desktop]$ sudo rpm -i glibc-2.17-317.el7.x86_64.rpm
warning: glibc-2.17-317.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: Failed dependencies:
glibc-common = 2.17-317.el7 is needed by glibc-2.17-317.el7.x86_64
[efe#localhost Desktop]$ sudo rpm -i glibc-common-2.17-317.el7.x86_64.rpm
warning: glibc-common-2.17-317.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: Failed dependencies:
glibc = 2.17-317.el7 is needed by glibc-common-2.17-317.el7.x86_64
EDIT1: I have installed 2.17-292 for everything on x86_64 and it is successful. However, for i686 (yes, I need both unfortunately) I have tried to combine all packages into single command, lots of other dependencies appeared. I have tried to install 2.17-292 like I did for x86_64, this is the final output with errors. Before this last command, dependency errors appeared all the time, this is the first different error.
[efe#localhost packages]$ sudo rpm -i glibc-2.17-292.el7.i686.rpm glibc-common-2.17-292.el7.i686.rpm glibc-headers-2.17-292.el7.i686.rpm glibc-devel-2.17-292.el7.i686.rpm nss-softokn-freebl-3.44.0-8.el7_7.i686.rpm nspr-4.25.0-2.el7_9.i686.rpm nss-util-3.53.1-1.el7_9.i686.rpm libselinux-2.5-15.el7.i686.rpm libsepol-2.5-10.el7.i686.rpm pcre-8.32-17.el7.i686.rpm libgcc-4.8.5-44.el7.i686.rpm libstdc++-4.8.5-44.el7.i686.rpm
warning: glibc-2.17-292.el7.i686.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
file /usr/bin/ldd from install of glibc-common-2.17-292.el7.i686 conflicts with file from package glibc-common-2.17-292.el7.x86_64
file /usr/lib/locale/locale-archive.tmpl from install of glibc-common-2.17-292.el7.i686 conflicts with file from package glibc-common-2.17-292.el7.x86_64
file /usr/share/gcc-4.8.2/python/libstdcxx/v6/printers.pyc from install of libstdc++-4.8.5-44.el7.i686 conflicts with file from package libstdc++-4.8.5-36.el7.x86_64
file /usr/share/gcc-4.8.2/python/libstdcxx/v6/printers.pyo from install of libstdc++-4.8.5-44.el7.i686 conflicts with file from package libstdc++-4.8.5-36.el7.x86_64
EDIT2: I have entered a command as suggested by Florian Weimer.
[efe#localhost i686]$ sudo yum update *.rpm
Loaded plugins: fastestmirror, langpacks
Examining glibc-2.17-292.el7.i686.rpm: glibc-2.17-292.el7.i686
Package glibc.i686 not installed, cannot update it. Run yum install to install it instead.
Examining glibc-common-2.17-292.el7.i686.rpm: glibc-common-2.17-292.el7.i686
Package glibc-common.i686 not installed, cannot update it. Run yum install to install it instead.
Examining glibc-devel-2.17-292.el7.i686.rpm: glibc-devel-2.17-292.el7.i686
Package glibc-devel.i686 not installed, cannot update it. Run yum install to install it instead.
Examining glibc-headers-2.17-292.el7.i686.rpm: glibc-headers-2.17-292.el7.i686
Package glibc-headers.i686 not installed, cannot update it. Run yum install to install it instead.
Examining libgcc-4.8.5-44.el7.i686.rpm: libgcc-4.8.5-44.el7.i686
Marking libgcc-4.8.5-44.el7.i686.rpm as an update to libgcc-4.8.5-36.el7.x86_64
Examining libselinux-2.5-15.el7.i686.rpm: libselinux-2.5-15.el7.i686
Marking libselinux-2.5-15.el7.i686.rpm as an update to libselinux-2.5-14.1.el7.x86_64
Examining libsepol-2.5-10.el7.i686.rpm: libsepol-2.5-10.el7.i686
Package libsepol.i686 not installed, cannot update it. Run yum install to install it instead.
Examining libstdc++-4.8.5-44.el7.i686.rpm: libstdc++-4.8.5-44.el7.i686
Marking libstdc++-4.8.5-44.el7.i686.rpm as an update to libstdc++-4.8.5-36.el7.x86_64
Examining nspr-4.25.0-2.el7_9.i686.rpm: nspr-4.25.0-2.el7_9.i686
Marking nspr-4.25.0-2.el7_9.i686.rpm as an update to nspr-4.19.0-1.el7_5.x86_64
Examining nss-softokn-freebl-3.44.0-8.el7_7.i686.rpm: nss-softokn-freebl-3.44.0-8.el7_7.i686
Marking nss-softokn-freebl-3.44.0-8.el7_7.i686.rpm as an update to nss-softokn-freebl-3.36.0-5.el7_5.x86_64
Examining nss-util-3.53.1-1.el7_9.i686.rpm: nss-util-3.53.1-1.el7_9.i686
Marking nss-util-3.53.1-1.el7_9.i686.rpm as an update to nss-util-3.36.0-1.el7_5.x86_64
Examining pcre-8.32-17.el7.i686.rpm: pcre-8.32-17.el7.i686
Package pcre.i686 not installed, cannot update it. Run yum install to install it instead.
Resolving Dependencies
--> Running transaction check
---> Package libgcc.x86_64 0:4.8.5-36.el7 will be updated
--> Processing Dependency: libgcc(x86-64) for package: redhat-lsb-core-4.1-27.el7.centos.1.x86_64
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=<repoid> ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable <repoid>
or
subscription-manager repos --disable=<repoid>
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64
You can upgrade all the packages at the same time, using a command like this one:
sudo rpm -U glibc-2.17-317.el7.x86_64.rpm glibc-common-2.17-317.el7.x86_64.rpm
Or you can use yum update, like this:
sudo yum update --disablerepo="*" *.rpm
This has the advantage that packages not installed are not automatically installed by the upgrade (unless dependencies require it). --disablerepo="*" ensures that yum update does not try to download anything.
jlehtone in forums.centos.org solved my situation. I just needed to write
sudo rpm -i glibc-2.17-292.el7.i686.rpm nss-softokn-freebl-3.44.0-8.el7_7.i686.rpm nspr-4.25.0-2.el7_9.i686.rpm nss-util-3.53.1-1.el7_9.i686.rpm
Link to forums.centos.org

I can't install PHP on AWS EC2

I'm pretty new in AWS, I've tried to install PHP on my virtual machine, but it doesn't works, I get the error:
[root#ip-xxx-xxx-xxx-xxx user]# yum install apache2 libapache2-mod-php5 php5 mysql-
server php5-mysql
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package apache2 available.
No package libapache2-mod-php5 available.
No package php5 available.
No package mysql-server available.
No package php5-mysql available.
Error: Nothing to do
I don't know the reason of this, I already tried the comamnd yum update, but it doesn't help, please help me
PHP5 is quite old and is probably not available anymore in the YUM package manager.
Also I think the tutorial you are using is Debian/Ubuntu based.
Apache2 is called httpd24 in yum for instance.
That would look something like this:
sudo yum install -y httpd24 php72 mysql57-server php72-mysqlnd
Or if you are using the Amazon Linux 2 image, then use this command:
sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2
To find out which specific image you are running:
cat /etc/system-release
Please check out the AWS documentation for an up-to-date tutorial on howto deploy your own LAMP-server:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-lamp-amazon-linux-2.html

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.

installing laravel on EC2 - mbstring issue

I have installed Laravel 5.2 successfully on my Mac machine. But now I am walking through the procedures to install Laravel on AWS.
Once I got the instance running, I installed apache, php and mysql with the following command:
sudo yum install -y httpd24 php56 mysql55-server php56-mysqlnd
The php version is 5.6.17
I then did the following:
composer global require "laravel/installer"
and updated the path: export PATH=$PATH:~/.composer/vendor/bin
when I navigate to /var/www/html and do "laravel new ", the project gets created but I receive an mbstring extension problem. Below is a text dump of what I saw:
laravel new hws3
Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for laravel/framework v5.2.29 -> satisfiable by laravel/framework[v5.2.29].
- laravel/framework v5.2.29 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
I've scoured the internet and only found a solution for Windows. I am using Amazon Linux. Any guidance would be most appreciated.
It seems you have php 5.6 installed.
You need to install mbstring for that particular version of php.
Run sudo yum install php56-mbstring
credits: Alex Andrei answered here
If you want to install Laravel with composer, This is the right answer!
sudo su //to be root
yum install php56-mbstring