Github 403 (connection refused) while installing rvm - github

I am trying to install rvm from the official install page.
Running this is broken:
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
fatal: unable to connect a socket (Connection refused)
Initialized empty Git repository in /home/ghufran/.rvm/src/rvm/.git/
fatal: https://github.com/wayneeseguin/rvm.git/info/refs download error - The requested URL returned error: 403
ERROR: Unable to clone the RVM repository, attempted both git:// and https://
I am using ubuntu 9.1 64 bit.

So after looking into this, i figured out it wasn't related to rvm at all.
The problem was with my network and the port used for git protocol was not open. Opening the port worked for me.

base on the tutorial here
did you install all the development libraries like:
$ sudo apt-get install zlib1g-dev libreadline5-dev libssl-dev
libxml2-dev
??
I just installed rvm successfully following the tutorial I just mentioned on my Ubuntu 11.04 box. and I don't think the version of the OS is a big problem.
beside, there is NO Ubuntu 9.1, it's Ubuntu 9.10, which means released Oct, 2009.

Related

Install PHP 7.4 PDO driver for PostgreSQL on Centos 7.6

I get the error from PDO when trying to connect to PostgreSQL:
Database Connection Error: could not find driver
I ran command to install driver:
yum install php7.4-pgsql
systemctl restart httpd
Still did not work. I found another possible driver:
yum install php72w-pdo
systemctl restart httpd
Still did not work. Checking phpinfo() page does not show PDO driver for PostgreSQL installed, and checking has no output for pgsql.
php -m | grep pgsql
I also tried installing PostgreSQL on the server, but I don't think I need since the connection is remote server. I also tried other tutorials but most are for PHP 5 and not for PHP 7.4. They said use command:
yum install php-pgsql
But this command will give me error for package conflict and list of required:
Error: Package: php-pgsql-5.4.16-48.el7.x86_64 (base)
Requires: php-pdo(x86-64) = 5.4.16-48.el7
Installed: php-pdo-7.4.11-1.el7.remi.x86_64 (#remi-php74)
php-pdo(x86-64) = 7.4.11-1.el7.remi
Available: php-pdo-5.4.16-48.el7.x86_64 (base)
php-pdo(x86-64) = 5.4.16-48.el7
...
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
However, I don't think these options should be necessary for Centos 7.4, PHP 7.4.
I can connect from MacOs development environment, but not from the Centos server.
What should I do to install the driver for PDO PostgreSQL?
Turns out I had multiple versions of PHP enabled.
Here is solution to disable all except for the one you want:
php -v
PHP 7.4.24 (cli) (built: Sep 21 2021 11:23:11) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
Check which version you are running (example 7.4)
yum-config-manager --disable 'remi-php*'
yum-config-manager --enable remi-php74
Then install is easy:
yum install php-pdo_pgsql
systemctl restart httpd

Install icu4c version 63 with Homebrew

I was trying to start psql but got
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
When I used postgres -D /usr/local/var/postgres, got the following error:
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.63.dylib
Referenced from: /usr/local/bin/postgres
Reason: image not found
[1] 2559 abort postgres -D /usr/local/var/postgres
A quick search on libicui18n.63.dylib showed me I need icu4c lib with version 63. However brew list icu4c says I have the version 64.2.
I tried both brew install icu4c 63 & brew install icu4c#63 but no luck.
Can anyone help, please? Thanks in advance.
Solution:
cd to Homebrew's formula directory
Intel
cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
M1
cd $(brew --prefix)/Library/Taps/homebrew/homebrew-core/Formula
Find desired commit (version 63 for icu4c) to checkout
git log --follow icu4c.rb
Checkout to a new branch
git checkout -b icu4c-63 e7f0f10dc63b1dc1061d475f1a61d01b70ef2cb7
Reinstall the library with the new version
brew reinstall ./icu4c.rb
Switch to the reinstalled version
brew switch icu4c 63.1
Checkout back to master
git checkout master
Sources:
Homebrew install specific version of formula?
http://hanxue-it.blogspot.com/2018/08/macos-homebrew-installing-older-version-of-software.html
Bonus for those who ended up using this more than once:
# zsh
function hiicu63() {
local last_dir=$(pwd)
cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
git checkout icu4c-63
brew reinstall ./icu4c.rb
brew switch icu4c 63.1
git checkout master
cd $last_dir
}
Like #dingusjh says, but use reinstall command instead of install in case brew complains about having icu4c installed already and you should try to extract. The complete command would then be:
brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/e7f0f10dc63b1dc1061d475f1a61d01b70ef2cb7/Formula/icu4c.rb
This should be easier.
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/e7f0f10dc63b1dc1061d475f1a61d01b70ef2cb7/Formula/icu4c.rb
For me reinstalling icu4c worked brew reinstall icu4c

How to solve the error of Postgresql Client not installed on Ubuntu 18.04

Just install the Postgresql on Ubuntu 18.04 and having the error of PostgreSQL client
Warning: No existing local cluster is suitable as a default target.
Please see man pg_wrapper(1) how to specify one.
Error: You must install at least one postgresql-client-<version> package
I tried all the solutions that are on the StackOverflow and other forums but not succeed to solve the error
Following are the solutions that I tried
1. psql --cluster 10/apps [other arguments]
when I try the first solution it give me the error
Error: Invalid version 10 specified with --cluster
2. psql -p 5432
3. sudo apt-get install postgresql-client-10
when try the third solution it shows the following
postgresql-client-10 is already the newest version (10.5-0ubuntu0.18.04).
4. gedit ~/.bashrc
PATH=/usr/local/pgsql/bin:$PATH
export PATH
Can someone tell what the exact solution to solve the error.
Your 3rd solution is almost there, make sure to run sudo apt-get install postgresql-10 too.

MongoDB php7 driver installation

I'm working on an Ubuntu 16 server and I can't seem to get the mongodb driver for php 7 to work. I installed it successfully on my xampp on my windows machine but Ubuntu and php7 seemingly have vast differences.
I did try to install it via pecl install mongodb and used composer to put in the dependencies but it still does not work. I'm using the same php file from my windows Xampp and when I access the page it throws a 500 status code.
Could someone provide a definitive walkthrough on how to install this driver and maybe also how to revert any changes I made using composer and pecl?
Cool even I tried with pecl but didn't work as expected. It work with pecl7 Also, I received this warning along with error, WARNING: "pecl/mongo" is deprecated in favor of "channel:///mongodb" pecl/mongo requires PHP (version >= 5.3.0, version <= 5.99.99), installed version is 7.1.8. Also, got 500 Internal server error.
Before that MongoDB php7 driver, I needed the memcache and getting phphize error that I solved using this repo. Then finally I use this low level PHP driver for MongoDB.
$ git clone https://github.com/mongodb/mongo-php-driver.git
$ cd mongo-php-driver
$ git submodule sync && git submodule update --init
$ /usr/bin/phpize
$ ./configure
$ make all -j 5
$ sudo make install
You can confirm from the output that mongodb.so driver is installed.
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
extension=mongodb.so
Then only step remaining is make it available in your respective path. You can check your extensions_dir in php.ini with the following command,
$ php -i | grep extension_dir
extension_dir => /usr/lib64/php/7.0/modules => /usr/lib64/php/7.0/modules
And, I can verify that mongodb.so is present into the above directory. Then reload the composer and you are good to go ! Hope this helps as it work for me.

centos yum fails installing anything or updating system

I am trying to install a package on CentOS, but it throws error when I run the "yum" command. The internet connection is working fine.
I try to yum clean all but problem persist.
Error:
[root#dcos-master3 ~]# yum install ntp
Loaded plugins: fastestmirror
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/$releasever/x86_64
My yum repolist is the next:
[root#dcos-master3 ~]# yum repolist list
Loaded plugins: fastestmirror
https://yum.dockerproject.org/repo/main/centos/%24releasever/repodata/repomd.xml: [Errno 14] HTTPS Error 403 - Forbidden
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/solutions/69319
If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/
repolist: 0
If I list the repolist:
[root#dcos-master3 ~]# yum repolist
Loaded plugins: fastestmirror
https://yum.dockerproject.org/repo/main/centos/%24releasever/repodata/repomd.xml: [Errno 14] HTTPS Error 403 - Forbidden
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/solutions/69319
If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/
repo id repo name status
base/$releasever/x86_64 CentOS-$releasever - Base 0
dockerrepo/$releasever Docker Repository 0
extras/$releasever/x86_64 CentOS-$releasever - Extras 0
updates/$releasever/x86_64 CentOS-$releasever - Updates 0
repolist: 0
BEFORE TRYING ANY OF THIS, HAVE A BACKUP OF YOUR MACHINE, YOU COULD DAMAGE YOUR OS MORE/COMPLETELY
It seems that your yum variable $releasever is somehow corrupt,
it usually is caused by missing centos-release package on the machine for some obscure reasons.
You can check if you have the package by:
rpm -qi centos-release
You will probably see:
"package centos-release is not installed"
First find out the exact centos version that you have by executing as root:
cat /etc/redhat-release
You will see something like this:
CentOS Linux release 7.3.1611 (Core)
You can fetch the centos-release package from repo by:
wget http://vault.centos.org/centos/7.3.1611/updates/x86_64/Packages/centos-release-7-3.1611.el7.centos.2.5.x86_64.rpm
Now run reinstall centos-release package via rpm:
sudo rpm -Uvh --replacepkgs centos-release-7-3.1611.el7.centos.2.5.x86_64.rpm
As next you can try to install something with yum and you might get:
[root#dcos-master3 ikerlan]# sudo yum install wget
error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
error: cannot open Packages index using db5 - (-30969)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
Now you can try to reboot the machine or try to use the following command to rebuild the rpm db:
rpm --rebuilddb
I came across the same issue while downloading some packages in centos 7. After days of search, I found the solution:
Go to the yum repo directory.
cd /etc/yum.repos.d.
Make a copy of the CentOS-Base.repo file.
cp CentOS-Base.repo CentOS-Base.repo.old
Edit the CentOS-Base.repo file. Comment mirrorlist and uncomment baseurl.
vi CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Now when you use yum, do the following.
sudo yum --disablerepo=* --enablerepo=base install httpd
Likewise for yum update.
sudo yum --disablerepo=* --enablerepo=base install httpd
It should work now.
I ran into this problem when attempting to install MariaDB on CentOS 7. I was super frustrated and after much searching found the answer at this link.
Here is what fixed this problem for me. Run as root.
# yum --disablerepo "*" --enablerepo epel install [package]
# yum clean all
"epel" can be whatever repo you like, but this one worked for me. Place [package] in the command just as written, not what package you are trying to install.
After you run the above, exit root and run whatever install you were attempting before encountering the error.
I noticed that in the failing url, your $releasever is %24releasever, but it should be 7 or 7.14.xx. Please check your yum config file at /etc/yum/var, or search in every .repo file, to see what is its value. It may be corrupted.
See Red Hat documentation for more information about how to set these variables.
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-using_yum_variables
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
yum -y install yum-utils
yum-config-manager --enable remi-php74
Then proceed to your installation/updates/etc
Always make sure NAT is active on your centos7. Specially when there is a VMnet2 for host. Because sometimes VMNet2 can be active instead of NAT and because of that you will not be able to connect to the internet through centos7. This is just a one reason for getting that error.