레이블이 centos인 게시물을 표시합니다. 모든 게시물 표시
레이블이 centos인 게시물을 표시합니다. 모든 게시물 표시

2022년 2월 3일 목요일

CentOS 8 yum 실행 에러

CentOS 8 설치 후, yum을 사용하려고 하면 아래와 같이 에러가 발생한다.

[root@centos2 ~]# yum update

CentOS Linux 8 - AppStream                                                                                     101  B/s |  38  B     00:00

Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist


구글링을 해보니, repository가 변경되어서 발생하는 에러다.

아래처럼 해결할 수 있다.

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*

sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*


dnf install centos-release-stream -y
dnf swap centos-{linux,stream}-repos -y
dnf distro-sync -y

2020년 2월 19일 수요일

CentOS docker 에서 ip addr 혹은 ifconfig 안될 때

docker hub 에서 centos 검색하면 "The official build of CentOS" 이라고 검색되는 것이 있다.

https://hub.docker.com/_/centos

아마도 centos 공식 docker image 인가 보다.

image pull 해서 사용해 보니, 정말 minimal 인거 같다.

기본적으로 사용하던 네트워크 관련 명령어가 안된다.

이리저리 구글링해서 설치하는 방법을 검색해서 설치를 했다.

ifconfig 명령어 설치
% yum install -y net-tools

ip address 명령어 설치
% yum install -y iproute

출처
https://github.com/docker-library/docs/issues/526

2020년 1월 21일 화요일

CentOS 8.1 릴리즈 (2020.01.15)

드디어 CentOS 8.1 릴리즈가 되었다. (2020.01.15)
RHEL 8.1 릴리즈 (2019.11.05) 이후 2개월 조금 넘게 걸렸다.
http://kimchki.blogspot.com/2019/11/red-hat-enterprise-linux-81-rhel-81.html

CentOS 8.0 릴리즈 보다,
CentOS 8.1 릴리즈 작업이 훨씬 빨리 완료 되었다.

CentOS 8.0 릴리즈는 4개월이나 걸렸었는데......
http://kimchki.blogspot.com/2019/09/centos-8-20190924.html

RHEL 7.6 -> RHEL 8 -> RHEL 7.7 순서로 릴리즈 되는 바람에, CentOS도 순서가 엉키게 되었다.
CentOS 7.6 -> CentOS 8(작업하는 도중에 중단) -> CentOS 7.7 -> CentOS 8 순서가 되었다.

그래서 CentOS 8 릴리즈 시간이 좀 걸렸다.
http://kimchki.blogspot.com/2019/09/centos-8.html

wiki 페이지에 들어가면, 아래 그림처럼 각 단계별로 상태를 확인할 수 있다.
https://wiki.centos.org/About/Building_8

Item
Started
Ended
Status

Sources pushed to CentOS Git
2019-11-05
2019-11-14
DONE

Source code evaluation
2019-11-05
2019-11-14
DONE

Build Packages
2019-11-05
2020-01-??
DONE

Installer work
2019-11-05
2020-01-??
DONE

QA work
2019-12-18
2020-01-??
DONE

CR work
2019-12-20
2019-12-25
DONE

Release work
2020-01-??
2020-01-15
DONE

Final release
2020-01-15
2020-01-15
DONE



출처
https://wiki.centos.org/About/Building_8

2019년 9월 30일 월요일

CentOS 8 릴리즈 (2019.09.24)

드디어 CentOS 8 릴리즈가 되었다. (2019.09.24)
RHEL 8 릴리즈 (2019.05.07) 이후 4개월이 넘게 걸렸다.
http://kimchki.blogspot.com/2019/05/red-hat-enterprise-linux-8-rhel-8_8.html

RHEL 7.6 -> RHEL 8 -> RHEL 7.7 순서로 릴리즈 되는 바람에, CentOS도 순서가 엉키게 되었다.
CentOS 7.6 -> CentOS 8(작업하는 도중에 중단) -> CentOS 7.7 -> CentOS 8 순서가 되었다.

그래서 CentOS 8 릴리즈 시간이 좀 걸렸다.

https://wiki.centos.org/About/Building_8
위 링크에 들어가면, 아래 그림처럼 각 단계별로 상태를 확인할 수 있다.


https://wiki.centos.org/Download
위 링크에서, 다른 정보도 확인할 수 있다.


아마도 당장 8 version을 사용하지는 않은거 같다.
현업에서 주로 7 version을 주로 사용하고 있기 때문이다.
심지어 6 version을 사용하고 있는곳도 있다.

나중에 시간 날 때 설치해 보고, 기웃기웃 해봐야겠다.



출처
https://wiki.centos.org/About/Building_8
https://wiki.centos.org/Download

2019년 9월 24일 화요일

CentOS 네트워크(Network) 툴(tool)


# yum install NetworkManager

# systemctl status NetworkManager
NetworkManager.service - Network Manager
Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled)
Active: active (running) since Fri, 08 Mar 2013 12:50:04 +0100; 3 days ago

# systemctl start NetworkManager

# systemctl enable NetworkManager



2.5. NetworkManager Tools

Table 2.1. A Summary of NetworkManager Tools and Applications
Application or ToolDescription
nmcliA command-line tool which enables users and scripts to interact with NetworkManager. Note that nmcli can be used on systems without a GUI such as servers to control all aspects of NetworkManager. It has the same functionality as GUI tools.
nmtuiA simple curses-based text user interface (TUI) for NetworkManager
nm-connection-editorA graphical user interface tool for certain tasks not yet handled by the control-center utility such as configuring bonds and teaming connections. You can add, remove, and modify network connections stored by NetworkManager. To start it, enter nm-connection-editor in a terminal:
~]$ nm-connection-editor
control-centerA graphical user interface tool provided by the GNOME Shell, available for desktop users. It incorporates a Network settings tool. To start it, press the Super key to enter the Activities Overview, type Network and then press Enter. The Network settings tool appears.
network connection iconA graphical user interface tool provided by the GNOME Shell representing network connection states as reported by NetworkManager. The icon has multiple states that serve as visual indicators for the type of connection you are currently using.


https://haker.tistory.com/55


http://millky.com/@origoni/post/1051

https://youngmind.tistory.com/entry/CentOS-%EA%B0%95%EC%A2%8C-PART-1-7-%EB%84%A4%ED%8A%B8%EC%9B%8C%ED%81%AC-%EA%B5%AC%EC%84%B1






출처
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-installing_networkmanager
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-checking_the_status_of_networkmanager
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-starting_networkmanager
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-networkmanager_tools

2019년 9월 11일 수요일

CentOS 8 릴리즈 연기

CentOS는 RHEL 기반으로 만들어지기 때문에,
RHEL 새로운 버전이 발표되면, 1~2달 후에 CentOS 새로운 버전이 발표되는게 일반적이다.

"RHEL 8"은 2019년 5월에 발표되었었다.

Red Hat Enterprise Linux 8 (RHEL 8) 릴리즈 (2019.05.07)
http://kimchki.blogspot.com/2019/05/red-hat-enterprise-linux-8-rhel-8_8.html

그래서 "CentOS 8"을 기다리고 있었다.
가끔씩 진행상황을 확인하면서.

근데 왜 이렇게 오래 걸리는지.... 진도가 부진하더니,
결국 중단을 하고 말았다.

CentOS 7.7 먼저 작업 하겠다고 한다.

https://wiki.centos.org/About/Building_8


릴리즈 날짜를 보면, "RHEL 8" 보다 "RHEL 7.7"이 나중에 릴리즈 되었다.

Release General Availability Date
RHEL 8.52021-11-09
RHEL 8.42021-05-18
RHEL 8.32020-11-03
RHEL 8.22020-04-28
RHEL 8.12019-11-05
RHEL 8.02019-05-07
RHEL 7.92020-09-30
RHEL 7.82020-03-31
RHEL 7.72019-08-06
RHEL 7.62018-10-30
RHEL 7.52018-04-10
RHEL 7.42017-07-31
RHEL 7.32016-11-03
RHEL 7.22015-11-19
RHEL 7.12015-03-05
RHEL 7.0 GA2014-06-09
RHEL 7.0 Beta2013-12-11
RHEL 6.102018-06-19
RHEL 6.92017-03-21
RHEL 6.82016-05-10
RHEL 6.72015-07-22
RHEL 6.62014-10-14
RHEL 6.52013-11-21
RHEL 6.42013-02-21
RHEL 6.32012-06-20
RHEL 6.22011-12-06
RHEL 6.12011-05-19
RHEL 6.02010-11-09

"RHEL 8" 보다 "RHEL 7.7"이 나중에 릴리즈 되었지만,
"CentOS 8"보다 "CentOS 7.7"를 먼저 작업 하기로 결정한 모양이다.

https://wiki.centos.org/About/Building_7


결론적으로, "CentOS 8"을 사용해 보려면 좀 더 기다려야 할 듯 싶다.



출처
http://kimchki.blogspot.com/2019/05/red-hat-enterprise-linux-8-rhel-8_8.html
https://wiki.centos.org/About/Building_8
https://wiki.centos.org/About/Building_7
https://access.redhat.com/articles/3078

2019년 4월 11일 목요일

리눅스(Linux) 그래픽 환경(GUI)에서 바로가기 아이콘(icon) 수정

GUI 환경에서  Linux를 사용할 때 당연히 icon을 사용하게 된다.
그런데, icon을 삭제하거나 수정할 수 없다.

당연히, 윈도우(Windows)처럼 마우스를 갖다 대고, 오른쪽 버튼을 클릭하면,
삭제 혹은 수정 등등 작업을 할 수 있을 줄 알았는데......

구굴링을 해보니,
직접 수정을 해야 하는거 같다.

사용자 마다 생성되는 icon은 아래 경로에 저장된다.
~/.local/share/applications

확장자가 deskop으로 되어 있는 파일들이,
바로가기 역할을 한다.

파일 내용은 아래와 같은 형식으로 되어 있다.

% cat telegramdesktop.desktop

[Desktop Entry]
Version=1.0
Name=Telegram Desktop
Comment=Official desktop application for the Telegram messaging service
TryExec=/home/postgresql/Telegram/Telegram
Exec=/home/postgresql/Telegram/Telegram -- %u
Icon=telegram
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
Categories=Network;InstantMessaging;Qt;
MimeType=x-scheme-handler/tg;
Keywords=tg;chat;im;messaging;messenger;sms;tdesktop;
X-GNOME-UsesNotifications=true
X-Desktop-File-Install-Version=0.23

위와 같은 형식으로 새롭게 만들 수 있고,
기존 파일을 수정할 수도 있다.

만약, 모든 사용자에게 공통(common)으로 적용되게 하고 싶다면,
아래 경로에 있는 desktop 파일을 수정하면 된다.
/usr/share/applications



출처
http://quitlee.blogspot.com/2018/04/ubuntu_2.html

2019년 4월 9일 화요일

CentOS 7 설치 후, 설정해야 할 것들, 설치해야 할 것들

한글 입력기 설정
https://kimchki.blogspot.com/2019/04/centos7.html



IP Address를 설정 한다.

% /etc/sysconfig/network-scripts/ifcfg-enp2s0
(컴퓨터 마다 ifcfg-enp2s0 이름은 달라질 수 있다)

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp2s0
UUID=ee99734a-6a84-4c8e-a5fd-d6bb844ebd0f
DEVICE=enp2s0
ONBOOT=yes
IPADDR=172.21.70.159
PREFIX=24
GATEWAY=172.21.70.1
DNS1=172.21.17.2
DNS2=168.126.63.1
IPV6_PRIVACY=no

다른건 그대로 두고, 파란색만 신경쓰면 된다.

BOOTPROTO : none, static, dhcp 중 1개를 선택하면 된다.
ONBOOT : 당연히 yes 로 한다.

BOOTPROTO 이 static 일 경우에만 아래 항목을 입력하고,
dhcp 일 경우에는 입력하지 않는다.

IPADDR
PREFIX
GATEWAY
DNS1
DNS2

"PREFIX=24" 대신에 "NETMASK=255.255.255.0" 으로 입력해도 상관없다.



방화벽을 stop 한다.

% systemctl stop firewalld

재부팅시, 방화벽이 실행되지 않도록 한다.

% systemctl disable firewalld



SELinux를 해지 한다.
(해지 하지 않으면, 삼바(samba) 사용시, "네트워크 리소스를 사용할 권한이 없는 것 같습니다" 라고 에러 발생 함)

현재 상태를 확인 한다.
% sestatus

4가지 옵션을 넣을 수 있다.
% setenforce
usage:  setenforce [ Enforcing | Permissive | 1 | 0 ]

재부팅시, SELinux가 실행되지 않도록 한다.
% vi /etc/sysconfig/selinux

SELINUX=enforcing 을 SELINUX=disabled 로 변경 한다.



패키지를 최신으로 업데이트 한다.

% yum update



개발, 컴파일에 필요한 패키지들을 설치 한다.

% yum -y install gcc gcc-c++ boost boost-devel pkgconfig uuidd libtool autoconf make coreutils uuid-dev uuid-devel libuuid-devel e2fsprogs-devel readline readline-devel zlib zlib-devel openssl openssl-devel gettext libxml2-devel git



CentOS 사용에 유용한 도구들을 설치 한다.

% yum -y install vi vim emacs net-tools sysstat bc wget curl python samba*



google chrome을 설치 한다.

% vi /etc/yum.repos.d/google-chrome.repo

[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

% yum install google-chrome-stable



Visual Studio Code를 설치 한다.

% rpm --import https://packages.microsoft.com/keys/microsoft.asc

% 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'

% yum check-update

% yum install code



Atom을 설치 한다.

% wget -o atom.rpm https://atom.io/download/rpm

% rpm -Uvi atom.rpm



필요한 hdd,ssd를 마운트 한다.

/etc/fstab 에 형식에 맞게 추가하거나,
/etc/rc.local 에 mount 명령어를 추가 한다.

/etc/rc.local 을 실행 가능하도록 한다.

% chmod u+x /etc/rc.local



삼바(samba)를 설정 한다.

삼바(samba) 사용자 AAA를 추가하려면,
먼저, 리눅스 계정 AAA를 추가 한다.

리눅스 계정 AAA,BBB를 추가 한다.
% useradd AAA
% useradd BBB

삼바(samba) 사용자 AAA,BBB를 추가하고, 패스워드도 설정 한다.

% smbpasswd -a AAA
% smbpasswd -a BBB

패스워드를 변경할 수 있다.
% smbpasswd AAA
% smbpasswd BBB

삼바(samba) 사용자 리스트를 확인 한다.
% pdbedit -L

옵션을 추가하면 더 자세한 내용을 볼 수 있다.
% pdbedit -L -v

삼바(samba) 사용자를 삭제할 수 있다.
% smbpasswd -x CCC

삼바(samba) 사용자를 사용 불가능하게 할 수 있다.
% smbpasswd -d CCC

삼바(samba) 사용자를 사용 가능하게 할 수 있다.
% smbpasswd -e CCC

환경설정 파일을 수정 한다.
% vi /etc/samba/smb.conf

#[homes]
#       comment = Home Directories
#       valid users = %S, %D%w%S
#       browseable = No
#       read only = No
#       inherit acls = Yes

[homes]
        comment = Home Directories
        path = /home/%S
        valid users = %S
        writable = yes
        write list = %S
        browseable = yes
        read only = no
        create mask = 0644
        directory mask = 0755

[1T]
        comment = 1TB HDD
        path = /1T
        valid users = AAA,BBB
        writable = yes
        write list = AAA,BBB
        browseable = yes
        read only = no
        create mask = 0644
        directory mask = 0755

[1T] 처럼 따로 항목을 만든 후, 취향에 따라 설정값을 할당하면 된다.
공유 폴더 이름은 "1T" 으로 나타난다.
comment 에는 알아보기 쉽게 설명을 넣으면 된다.
설명에는 스페이스(space)도 포함될 수 있다.

[homes] 는 취향에 따라 사용해도 되고, 사용하지 않아도 된다.

삼바(samba)를 시작한다.
% systemctl start smb

smb.conf를 다시 읽는다.
% systemctl reload smb

부팅시 자동으로 시작한다.
% systemctl enable smb



VirtualBox를 설치 한다.

% wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

% mv virtualbox.repo /etc/yum.repos.d

% yum install VirtualBox-5.2

% /sbin/vboxconfig



Tiger VNC Server를 설치 한다.
(윈도우에는 Tight VNC를 설치해야 한다)

% yum install tigervnc-server

% vncserver

You will require a password to access your desktops.

Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used


New 'centos76:1 (root)' desktop is centos76:1

Creating default startup script /root/.vnc/xstartup
Creating default config /root/.vnc/config
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/centos76:1.log



VNC Viewer를 설치 한다.

% wget https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-6.19.325-Linux-x64

% chmod a+x VNC-Viewer-6.19.325-Linux-x64

% ./VNC-Viewer-6.19.325-Linux-x64



vagrant를 설치 한다.

% wget https://releases.hashicorp.com/vagrant/2.2.4/vagrant_2.2.4_linux_amd64.zip

% unzip vagrant_2.2.4_linux_amd64.zip

% ./vagrant



그림 편집 프로그램을 설치 한다.

% yum install kolourpaint

% yum install gimp



nginx를 설치 한다.

% vi /etc/yum.repos.d/nginx.repo

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1

% yum install nginx

% systemctl start nginx

% systemctl enable nginx

root 디렉토리를 변경 한다.

% vi /etc/nginx/conf.d/default.conf

    location / {
        #root   /usr/share/nginx/html;
        root   /home/postgresql/www;
        autoindex on;
        charset utf-8;
        index  index.html index.htm;
    }

파랑색으로 표시한 부분이, 실제 변경한 부분이다.

접속해 보자.
http://127.0.0.1

"nginx 403 Forbidden" 에러가 발생한다.

% chmod 755 /home/postgresql/www
했는데도, 에러가 발생한다.

% chmod 755 /home/postgresql
까지 해야, 에러가 발생하지 않는다.



메일 클라이언트(mail client)를 설치 한다.

% yum install thunderbird



터미널에서 글꼴을 변경 한다.

편집 - 기본설정 - 텍스트 - 사용자 지정 글꼴 - DejaVu Sans Mono Book 12

터미널에서 색상을 변경 한다.

편집 - 기본설정 - 색 - 시스템 테마 색 사용 체크 해제 - 내장 팔레트 - 탱고 어두움





출처
https://www.lesstif.com/pages/viewpage.action?pageId=6979732
https://blog.bypass.sh/961
https://code.visualstudio.com/docs/setup/linux
https://atom.io
https://github.com/TeamLab/Gachon_CS50_Python_KMOOC/blob/master/desc/atom_ubuntu.md
https://zetawiki.com/wiki/CentOS_VirtualBox_설치
http://blog.tjsrms.me/centos-7-nginx-설치하기
https://blog.naver.com/cloverloop/140208992571
https://maximer.tistory.com/182

CentOS 7 에서 Google Chrome 설치하기

repository를 추가 한다.

% vi /etc/yum.repos.d/google-chrome.repo

[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

설치 한다.

% yum install google-chrome-stable




출처
https://blog.bypass.sh/961

CentOS 7 리눅스 한글 입력기 설정

https://live.staticflickr.com/7906/32634770377_369ebf58b4_o.png



출처
https://sunyzero.tistory.com/253

2019년 1월 7일 월요일

CentOS 7 에서 virtualbox 실행시 오류 Qt FATAL: QXcbConnection: Could not connect to display

CentOS 7 에서 virtualbox 실행시 오류 메세지가 나오는 경우가 있다.

# virtualbox
Qt FATAL: QXcbConnection: Could not connect to display
중지됨 (core dumped)

열심히 구굴링을 해봐도 마땅한 해결책을 찾지 못해서,
아... 아무래도 x11 뭐 거시기가 없어서 그런거 같다고 생각했다.
그래서 관련 패키지를 설치하기로 했다.

# yum install -y xorg-x11-server-Xorg xorg-x11-xauth xorg-x11-apps

다 설치 후, 재부팅 후, virtualbox 를 수행하니, 다행히 에러 없이 실행되었다.

그런데, 화면이 이상하게 실행이 되었다.


폰트 문제인가?

# env | grep LANG
LANG=ko_KR.UTF-8

음..... 바꿔볼까?

# export LANG=C
# env | grep LANG
LANG=C

다시 virtualbox 를 실행했다.


오~ 잘된다.

CentOS 7 설치 후 netstat, ifconfig 설치

CentOS 7 설치 후 netstat, ifconfig 명령어가 없어서 매우 당혹스러운 적이 있었다.

간단하게, yum 을 통해서 network tools 을 설치할 수 있다.

# yum -y install net-tools



출처
http://millky.com/@origoni/post/1051

2018년 9월 21일 금요일

CentOS 7 IP 주소 설정

CentOS 7 IP 주소 설정

네트워크 설정이 기록되어 있는 파일을 수정하면 된다.

% vi /etc/sysconfig/network-scripts/ifcfg-enp3s0

ifcfg-enp3s0 파일 이름은 서버 상황에 따라 다를 수 있다.

% ip a
명령어를 통해서 네트워크 카드 이름을 확인하자.

% ls -l /etc/sysconfig/network-scripts
해당하는 파일이 존재하는지 확인하자.

붉은색으로 표시된 내용만 수정 혹은 추가하면 된다.

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp3s0
UUID=227c9d90-2be8-4427-a098-3fd3b22e4271
DEVICE=enp3s0
ONBOOT=yes
IPADDR=172.21.70.116
NETMASK=255.255.255.0
GATEWAY=172.21.70.1
DNS1=172.21.17.2
DNS2=168.126.63.1

서버를 재부팅 하거나, 네트워크를 다시 시작하면 된다.
% service network restart



출처
http://devhoma.tistory.com/112

2017년 9월 20일 수요일

PostgreSQL 소스 설치 (CentOS 7)


CentOS 에 PostgreSQL 설치하면서, 수행한 내용들을 기록해 보기로 한다.
나중에 혹시라도 참고할 때가 있을거 같다.
암튼 치매 예방을 위해 기록한다.

  • 소스 다운로드
에서 원하는 버전을 다운로드 한다.
글을 쓰고 있는 현재 기준으로, 9.6.5 가 최신이므로, 이 버전을 설치하도록 한다.
v9.6.5 링크를 클릭한다.
여러 파일들이 있는데, postgresql-9.6.5.tar.gz 다운로드 받는다.

  • 압축해제
% tar vxzf postgresql-9.6.5.tar.gz
압축을 해제하면, postgresql-9.6.5 디렉토리가 생성된다.

  • 설정
컴파일을 하기 전에 설정을 먼저 해야 한다.
설정은 일반적으로 configure 를 사용해서 한다.
% ./configure

쭉루루룩 하면서 잘되는가 싶더니 에러를 내뿜는다.

checking for main in -lm... yes
checking for library containing setproctitle... no
checking for library containing dlopen... -ldl
checking for library containing socket... none required
checking for library containing shl_load... no
checking for library containing getopt_long... none required
checking for library containing crypt... -lcrypt
checking for library containing shm_open... -lrt
checking for library containing shm_unlink... none required
checking for library containing fdatasync... none required
checking for library containing sched_yield... none required
checking for library containing gethostbyname_r... none required
checking for library containing shmget... none required
checking for library containing readline... no
configure: error: readline library not found
If you have readline already installed, see config.log for details on the
failure.  It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.

암튼 뭔가 환경이 부족하다는 메세지이다.
자세한건 config.log 를 참고하라고 되어 있는데, 그냥 귀찮으니까 구글에서
"postgresql 컴파일" 라고 검색해서 방법을 찾도록 한다.

검색을 해보니, 추가적으로 필요한 요소가 있다고 한다.
추가적으로 필요한 요소를 설치하도록 한다.

% yum -y install gcc gcc-c++ boost boost-devel pkgconfig uuidd libtool autoconf make coreutils uuid-dev uuid-devel libuuid-devel e2fsprogs-devel readline readline-devel zlib zlib-devel openssl openssl-devel gettext libxml2-devel

그리고 다시 configure 를 하니, 에러 발생 없이 잘 된다.
이 상태에서 계속 진행을 하면 PostgreSQL 은 기본 설치 디렉토리가 /usr/local/pgsql 가 된다.
취향에 맞게 --prefix 옵션을 통해서 다른 디렉토리에 설치할 수 있다.
나는 물론 귀찮으니, 그냥 설치를 한다.
※ 그 외에도 많은 옵션들이 있으니, 궁금하면 구글에서 찾아봐서 사용하면 된다.

  • 빌드
% make
컴파일을 진행하는 작업이다. 컴퓨터 사양에 따라 시간이 좀 걸릴 수 있으므로, 느긋하게 커피 한잔 하면서 기다리면 된다.

  • 설치
% make install
컴파일 된 결과물들을 /usr/local/pgsql 에 설치하는 작업이다.
그런데 실제로 해보면 에러가 발생한다.

make -C src install
make[1]: Entering directory `/home/ck0911.kim/postgresql-9.6.5/src'
make -C common install
make[2]: Entering directory `/home/ck0911.kim/postgresql-9.6.5/src/common'
make -C ../backend submake-errcodes
make[3]: Entering directory `/home/ck0911.kim/postgresql-9.6.5/src/backend'
make[3]: `submake-errcodes'를 위해 할 일이 없습니다
make[3]: Leaving directory `/home/ck0911.kim/postgresql-9.6.5/src/backend'
/usr/bin/mkdir -p '/usr/local/pgsql/lib'
/usr/bin/mkdir: `/usr/local/pgsql' 디렉토리를 만들 수 없습니다: 허가 거부
make[2]: *** [installdirs] 오류 1
make[2]: Leaving directory `/home/ck0911.kim/postgresql-9.6.5/src/common'
make[1]: *** [install-common-recurse] 오류 2
make[1]: Leaving directory `/home/ck0911.kim/postgresql-9.6.5/src'
make: *** [install-src-recurse] 오류 2

아하.... 이런.... root 계정으로 해야 되는구나.....
왜냐하면 /usr/local 디렉토리는 root 계정으로만 write 할 수 있기 때문이다.

이런씨..... configure 단계부터 다시 해야겠다.
왜냐하면 나는 일반 계정으로 작업을 하고 싶기 때문이다.
prefix 에 자신이 설치하고 싶은 디렉토리를 넣어주면 된다.

% make clean
% ./configure --prefix=/home/ck0911.kim/postgres
% make
% make install

PostgreSQL installation complete.
메세지가 나타나면 잘 설치된 것이다.

실제 postgresql 디렉토리가 생성되어 있는걸 볼 수 있다.
그 디렉토리 안에 들어가면 bin 디렉토리가 보인다.
그 디렉토리 안에 들어가면 실행 가능한 바이너리 파일들이 보인다.
그 바이너리 파일들을 아무대서나 실행할 수 있도록 PATH 에 추가해 준다.

$HOME/.bashrc 맨 마지막에
"export PATH=$PATH:$HOME/postgresql/bin" 구문을 추가해 주면 된다.

※ postgresql 디렉토리로 한번에 이동하거나, 환경설정관련 내용을 사용할 때, 환경변수를 지정해 놓으면 편리하다. 개인적으로 변수를 추가했다. 취향 차이이므로 안해도 상관없다.
% export PG=$HOME/postgresql

화곡 어쩌라고, 굴사냥

석화찜(굴찜)을 먹으러 여의도로 갔다 그런데 재료가 모두 소진되었다고 마감이라고 한다 응? 다들 굴에 미쳤나? 굴을 찾아 헤매다 보니, 화곡까지 가게 되었다. 화곡은 처음 가본다. 첫인상은 "술집 겁네 많네" 피똥쌀때까지 마실 수 있...