How to install postgres-9.1 on Ubuntu 10.04 LTS? - ubuntu-10.04

Many months ago, I installed postgres 8.4 using the following command:
$ sudo aptitude install postgresql-8.4 postgresql-client postgresql-contrib
Now I am trying to upgrade to 9.1.
$ sudo aptitude install postgresql-9.1
There apparently is no package that matches 9.1 But it does appear to exist for apt-get. Do I have to go with apt-get?

This may help you out:
http://www.postgresql.org/docs/9.1/static/upgrading.html
or else you can follow these steps:
As root:
su - postgres
pg_dumpall > dump.sql
exit
cp ~postgres/dump.sql /root/
Now you can safely remove the postgresql-8.4 and install postgresql-9.1:
aptitude purge postgresql-8.4
aptitude install postgresql-9.1
Next check the postgresql configuration in /etc/postgresql/9.1/main. If you make any changes, make sure to restart postgres with /etc/init.d/postgresql restart.
Postgresql 9.1 is now up and running, let's import our data back into it.
su - postgres
psql < dump.sql
That's all. You're now fully upgraded to PostgreSQL 9.1
edit:
similar question was asked here:
https://askubuntu.com/questions/66194/how-do-i-migrate-my-postgres-data-from-8-4-to-9-1

Related

elaboration error: mongodb-database-tools

i'm trying to install postgresql on my Linux Pc with sudo apt-get -y install postgresql
but the terminal give me that output (i'm sry but is italian):
so i've tryed to install that with sudo apt install mongodb-database-tools but the terminal give back the same error
Try this way for installation
To install PostgreSQL, first refresh your server’s local package index:
sudo apt update
Then, install the Postgres package along with a -contrib package that adds some additional utilities and functionality:
sudo apt install postgresql postgresql-contrib
To make sure it's installed enter this command in the terminal psql --version and it will should output something like this
psql (PostgreSQL) 14.1 (Ubuntu 14.1-2.pgdg20.04+1)

How to Install Postgresql 11 in Amazon Linux AMI?

How do I install Postgresql 11 on Amazon Linux 2018.03 (specifically, not AMZ Linux 2) on Elastic Beanstalk?
I want to install a package and not manually build a binary. If an autoscale machine boots and has to build the entire PG binary, it'll take significantly longer on a t2/t3.micro.
I'm looking for pg_dump.
[Edit] Making more verbose, explain why building does not work for my situation.
The key was the PGDG is no longer available to Amazon Linux's yum since 9.3 so the individual pieces must be installed.
# Remove old Postgres
yum remove -y postgresql postgresql-server
# Install Postgres 11
yum install -y https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6-x86_64/postgresql11-libs-11.4-1PGDG.rhel6.x86_64.rpm
yum install -y https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6-x86_64/postgresql11-11.4-1PGDG.rhel6.x86_64.rpm
yum install -y https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6-x86_64/postgresql11-server-11.4-1PGDG.rhel6.x86_64.rpm
[edit]
Replace the 11.4 in each link above with any version you need available at https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6-x86_64/
sudo yum update
sudo amazon-linux-extras install postgresql11
Looks like there's no PostgreSQL 11 pre-built binary distribution for Amazon Linux. The way I solve it was to build from source code:
wget https://ftp.postgresql.org/pub/source/v11.5/postgresql-11.5.tar.gz
tar zxvf postgresql-11.5.tar.gz
cd postgresql-11.5
./configure --without-readline
make
make install
By default, it will install pg_dump into /usr/local/pgsql/bin/pg_dump.
This is an extended version of #nitsujri answer. I can't comment their comment, so I will create new answer here.
Install prerequisites:
sudo yum install readline-devel
sudo yum group install "Development Tools"
Download PostgreSQL source code and install the distro:
wget https://ftp.postgresql.org/pub/source/v11.5/postgresql-11.5.tar.gz
tar zxvf postgresql-11.5.tar.gz
cd postgresql-11.5
./configure
make
sudo make install
Add this line to your ~/.bashrc. After that relogin to an EC2 instance.
export PATH=/usr/local/pgsql/bin:$PATH

Unable to install libsasl2-devel on Amazon Linux 2 machine

I am running Ansible playbook and trying to install OS dependencies packages for python. I am trying to run the following:
sudo yum install gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel libsasl2-devel openldap-devel
However, it fails at installing libsasl2-devel with the message:
"No package matching 'libsasl2-devel' found available, installed or updated"
All my instances are Amazon Linux 2 machines. Is there any alternative package for this? I tried to look into this but I found solutions for Ubuntu only.
I was able to get it to work in a series of steps. Its a yum issue after other databases are installed and not cleaned up before installing mysql
clear sasl first: sudo yum remove cyrus-sasl
if you have installed maria, there will be conflicts, remove that as well
sudo yum remove mariadb mariadb-server mariadb-libs
take note of anything uninstalled by this to re-add later. If this is too much, you can take a risk and not remove sasl, but it might not reset the availability of the package.
Start here to clean up the dependency issues: https://serverfault.com/questions/873955/how-solve-mysql-5-7-dependency follow the command given by clean all as sudo rm -rf /var/cache/yum/*
This can possibly resolve your issues right there, if not continue the installation below.
delete all data left in /var/lib/mysql/ or you may have upgrade issues.
resinstall sasl:
sudo yum install cyrus-sasl cyrus-sasl-devel and any other packages removed above.
Establish mysql5.7 with the yum services.
wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm
sudo yum localinstall -y mysql57-community-release-el6-11.noarch.rpm
sudo yum repolist enabled | grep "mysql.*-community.*"
sudo yum repolist enabled | grep mysql
sudo yum install -y mysql-community-common mysql-community-libs mysql-community-server mysql-community-client
if that doesn't work, re-clear the yum cache again and re-run sudo yum install -y mysql-community-server
if that works, then
sudo service mysqld start
IF the /var/lib/mysql is empty, it will have created a temporary password in the /var/log/mysqld.log (use sudo to read)
run sudo mysql_secure_installation and establish your real password and security settings.
now you should have access via mysql -u root -p

installing MariaDB source code on manjaro

i'm a linux newbie and i wanna install mariadb 10.2 which doesn't exist in the the repo. so i wanna install it from the source code mariadb-10.2.12.tar.gz here, so how can i install it
This worked for me in arch:-
- sudo pacman -S mariadb
- sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
- sudo systemctl start mariadb
- sudo mysql_secure_installation
- mysql -u root -p
sudo pacman -S mariadb
and I installed mariadb successfuly

yum install mongodb on aws linux fails: no package available

Purpose
I'm trying to install mongodb on EC2 AWS x86_64 GNU/Linux via Yum.
Prerequisites
I created a /etc/yum.repos.d/mongodb.repo file and tried all the available combinations for it's content found on the official documentations and on the related questions on stackoverflow link1 link2 link3, for example:
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
(...tried with enabled=0, gpgcheck=0 too)
I also added a /etc/yum.conf file like this:
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
Problem
I'm getting the same output when running
sudo yum install mongodb-org (or by specifying the packages sudo yum install mongo-org mongo-org-server or by specifying the versions too sudo yum install -y mongodb-org-3.2.13 mongodb-org-server-3.2.13 mongodb-org-shell-3.2.13 mongodb-org-mongos-3.2.13 mongodb-org-tools-3.2.13)
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00
amzn-updates | 2.3 kB 00:00
No package mongodb-org available.
Error: Nothing to do
Question
What am I missing? Is there any additional dependencies?
You don't need to create a new /etc/yum.repos.d/mongodb.repo or at the time of this answer /etc/yum.repos.d/mongodb-org-3.6.repo cause it already exists but it is empty.
You can check with: cat /etc/yum.repos.d/mongodb-org-3.6.repo.
all you need to do is open the file on vi editor:
$ sudo vi /etc/yum.repos.d/mongodb-org-3.6.repo
~
~
add this code to the repository file. The one i provided is for the MongoDB 3.6 but you can find the one for earlier versions in the documentation:
[mongodb-org-3.6]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.6/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc
To save and exit from vi editor check here or go ahead and do this:
ESC + :wq
After that you can proceed with the steps in the documentation or in the old C9 Forum, but here they are just in case:
$ sudo yum install -y mongodb-org
$ sudo mkdir -p /data/db
$ echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest "$#"' > mongod
$ chmod a+x mongod
You can start mongodb by running the mongod script on your project root:
$ ./mongod
The last command might not run the mongodb local server, and you can find the solution for that here or just go ahead and run these two commands:
$ sudo service mongod stop
$ sudo mongod
The only error I can spot is the space in "name" :
name=MongoDB Repository
With the naming changed to name=MongoDB, I did a test with CenOS 7 :
# yum search mongodb-org
Loaded plugins: fastestmirror, langpacks
base | 3.6 kB 00:00
.
mongodb-org-3.4 | 2.5 kB 00:00
updates | 3.4 kB 00:00
(1/5): mongodb-org-3.4/primary_db | 30 kB 00:00
.
=========================== N/S matched: mongodb-org ============
mongodb-org-debuginfo.x86_64 : Debug information for package mongodb-org
mongodb-org.x86_64 : MongoDB open source document-oriented database system
: (metapackage)
mongodb-org-mongos.x86_64 : MongoDB sharded cluster query router
mongodb-org-server.x86_64 : MongoDB database server
mongodb-org-shell.x86_64 : MongoDB shell client
mongodb-org-tools.x86_64 : MongoDB tools
So I guess you can now install ``mongodb-org´´.
The problem was that I wanted to do it from the default ec2_user/ home folder. You need to cd .. up to the root, and locate the etc/yum.repos.d/ folder there.
For those of you finding this error after running an ARM AMI Linux 2 image, simply install the RPMs directly from the testing repository, which is the only one that supports all binaries on Amazon AArch64:
https://repo.mongodb.org/yum/amazon/2/mongodb-org/testing/aarch64/RPMS/
For example, to install the latest mongo shell:
sudo yum install -y https://repo.mongodb.org/yum/amazon/2/mongodb-org/testing/aarch64/RPMS/mongodb-org-shell-4.4.4-0.1.rc1.amzn2.aarch64.rpm
There is a dedicated repository for AWS Linux now.
Follow the instructions from https://docs.mongodb.com/master/tutorial/install-mongodb-on-amazon/
e.g.
[mongodb-org-4.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
I had this happen when my install commands specified sudo yum install mongodb-org-tools-4.0.18, but yum list available | grep mongo showed only 3.6 was available. So I did sudo yum install mongodb-org-tools and that worked.
I think you try to add exclude directory from /etc/yum.conf to prevent future updates
for example:
exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools
But above line need to be added after perform install mongodb-org:
sudo yum install -y mongodb-org

Resources