LoginSignup
1
0

More than 3 years have passed since last update.

【EC2・Rails】postgresqlのアンインストール→インストール・パスを通す方法

Last updated at Posted at 2020-05-09

アンインストール

sudo su -

rpm -qa | grep postgres

postgresql96-server-9.6.17-1PGDG.rhel7.x86_64
postgresql96-9.6.17-1PGDG.rhel7.x86_64
postgresql96-contrib-9.6.17-1PGDG.rhel7.x86_64
postgresql96-libs-9.6.17-1PGDG.rhel7.x86_64

yum remove 上記のバージョンを指定する。

インストール

これでいける。
https://qiita.com/shinsaka/items/cf45cd87c2c75e35ce12

パスを通す

[shogo@ip-10-0-0-193 ~]$ vim ~/.bash_profile

以下のようにパスを通します。

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

PATH=$PATH:/usr/pgsql-9.6/bin/   →数字は9.6で追加
 export PATH                     →追加

export PATH
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

[shogo@ip-10-0-0-193 ~]$ exit
S:Portfolio sahota0701nemoto$ ssh Portfolio_key_rsa

[shogo@ip-10-0-0-193 ~]$ psql --version
psql (PostgreSQL) 9.6.17
[shogo@ip-10-0-0-193 ~]$ 
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0