質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.51%
PostgreSQL

PostgreSQLはオープンソースのオブジェクトリレーショナルデータベース管理システムです。 Oracle Databaseで使われるPL/SQLを参考に実装されたビルトイン言語で、Windows、 Mac、Linux、UNIX、MSなどいくつものプラットフォームに対応しています。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

Q&A

解決済

2回答

6776閲覧

PostgreSQLを仮想環境にインストールできず困っています

vitabrevisarsl1

総合スコア57

PostgreSQL

PostgreSQLはオープンソースのオブジェクトリレーショナルデータベース管理システムです。 Oracle Databaseで使われるPL/SQLを参考に実装されたビルトイン言語で、Windows、 Mac、Linux、UNIX、MSなどいくつものプラットフォームに対応しています。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

0グッド

0クリップ

投稿2017/04/06 05:40

仮想環境 VirtualBox - Vagrant
サーバー centOS64 におきまして、

vagrant init centos64 vagrant up vagrant ssh

の後、ruby, Ruby on rails, git を正常にインストールし終えました。

[vagrant@localhost ~]$ ruby -v ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux] [vagrant@localhost ~]$ rails -v Rails 5.0.2 [vagrant@localhost ~]$ git --version git version 1.7.1

〜 PostgreSQLのバージョンを確認。

[vagrant@localhost ~]$ psql --version -bash: psql: command not found

_PostgreSQLをインストールしたいのですが、

[vagrant@localhost ~]$ sudo yum install postgresql-server Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.iij.ad.jp * extras: ftp.iij.ad.jp * updates: ftp.iij.ad.jp https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/repodata/repomd.xml: [Errno 14] problem making ssl connection Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: pgdg95. Please verify its path and try again

となってしまいます。repository metadataが見つからない、ようですが、githubでもないのにrepositoryということは、どこかでcloneしたりするのでしょうか。

sudo yum install -y http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm sudo rpm -ivh http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm sudo yum install -y postgresql95 postgresql95-server postgresql95-contrib postgresql95-libs postgresql95-devel sudo rpm -i http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm sudo yum update sudo yum -y install postgresql96* sudo vi /etc/yum.repos.d/CentOS-Base.repo sudo yum -y localinstall https://yum.postgresql.org/9.6/redhat/rhel-6.7-x86_64/pgdg-centos96-9.6-3.noarch.rpm sudo apt-get install postgresql wget https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm

〜 上記の如くいくつか試しましたが、インストールができないです。

[root@localhost network-scripts]# vi ifcfg-eth0 [root@localhost network-scripts]# vi ifcfg-eth1 [root@localhost network-scripts]# vi ifcfg-lo

〜 これらのファイルも異状ありません(noをyesに書き換える場合があるようです)。

_なにがしかでも御指南いただけますと幸いです。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2017/04/06 05:54

その仮想環境からインターネットに接続できていますか?
vitabrevisarsl1

2017/04/07 09:36 編集

 追記ありがとうございます。  インターネットに接続できているか否かの確認方法を調べました。しかし、以下はこちらと仮想マシンとの通信の確認ですよね。。。78.90にsudo yum install postgresql-serverで成功させたいです。 [vagrant@localhost ~]$ ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00  inet 127.0.0.1/8 scope host lo  inet6 ::1/128 scope host  valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000  link/ether 08:00:27:62:52:b8 brd ff:ff:ff:ff:ff:ff  inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0  inet6 fe80::a00:27ff:fe62:52b8/64 scope link  valid_lft forever preferred_lft forever 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000  link/ether 08:00:27:06:9f:0b brd ff:ff:ff:ff:ff:ff  inet 192.168.78.90/24 brd 192.168.78.255 scope global eth1  inet6 fe80::a00:27ff:fe06:9f0b/64 scope link  valid_lft forever preferred_lft forever [vagrant@localhost ~]$ ping -c4 192.168.78.90 PING 192.168.78.90 (192.168.78.90) 56(84) bytes of data. 64 bytes from 192.168.78.90: icmp_seq=1 ttl=64 time=0.008 ms 64 bytes from 192.168.78.90: icmp_seq=2 ttl=64 time=0.105 ms 64 bytes from 192.168.78.90: icmp_seq=3 ttl=64 time=0.056 ms 64 bytes from 192.168.78.90: icmp_seq=4 ttl=64 time=0.020 ms --- 192.168.78.90 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3001ms rtt min/avg/max/mdev = 0.008/0.047/0.105/0.038 ms  よくわかっていないところあると思います(段落をどうしてもつけられないです。下記2件と同じ様に入力あるいはコピペしても段落がつきません。原因不明です)。
guest

回答2

0

ベストアンサー

SSLまわりのライブラリのアップデートが必要、なのかもしれません(Qiita)。

投稿2017/04/06 06:49

maisumakun

総合スコア145062

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

vitabrevisarsl1

2017/04/06 17:35 編集

 ご返信ありがとうございます。 $ sudo yum install -y nss [vagrant@localhost ~]$ sudo yum install -y nss  Loaded plugins: fastestmirror  Loading mirror speeds from cached hostfile  * base: ftp.iij.ad.jp  * extras: ftp.iij.ad.jp  * updates: ftp.iij.ad.jp  https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/repodata/repomd.xml: [Errno 14] problem making ssl connection  Trying other mirror.  Error: Cannot retrieve repository metadata (repomd.xml) for repository: pgdg95. Please verify its path and try again  やって見ましたが変わりませんでした。
maisumakun

2017/04/06 23:43

いったん、yumの引数に--disablerepo=pgdg95を追加して、このリポジトリを無視するようにしてやってみて下さい。
vitabrevisarsl1

2017/04/07 09:49 編集

[vagrant@localhost ~]$ sudo yum install -y nss --disablerepo=pgdg95 〜 base   | 3.7 kB 00:00 #突破 extras   | 3.4 kB 00:00 updates   | 3.4 kB 00:00 Setting up Install Process Resolving Dependencies --> Running transaction check 〜 Dependencies Resolved 〜 Updated: nss.x86_64 0:3.27.1-13.el6 Dependency Updated: nspr.x86_64 0:4.13.1-1.el6 nss-softokn.x86_64 0:3.14.3-23.3.el6_8 nss-softokn-freebl.x86_64 0:3.14.3-23.3.el6_8 nss-sysinit.x86_64 0:3.27.1-13.el6 nss-tools.x86_64 0:3.27.1-13.el6 nss-util.x86_64 0:3.27.1-3.el6 Complete! #完了 [vagrant@localhost ~]$ sudo yum install postgresql-server 〜 pgdg95       | 4.1 kB 00:00 #突破 pgdg95/primary_db  | 177 kB 00:01 Setting up Install Process Resolving Dependencies --> Running transaction check 〜 Dependencies Resolved 〜 Installed: postgresql95-server.x86_64 0:9.5.6-2PGDG.rhel6 Dependency Installed: postgresql95.x86_64 0:9.5.6-2PGDG.rhel6 postgresql95-libs.x86_64 0:9.5.6-2PGDG.rhel6 Complete! #完了 [vagrant@localhost ~]$ psql --version psql (PostgreSQL) 9.5.6 #確認  感激です。素晴らしい。ありがとうございました。
guest

0

PostgreSQLのサイトからrpmを探し、

$ yum localinstall https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm

とか直接叩いてみたらどうでしょう。
それでもつながらないと言われたら、まずrpmをPC等でダウンロードし、サーバに設置。その後

$ yum localinstall pgdg-centos96-9.6-3.noarch.rpm

とかしてみたらいかがでしょう

投稿2017/04/06 06:43

kunai

総合スコア5405

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

vitabrevisarsl1

2017/04/06 18:05 編集

 ご返信ありがとうございます。  まず、 [vagrant@localhost ~]$ yum localinstall https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm  Loaded plugins: fastestmirror  You need to be root to perform this command. ときましたので、suコマンドを経て再実行。 [root@localhost vagrant]# yum localinstall https://download.postgresql.org/pub/repos/yum/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-8.noarch.rpm  Loaded plugins: fastestmirror  Setting up Local Package Process  Cannot open: https://download.postgresql.org/pub/repos/yum/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-8.noarch.rpm. Skipping.  Nothing to do  rpmをダウンロードし、 [root@localhost vagrant]# yum localinstall pgdg-centos92-9.2-8.noarch.rpm  Loaded plugins: fastestmirror  Setting up Local Package Process  Cannot open: pgdg-centos92-9.2-8.noarch.rpm. Skipping.  Nothing to do  not exist ではないので、共有フォルダに置けてはいると思われます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.51%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問