What happen to Centos version - centos

I have a Centos server.
result
$ cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
and
$ yum list installed
zip.x86_64 3.0-1.el6_7-1 #anaconda-CentOS-201703281317.x86_64/6.9
zlip.x86_64 1.2.3-29.el6 #anaconda-CentOS-201703281317.x86_64/6.9
........... ............ ........................................
zlip-devel.x86_64 1.2.3-29.el6 #anaconda-CentOS-201703281317.x86_64/6.9
All are packages of el6. My server is offline server and i install packages from private registry.
Now i can install packages for el6 but not for el7.

You can download the EPEL RPM and the other packages on another machine:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -P ~/Downloads
wget https://centos.pkgs.org/7/centos-x86_64/zip-3.0-11.el7.x86_64.rpm -P ~/Downloads
wget https://centos.pkgs.org/7/centos-updates-x86_64/zlib-1.2.7-19.el7_9.x86_64.rpm -P ~/Downloads
wget https://centos.pkgs.org/7/centos-updates-x86_64/zlib-devel-1.2.7-19.el7_9.x86_64.rpm -P ~/Downloads
...and then "sneakernet" them to your server (I would verify the hashes (https://getfedora.org/security/)). You also need to make sure that /usr/sbin/ldconfig, /lib64/libc.so.6, and rtld (from glibc-2.17) are on your system.
Once the RPM is verified, you can install them:
sudo yum install ~/Downloads/epel-release-latest-7.noarch.rpm
sudo yum install ~/Downloads/zip-3.0-11.el7.x86_64.rpm
sudo yum install ~/Downloads/zlib-1.2.7-19.el7_9.x86_64.rpm
sudo yum install ~/Downloads/zlib-devel-1.2.7-19.el7_9.x86_64.rpm

Related

Try to install snapd but giving `conflicting requests` error

I am trying to install snapd but giving this error.
Operating System - Red Hat Enterprise Linux release 8.6 (Ootpa)
Error:
Problem: package snapd-2.57.6-2.el8.x86_64 requires snapd-selinux = 2.57.6-2.el8, but none of the providers can be installed
- conflicting requests
- nothing provides selinux-policy >= 3.14.3-108.el8 needed by snapd-selinux-2.57.6-2.el8.noarch
- nothing provides selinux-policy-base >= 3.14.3-108.el8 needed by snapd-selinux-2.57.6-2.el8.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
I have the same problem. There's a long discussion about this here: https://forum.snapcraft.io/t/trouble-installing-snapd-on-rhel-8/13140/2. It looks like the only way to do it, if you can install all the necessary build tools, is to build from sources, as one of the posts there suggests.(I couldn't do it on my system because it's having subscription management issues.)
I also tried using CR repository, as suggested in the instructions for CentOS here: https://snapcraft.io/docs/installing-snap-on-centos, but that didn't work for me, either (I guess it's really just for CentOS and not RHEL).
UPDATE:
I finally found a solution (where there's a will...)! I manually installed all the requirements, one by one, that weren't available in the epel-release repo. My process was the following:
wget https://rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/rpm-4.14.3-19.el8.x86_64.rpm
wget https://rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/rpm-libs-4.14.3-19.el8.x86_64.rpm
wget https://dl.rockylinux.org/pub/rocky/8/BaseOS/aarch64/os/Packages/s/selinux-policy-3.14.3-108.el8.noarch.rpm
sudo yum install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/libsemanage-2.9-9.el8.x86_64.rpm --allowerasing -y
sudo yum install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/policycoreutils-2.9-19.el8.x86_64.rpm -y
sudo rpm -i --force rpm-4.14.3-19.el8.x86_64.rpm
sudo rpm -i --force rpm-libs-4.14.3-19.el8.x86_64.rpm
sudo rpm -i --force selinux-policy-3.14.3-108.el8.noarch.rpm
sudo yum install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/python3-libsemanage-2.9-9.el8.x86_64.rpm -y
sudo yum install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/python3-policycoreutils-2.9-19.el8.noarch.rpm -y
sudo yum install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/policycoreutils-python-utils-2.9-19.el8.noarch.rpm -y
sudo yum install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/selinux-policy-minimum-3.14.3-108.el8.noarch.rpm -y
sudo yum install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/libseccomp-2.5.2-1.el8.x86_64.rpm -y
sudo yum install https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/s/snapd-selinux-2.57.6-2.el8.noarch.rpm -y
sudo yum install snapd -y
sudo yum update snapd -y
It's conceivable that on your system something else will be missing. If you run into an error telling you that nothing provides package XYZ, you can find it here: https://centos.pkgs.org/8-stream/centos-baseos-x86_64/ and simply sudo yum install directly from the binary package URL; e.g.:
That's exactly what my process was, and here's what I have now:
$ cat /etc/redhat-release (base)
Red Hat Enterprise Linux release 8.2 (Ootpa)
$ snap --version (base)
snap 2.57.6-2.el8
snapd 2.52.1
series 16
rhel 8.2
kernel 4.18.0-193.6.3.el8_2.x86_64

Installing PostgreSQL Client v10 on AWS Amazon Linux (EC2) AMI

I have successfully launched new AWS RDS PostgreSQL v10 instance and need to install PostgreSQL v10 client on Amazon Linux EC2 instance.
I have tried to install it with yum, but it cant find the package for v10:
[ec2-user#ip-X-X-X-X ~]$ sudo yum install -y postgresql10
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00:00
amzn-updates | 2.5 kB 00:00:00
No package postgresql110 available.
Error: Nothing to do
Previously I managed to install PostgreSQL client v9.5 with:
[ec2-user#ip-X-X-X-X ~]$ sudo yum install -y postgresql95
I guess I need to add Postgres yum repository, as mentioned in https://www.postgresql.org/download/linux/redhat/. But what Platform should I choose for Amazon Linux? Red Hat?
You can try to run the following command on your Linux server:
sudo amazon-linux-extras install postgresql10
Packages/Repos which is designed to work of RedHat will work on Amazon Linux also, Amazon Linux is a minimal-install version of RHEL. You may run into compatibility issues if you select old version of Amazon Linux (Amazon linux 1) for the below steps, otherwise it should work fine in the latest version Amazon Linux 2.
Check Amazon Linux version
[ec2-user ~]$ cat /etc/system-release
Amazon Linux release 2.0 (2017.12) LTS Release Candidate
Install RHEL 7 yum repo for PostgreSQL
[ec2-user ~]$ sudo yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-redhat10-10-2.noarch.rpm
[ec2-user ~]$ sudo sed -i "s/rhel-\$releasever-\$basearch/rhel-latest-x86_64/g" "/etc/yum.repos.d/pgdg-10-redhat.repo"
Install PostgreSQL Client v10
[ec2-user ~]$ sudo yum install -y postgresql10
[ec2-user ~]$ psql --version
psql (PostgreSQL) 10.3
Read more about Amazon Linux 2
Note! Amazon Linux 2 provides additional package installation through Amazon Linux Extras Repository (amazon-linux-extras) ((client only)). Since postgresql10 is not yet available, adding extra yum repo is the only solution per today.
UDATE 2019May
those who see
Error: Package: pgdg-redhat-repo-42.0-4.noarch
(/pgdg-redhat-repo-latest.noarch)
Requires: /etc/redhat-release
may still install step by step all dependencies and the server with:
yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-latest-x86_64/postgresql10-libs-10.7-2PGDG.rhel7.x86_64.rpm
yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-latest-x86_64/postgresql10-10.7-2PGDG.rhel7.x86_64.rpm
yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-latest-x86_64/postgresql10-server-10.7-2PGDG.rhel7.x86_64.rpm
Since none of the previous answers worked for me, I'm adding a solution that let me install the postgresql10 client. We're using VERSION="2018.03" of Amazon Linux AMI in our pipelines.
Building from source:
Note: The link below points to postgresql 10.4, you may want to check for newer subversions
sudo yum install -y gcc readline-devel zlib-devel
wget https://ftp.postgresql.org/pub/source/v10.4/postgresql-10.4.tar.gz
tar -xf postgresql-10.4.tar.gz
cd postgresql-10.4
./configure
make -C src/bin
sudo make -C src/bin install
make -C src/include
sudo make -C src/include install
make -C src/interfaces
sudo make -C src/interfaces install
make -C doc
sudo make -C doc install
The new package should be installed with all its executables in here: /usr/local/pgsql/bin
Now, keep in mind that commands psql, pg_dump etc. still point to the old version of the psql client. You can run with the full executable paths (/usr/local/pgsql/bin/psql) or prepend the new directory at the beginning of your $PATH so that the system will look it up first:
Edit ~/.bash_profile adding this at the end:
export PATH="/usr/local/pgsql/bin:$PATH"
Then run:
source ~/.bash_profile
Now everything should be ready:
[ec2-user#ip-xx-x-x-xxx ~]$ psql --version
psql (PostgreSQL) 10.4
Adapting Haneef Mohammed's answer for Amazon Linux 1 (tested on 2018.03):
Go to the Postgres repositories page and grab the URL for 'Red Hat Enterprise Linux 6 - x86_64'. Install the PG repos and amend the entries, replacing '$releasever' with '6.9' (or newer?):
[ec2-user ~]$ sudo yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-x86_64/pgdg-redhat10-10-2.noarch.rpm
[ec2-user ~]$ sudo sed -i "s/rhel-\$releasever-\$basearch/rhel-6.9-x86_64/g" "/etc/yum.repos.d/pgdg-10-redhat.repo"
Second part is the same:
[ec2-user ~]$ sudo yum install -y postgresql10
[ec2-user ~]$ psql --version
psql (PostgreSQL) 10.3
PGDG repo is no longer available for Amazon Linux. So you can use amazon repo.
amazon-linux-extras install postgresql10 vim epel -y
Or follow this article
https://installvirtual.com/install-postgresql-10-on-amazon-ec2/
As of May 25th, 2019, the following direct RPM installation worked for me on Amazon Linux 1 2018.03 (latest Beanstalk platform version) to install PostgreSQL Client 10.7:
sudo rpm -ivh --force https://yum.postgresql.org/testing/10/redhat/rhel-6-x86_64/postgresql10-libs-10.7-2PGDG.rhel6.x86_64.rpm
sudo rpm -ivh --force https://yum.postgresql.org/testing/10/redhat/rhel-6-x86_64/postgresql10-10.7-2PGDG.rhel6.x86_64.rpm
PSql10.7 installation (08/20/2019)
Remove all of the older version Psql client and perform the below steps:
wget https://yum.postgresql.org/10/redhat/rhel-6.9-x86_64/postgresql10-libs-10.7-1PGDG.rhel6.x86_64.rpm
wget https://yum.postgresql.org/10/redhat/rhel-6.9-x86_64/postgresql10-10.7-1PGDG.rhel6.x86_64.rpm
sudo rpm -ivh postgresql10-libs-10.7-1PGDG.rhel6.x86_64.rpm
sudo rpm -ivh postgresql10-10.7-1PGDG.rhel6.x86_64.rpm
This my 2019 solution:
Just do
sudo amazon-linux-extras install postgresql9.6
You should not have to download it from any outside source, since it is already given to you by default from Amazon, all you have to do is install it.
The other solutions didnt work for me and I spent a good amount time banging my head against the wall trying to figure out why.
And surprisingly even though you install psql9.6 you get version 10.
The following works for psql v11 on Amazon Linux (v1)
wget https://yum.postgresql.org/11/redhat/rhel-6.9-x86_64/postgresql11-libs-11.8-1PGDG.rhel6.x86_64.rpm
wget https://yum.postgresql.org/11/redhat/rhel-6.9-x86_64/postgresql11-11.8-1PGDG.rhel6.x86_64.rpm
sudo yum clean all
sudo rpm -ivh postgresql11-libs-11.8-1PGDG.rhel6.x86_64.rpm
sudo rpm -ivh postgresql11-11.8-1PGDG.rhel6.x86_64.rpm
The way I resolved the issue was by running
yum clean all
before
yum install -y postgresql10
on Amazon Linux
for v11 on Amazon Linux 2 I had to do
yum -y install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm
sed -i "s/rhel-\$releasever-\$basearch/rhel-7-x86_64/g" "/etc/yum.repos.d/pgdg-11-centos.repo"

How to upgrade OpenSSH on Centos

I'm using Centos 6 and openssh 5.3 and I want to upgrade to openssh 7 but I don't know how.
I have tried using google but have not found out how.
To update OpenSSH to the latest version that the CentOS repository has, run the following command:
su -c 'yum update'
This will perform a full system update. At the prompt (from the su part), enter your root password
For future reference, you may find the Unix & Linux Stack Exchange site to also be of use.
yum groupinstall "Development Tools"
yum install zlib-devel openssl-devel
cp /etc/ssh/sshd_config /etc/ssh/sshd_config
wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.0p1.tar.gz
tar -xzf openssh-9.0p1.tar.gz
cd openssh-9.0p1/
yum install pam-devel libselinux-devel
./configure --with-pam --with-selinux --with-privsep-path=/var/lib/sshd/ --sysconfdir=/etc/ssh
make
make install
ssh -V

Can't access exe symlinks in centos 6.6 on docker

I'm trying to access the /proc/< pid >/exe symlink on centos 6.6 but i'm geting
ls: cannot access /proc/57/exe: Permission denied
My Dockerfile is
FROM centos:6
# install base packages
RUN yum -y update
RUN yum -y groupinstall "Development Tools"
RUN yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite- devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
RUN yum -y install wget
RUN wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
RUN yum -y install tar
RUN tar -xf Python-2.7.6.tar.xz
RUN cd Python-2.7.6 && ./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
RUN cd Python-2.7.6 && make
RUN cd Python-2.7.6 && make altinstall
# First get the setup script for Setuptools:
RUN wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
# Then install it for Python 2.7 and/or Python 3.3:
RUN python2.7 ez_setup.py
# Now install pip using the newly installed setuptools:
RUN easy_install-2.7 pip
#lxml
RUN yum -y install python-devel libxml2-devel libxslt-devel
RUN pip install lxml
RUN pip install pytest
RUN yum install -y gcc-c++
RUN pip install protobuf
RUN yum install -y rpm-build
This happens for any process.
Thanks in advance.

Installation of bioperl in Ubuntu 12.04LS

I am trying to install Bioperl package in Perl environment of version 5.20.0,
But I am unable to get in to the stuffs.
Idea and suggestion of websites varies and its going to be uneasy for me.
Please suggest me the protocols for installing Bioperl in Ubuntu 12.04LS.
Source: http://www.bioperl.org/wiki/Installing_BioPerl_on_Ubuntu_Server
Install and Configure a Basic Ubuntu Server
Do install then configure.
apt-get clean
apt-get update
apt-get upgrade
apt-get install ssh screen
apt-get clean
Install as much as possible with apt-get
Enable Universe and Multiverse in /etc/apt/sources.list
apt-get update
apt-get install \
lynx unzip zip ncftp gcc libc6-dev make mysql-server apache2 \
perl libgd-gd2-perl libcgi-session-perl libclass-base-perl libexpat1-dev
apt-get clean
Install CPAN and perl modules not available via apt-get
cpan -i 'Text::Shellwords' # choose defaults if first time
Install BioPerl
cd /tmp
wget -N http://bioperl.org/DIST/current_core_unstable.tar.bz2
tar -xjvf current_core_unstable.tar.bz2
cd bioperl-*
perl Build.PL # choose the defaults
./Build test
./Build install