how do I install python2 on centos 9 stream? - centos

I am trying to figure out how to install python2 on centos9 stream. I am getting the errors below. Any suggestions?
sudo dnf install python2
Last metadata expiration check: 0:04:48 ago on Thu 24 Feb 2022 01:43:10 PM EST.
No match for argument: python2
Error: Unable to find a match: python2

how to install python2 on centos9 stream
You cannot do that from any repo. No available repo / no packages.
Reason: python2.7 had End Of Life two years ago.

Yes, you can, using this method:
If you cannot find a package for your distribution (and you probably should be able to), you can download a single-file executable "AppImage" containing Python 2.7 and the standard library. Just download the file, make it executable, rename it "python2" or create a symlink of that name pointing to the AppImage file, and put it in /usr/local/bin/, and getmail will happily run with it.
For example, on an x86_64 Linux system, you could:
wget https://github.com/niess/python-appimage/releases/download/python2.7/python2.7.18-cp27-cp27m-manylinux1_x86_64.AppImage
sudo install -m 755 python2.7.18-cp27-cp27m-manylinux1_x86_64.AppImage /usr/local/bin/
sudo ln -sr /usr/local/bin/python2.7.18-cp27-cp27m-manylinux1_x86_64.AppImage /usr/local/bin/python2
Source: https://pyropus.ca/software/getmail/documentation.html#python3

Related

Installing Vivado ML 2021.2 in CentOs but process is hang in 'Generating installed device list'

anybody can help me figure out why the installation is hanging on 'Generating installed device list' and how to solve it without starting the process all over. I am working on CentOs.
Thanks in advance
I think this happens due to following missing packages:
libstdc++6:i386
libgtk2.0-0:i386
dpkg-dev:i386
ncurses5-compat-libs
python3-pip
libtinfo5
libncurses5
As BKN mentioned, you need to install the missing packages.
To avoid starting all over again, you can do the following:
Check the log: cat ~/.Xilinx/xinstall/*.log
Locate the error message. It should look something like:
2022-01-09 10:53:11,458 DEBUG: n.t:? - Executing script Generating installed device list: /tools/Xilinx/Vivado/2021.2/bin/vivado [-nolog, -nojournal, -mode, batch, -source, /tools/Xilinx/Vivado/2021.2/scripts/sysgen/tcl/xlpartinfo.tcl, -tclargs, /tools/Xilinx/Vivado/2021.2/data/parts/installed_devices.txt]
2022-01-09 12:05:35,319 DEBUG: n.t:? - Unable to run GenerateDevListFileLin, exit code: 130, stdout: , stderr: application-specific initialization failed: couldn't load file "librdi_commontasks.so": libtinfo.so.5: cannot open shared object file: No such file or directory failure msg:
application-specific initialization failed: couldn't load file "librdi_commontasks.so": libtinfo.so.5: cannot open shared object file: No such file or directory
2022-01-09 12:05:35,319 DEBUG: n.t:? - Executing script Generating installed device list for Model Composer: /tools/Xilinx/Vivado/2021.2/bin/vivado [-nolog, -nojournal, -mode, batch, -source, /tools/Xilinx/Model_Composer/2021.2/data/xmcGenBoardParts.tcl, -tclargs, /tools/Xilinx/Model_Composer/2021.2/../../Vivado/2021.2, librdi_dsp_tcltasks.so, /tools/Xilinx/Model_Composer/2021.2/data]
The log informs you exactly what the missing package is (in this case it was libtinfo), and also provides you with the script to run after you install the package:
/tools/Xilinx/Vivado/2021.2/bin/vivado -nolog -nojournal -mode batch -source /tools/Xilinx/Vivado/2021.2/scripts/sysgen/tcl/xlpartinfo.tcl -tclargs /tools/Xilinx/Vivado/2021.2/data/parts/installed_devices.txt
Notes:
Make sure to use the Vivado version (here it was 2021.2) and location (here it was /tools/Xilinx) according to your system.
You may need to run the script in sudo if the the permissions for writing are not available in user mode.
I also encounterd this problem on Archlinux with Vivado 2018.3.
But I just installed the library ncurses5-compat-libs, then the problem is solved.
Perhaps you can solve this by checking the library ncurses5-compat-libs.
Download the tar package instead of the self-extracting bin package
Update the java and python version
sudo apt-get install -y python3-pip
Install Dependencies
sudo apt-get install -y libstdc++6
sudo apt-get install -y libgtk2.0-0
sudo apt-get install -y dpkg-dev
NOTE: Without ibtinfo5 the application will not start and without libncurses5 the simulation will fail
`sudo apt-get install -y libtinfo5 libncurses5`
Restart the system
Untar that Vivado package
tar -xzvf Xilinx_Unified_2021.2_1021_0703.tar.gz
Locate the xsetup file in the package
Install the package in batch mode
./xsetup --agree 3rdPartyEULA,XilinxEULA --batch Install --product "Vivado" --edition "Vivado ML Enterprise" --location "/home/USER"
Once the installation has been successfully completed
Locate the settings64.sh file
./settings64.sh
Locate the cable drivers
cd Vivado/2021.2/data/xicom/cable_drivers/lin64/install_scripts/install_drivers
./install_drivers
Installing Vivado Board Files
Get the board package from the git https://github.com/Digilent/vivado-boards.git
From the vivado-board-master package copy the folder board_files undert /vivado-board-master/new/board_files
Paste the board files to Vivado/2021.2/data/boards
From the vivado-board-master package copy the file Vivado_init.tcl under /vivado-board-master/utility
Paste the file Vivado_init.tcl to the Vivado installation
That's it!! You might not need to do all these steps but that is what I ended up doing and it worked for the two machines where I installed Vivado. The installation took less than one hour.
This was originally edited into the question itself by the OP.

How to build and install wal2json without also installing the package postgresql-server-dev on Debian 9?

I'm trying to stream data automatically from PostgreSQL 10 to Kafka using debezium together with the logical decoding plugin, wal2json.
I followed all the instructions on how to build and install the plugin from this link by running these command lines:
$ git clone https://github.com/eulerto/wal2json.git
$ cd wal2json
$ PATH=/usr/lib/postgresql/10/bin:$PATH
$ USE_PGXS=1 make
$ USE_PGXS=1 sudo make install
Yet, the steps for installation include this command line: USE_PGXS=1 make and it requires the installation of this package
sudo apt-get install postgresql-server-dev-10
else, I get the following error
Makefile:10: /usr/lib/postgresql/11/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory
make: *** No rule to make target '/usr/lib/postgresql/11/lib/pgxs/src/makefiles/pgxs.mk'. Stop.
In fact, I am not allowed to install the package postgresql-server-dev-10 for personal reasons.
Thus, is there any way to install wal2json without installing that package or without using the command make?
Thank you.

CPP-REST-SDK in Centos 7

I have a CentOS 7 (EPEL-Repo is registered) but I do not find the package for CPP-REST (libcpprest-dev in Debian) in the repos.
Do I need to install it from vanilla or is there a package in CentOS?
Thanks!
Short answer...
There is not an "official" CentOS 7 package at this time (2018-10-03) for cpprestsdk (libcpprest-dev in Debian).
Long answer (sharing this in case it helps anyone)...
You could build cpprestsdk from source, but the instructions "How to build for Linux" (https://github.com/Microsoft/cpprestsdk/wiki/How-to-build-for-Linux) do not include CentOS or RHEL (at the time of this writing, 2018-10-03).
Before building cpprestsdk on CentOS 7, you'll need to update boost (at time of this writing CentOS 7 repos have boost 1.53, but 1.54 is required, and 1.68 is latest). You can do this to update (using boost 1.68 as example):
cd && wget https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
tar -xzvf boost_1_68_0.tar.gz
cd ~/boost_1_68_0
./bootstrap.sh --prefix=/opt/boost
sudo ./b2 install --prefix=/opt/boost --with=all
After updating boost, I was able to build cpprestsdk on CentOS 7 like this...
Install some needed tools/libraries:
sudo yum -y install git cmake3 openssl-devel gcc-c++ make
Download the cpprestsdk project:
git clone https://github.com/Microsoft/cpprestsdk.git casablanca
cpprestsdk wants to treat warnings as errors. I had to turn this off by commenting out this line in ~/casablanca/Release/CMakeLists.txt:
#set(WERROR ON CACHE BOOL "Treat Warnings as Errors.")
Prepare/build cpprestsdk project:
cd casablanca/Release
mkdir build.release && cd build.release
cmake3 .. -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=/opt/boost
make
Install header files and library
sudo make install
Notice that I am calling cmake3 (not cmake) and I am specifying the boost root; which differs from the official instructions that appear to be written and tested for Ubuntu (not CentOS or RHEL). To build my projects using cpprestsdk, I had to use ldconfig to find the library paths.

Linux: How to install DBD::Pg module?

Postgres DB is already installed. I'm not using system perl I have installed another perl in "/srv/data203806/Migration/CPAN/localperl/bin". When I'm trying to install, It is asking for PATH TO pg_config:
[root1#frmrszvwb023 bin]# ./cpan install DBD::Pg
Reading '/root/.cpan/Metadata'
Database was generated on Fri, 07 Mar 2014 03:53:02 GMT
Running install for module 'DBD::Pg'
Running make for T/TU/TURNSTEP/DBD-Pg-3.0.0.tar.gz
Checksum for /root/.cpan/sources/authors/id/T/TU/TURNSTEP/DBD-Pg-3.0.0.tar.gz ok
CPAN.pm: Building T/TU/TURNSTEP/DBD-Pg-3.0.0.tar.gz
Configuring DBD::Pg 3.0.0
Path to pg_config?
No POSTGRES_HOME defined, cannot find automatically
Warning: No success on command[/srv/data203806/MUXmh-Migration/CPAN/localperl/bin/perl Makefile.PL]
'YAML' not installed, will not store persistent state
TURNSTEP/DBD-Pg-3.0.0.tar.gz
/srv/data203806/MUXmh-Migration/CPAN/localperl/bin/perl Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites
Please help me to install DBD::Pg? How to get path to pg_config?
Just ran into this issue, and on Ubuntu 16.04 Xenial the package you're looking for is:
apt-get install libdbd-pg-perl
You have to install libpq-dev, e.g. on Ubuntu:
sudo apt-get install libpq-dev
On CentOS/RH you can fix it by installing perl-DBD-Pg package with yum
sudo yum install perl-DBD-Pg
From the README:
INSTALLATION:
Before installing, please use the "cpansign -v" program to
cryptographically verify that your copy of DBD::Pg is complete and
valid. The program "cpansign" is part of Module::Signature, available
from CPAN.
By default Makefile.PL uses App::Info to find the location of the
PostgreSQL library and include directories. However, if you want to
control it yourself, define the environment variables POSTGRES_INCLUDE
and POSTGRES_LIB, or define just POSTGRES_HOME. Note that if you have
compiled PostgreSQL with SSL support, you must define the POSTGRES_LIB
environment variable and add "-lssl" and "-lcrypto" to it, like this:
export POSTGRES_LIB="/usr/local/pgsql/lib -lssl -lcrypto"
The usual steps to install DBD::Pg:
perl Makefile.PL
make
make test
make install
Do steps 1 to 2 as a normal user, not as root!
If the script cannot find the pg_config information itself, it will
ask you for the path to it. Enter the complete path to the pg_config
file here, including the name of the file itself.
If you want to use a module, read the documentation.
Before installing perl module, you must install client for accessing Postgres DB. I just install server and header files:
sudo apt-get install postgresql
sudo apt-get install libpq-dev
You can try:
locate pg_config
This will show something like:
/usr/pgsql-10/bin/pg_config
/usr/pgsql-10/include/ecpg_config.h
/usr/pgsql-10/include/ecpg_config_x86_64.h
Then run:
POSTGRES_HOME=/usr/pgsql-10 ./cpan install DBD::Pg
UPD
If you still encounter issues with pg_config, you may need to add it to your PATH, e.g.:
export PATH=$PATH:/usr/pgsql-x.x/bin
where x.x is your version, such as /usr/pgsql-9.2./bin.
Fedora 29, plenv, perl v5.18.0
Once I got plenv working, I was able to install DBD::Pg with cpanm using these commands:
sudo dnf install postgresql postgresql-devel
cpanm --quiet --notest DBD::Pg
For ArchLinux (or any Distro using Pacman):
pacman -S perl-dbd-pg
For my Ubuntu 22 worked this:
sudo apt install build-essential
sudo apt install cpanminus
sudo apt-get install -y postgresql-server-dev-all
sudo cpanm DBD::Pg

Perl Ora2Pg on Ubuntu

I just tried Ora2Pg on my Ubuntu Jaunty Jackalope.
First of all, the installation was hard, but after downloading a few debs & rpms here & there, I was finally managed to install ora2pg via synaptic.
However, when I try to run this command
ora2pg /tmp/ora2pg.conf
I am getting a
install_driver(Oracle) failed: Can't load '/usr/lib/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.10.1: cannot open shared object file: No such file or directory at /usr/lib/perl/5.10/DynaLoader.pm line 196.
at (eval 14) line 3
Compilation failed in require at (eval 14) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /usr/share/perl5/Ora2Pg.pm line 566
Any ideas what's wrong and how to fix it?
Note: I don't perl. I just started browsing a bit it because of this.
This is the correct sequence for installation:
apt-get install libdbi-perl
apt-get install alien dpkg-dev debhelper build-essential
apt-get install libaio1
apt-get install make
apt-get install alien
apt-get install rpm
apt-get install libpq-dev
download DBD-Oracle-1.74 or last version
download DBD-Pg-3.5.3 or last version
download DBI-1.636 or last version
download ora2pg-17.5 or last version
download oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
download oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
download oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
after extract rpm package and install:
alien oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
alien oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
alien oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
dpkg -i oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.deb
dpkg -i oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb
dpkg -i oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.deb
then:
export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib
the path of oracle client installation
export ORACLE_HOME=/usr/lib/oracle/12.1/client64/
then, istall the perl extension for Oracle and Postgres
cd DBI-1.636
perl Makefile.PL
make && makeinstall
cd DBD-Oracle-1.74 o DBD-Oracle-1.64
perl Makefile.PL
make && makeinstall
cd DBD-Pg-3.5.3
perl Makefile.PL
make && makeinstall
and finally, install
cd ora2pg-17.x
perl Makefile.PL
make && makeinstall
check in the version is correct
ora2pg -v
and last configure ora2pg.conf on /etc/ora2pg/
insert in file, the configuration for connect to Oracle and Postgres.
DBD::Oracle can't find the Oracle client libraries because they're not in your library path. If you don't have the Oracle client libraries and you don't have a sysadmin to provide them for you, then you need to get the "Oracle Instantclient" package from the oracle website and install it. If you already have Instantclient installed, then you need to add its lib directory (something like /usr/lib/oracle/instantclient/lib or /opt/ora/instantclient10_1/lib) to your library path -- either by adding a line to /etc/ld.so.conf and running ldconfig as root, or by setting the LD_LIBRARY_PATH environment variable.
Pre-installation steps:
ORACLE Client must be installed and ORACLE_HOME must be set.
Install perl (version 5.6 and above)
Installation steps:
Install DBI (database interface module)
apt-get install cpanminus (for ubuntu)
yum install cpanminus (for Linux)
cpanm DBI
Install DBD::Oracle and DBD::Pg
cpanm DBD::Oracle
cpanm DBD::Pg
Download the latest version of ora2pg from http://sourceforge.net/projects/ora2pg/ and run the following commands:
tar -xvf ora2pg-18.0.tar
cd ora2pg-18.0/
perl Makefile.PL
su root
make
make install
Do the changes as per req
By default Ora2Pg will look to ora2pg.conf configuration file into /etc/ora2pg/ directory.
ORACLE_HOME /app/oracle/product/11.2.0
ORACLE_DSN dbi:Oracle:host=[hostname];sid=[SID name]
ORACLE_USER [SYSTEM]
ORACLE_PWD [password]
USER_GRANTS 1
Check the version of pra2pg:
ora2pg SHOW_VERSION
Run the below command
ora2pg -c /etc/ora2pg/ora2pg.conf
ora2pg -c /etc/ora2pg/ora2pg.conf -p -P 10 -J 10 -L 1000000
.sql file will create in the current directory have converted data into PostgreSql
Hope this will work.