Install icu4c version 63 with Homebrew - postgresql

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

Related

Warning: No available formula with the name "mongodb-community#6.0"

Trying to install mongodb server on my mac using Brew but getting this error.
Updated my brew to latest version, still egtting this error.
Command i used:
brew install mongodb-community#6.0
I figured it out myself. Here is the solution which I found out. I am using mac os on intel processor.
I first run
rm -fr $(brew --repo homebrew/core)
then
brew tap homebrew/core
then
brew tap mongodb/brew
then installed it
brew install mongodb-community#6.0
This worked for me.

Error while adding dependencies in order to install apache age

In order to install Apache age from source,
i am installing development files for PostgreSQL server-side programming. For this i am using following command on my Ubuntu OS.
sudo apt install postgresql-server-dev-11
But i am getting this error "Unable to locate package postgresql-server-dev-11"
image of the error
i am searching online but did not find yet.It would be great if someone help.
This is because you do not have the correct Ubuntu version and the package does not exist.
To determine the major PostgreSQL version in a given release of Ubuntu find it here in Ubuntu Packages
18.04 has PostgreSQL 10 (postgresql-server-dev-10)
19.04 has PostgreSQL 11 (postgresql-server-dev-11)
20.04 has PostgreSQL 12 (postgresql-server-dev-12)
If you have ubuntu 19.04 you can follow this guide
In the case there is no maintainer for the Version of PostgreSQL you are trying to install you have to build from source.
Download your PostgreSQL version source code. Then run these commands.
tar xf postgresql-version.tar.bz2
cd postgresql-version
Install dependencies. Then run the following.
./configure
make
su
make install
adduser postgres
mkdir -p /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
Reference from Official Docs
Seems the package is not available from your package manager. But, since you want development files, it's best to get the source code directly from GitHub.
In your home directory do:
git clone https://github.com/postgres/postgres.git
cd postgres
git checkout "REL_11_STABLE"
then follow this guide https://www.thegeekstuff.com/2009/04/linux-postgresql-install-and-configure-from-source/
Official documentation for installing from source is here https://www.postgresql.org/docs/current/installation.html
You should follow these steps:
sudo apt-get update
sudo apt-get -y install postgresql-12 postgresql-client-12
sudo systemctl status postgresql
I was also facing the same problem and i just updated my Ubunutu and the error got resolved when i run the command again
I faced the same issue on Ubuntu jammy(22.04 LTS).
If you are on the same version of Ubuntu as me, try using
sudo apt install postgresql-server-dev-all
Because neither
sudo apt install postgresql-server-dev-12
nor
sudo apt install postgresql-server-dev-11
worked for me.

Cannot load VSCode

I cannot load VSCOde onto my old Toshiba laptop using Fedoa23. I follow the instructions from the web and finally get the message "No package code availale". I have previously installes VSCode on an old computer using Fedora23 but this time it does not work? Where do I go wrong?
Thanks.
Don't know, but this works for me.
You can use these step to install VSCode:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
Then update the package cache and install the package using dnf (Fedora 22 and above):
dnf check-update
sudo dnf install code
Or on older versions using yum:
yum check-update
sudo yum install code

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

Error "the PGXS Makefile cannot be found" when installing PostGis on Debian

I am in the process of installing PostGis over psql on a Debian machine (actually crunchbang).
I have completed the following steps:
$ wget http://download.osgeo.org/postgis/source/postgis-2.0.3.tar.gz
$ tar xzf postgis-2.0.3.tar.gz
$ cd postgis-2.0.3
$ ./configure
On the final step I get the following error:
configure: error: the PGXS Makefile /usr/lib/postgresql/9.1/lib/pgxs/src/makefiles/pgxs.mk cannot be found. Please install the PostgreSQL server development packages and re-run configure.
The issue is that I do already have Postgres installed:
$ psql --version
psql (9.1.9)
I have checked this on two machines with the same configuration and get the same error. What am I missing here?
PostgreSQL is broken down into several packages, and having psql installed doesn't imply that the development packages are also installed.
According to the error message:
Please install the PostgreSQL server development packages and re-run
configure
you need:
# apt-get install postgresql-server-dev-9.1
Also note there's a APT pgdg repository providing recent pre-compiled versions of postgres-related packages (including postgis) that you may use instead of self-compiling.
If your system is set up to use this repository, just do:
# apt-get install postgresql-9.1-postgis-2.0
Daniel's answer works great except that it needs the following update:
$ sudo apt-get install postgresql-9.1-postgis-2.1
These packages can be updated some time in future again. So, it is recommended to search for new packages using aptitude and install the appropriate one:
$ aptitude search postgis