{"id":3494,"date":"2025-12-29T15:41:02","date_gmt":"2025-12-29T06:41:02","guid":{"rendered":"https:\/\/www.freelifemakers.org\/wordpress\/?p=3494"},"modified":"2026-03-12T19:54:50","modified_gmt":"2026-03-12T10:54:50","slug":"linux-postgresql-install","status":"publish","type":"post","link":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/2025\/12\/29\/linux-postgresql-install\/","title":{"rendered":"[Linux,Xubuntu] PostgreSQL\uc124\uce58"},"content":{"rendered":"\n<p>\ud83d\udc49\ud83c\udffb Xubuntu\ub294 Ubuntu \uae30\ubc18\uc774\ubbc0\ub85c PostgreSQL \uc124\uce58 \ubc29\ubc95\uc774 Ubuntu\uc640 \uc644\uc804\ud788 \ub3d9\uc77c\ud569\ub2c8\ub2e4. \uc544\ub798\uc5d0 \ub2e8\uacc4\ubcc4\ub85c \uc548\ub0b4\ub4dc\ub9ac\uaca0\uc2b5\ub2c8\ub2e4.<br>Since Xubuntu is based on Ubuntu, the PostgreSQL installation process is exactly the same as Ubuntu. We&#8217;ll walk you through the steps below.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \uae30\ubcf8 Ubuntu \uc800\uc7a5\uc18c\uc5d0\uc11c \uc124\uce58 (\uac00\uc7a5 \uac04\ub2e8\ud55c \ubc29\ubc95, \ucd94\ucc9c \ucd08\ubcf4\uc790)<br>Install from the default Ubuntu repositories (simplest method, recommended for beginners)<\/h3>\n\n\n\n<p>\uc774 \ubc29\ubc95\uc73c\ub85c \uc124\uce58\ud558\uba74 Xubuntu\uc758 \ud604\uc7ac \ubc84\uc804(2025\ub144 12\uc6d4 \uae30\uc900 \ucd5c\uc2e0 \ub9b4\ub9ac\uc2a4)\uc5d0 \ub9de\ub294 \uc548\uc815\uc801\uc778 PostgreSQL \ubc84\uc804\uc744 \uc5bb\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br>Installing this way will give you a stable PostgreSQL version that matches the current version of Xubuntu (latest release as of December 2025).<\/p>\n\n\n\n<p>\ud130\ubbf8\ub110\uc744 \uc5f4\uace0 \ub2e4\uc74c \uba85\ub839\uc5b4\ub97c \uc21c\uc11c\ub300\ub85c \uc2e4\ud589\ud558\uc138\uc694:<br>Open a terminal and run the following commands in order:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt install postgresql postgresql-contrib<\/code><\/pre>\n\n\n\n<p>postgresql: \uc11c\ubc84 \ubcf8\uccb4 \/ server body<\/p>\n\n\n\n<p>postgresql-contrib: \ucd94\uac00 \ud655\uc7a5 \uae30\ub2a5 \/ Additional extensions<\/p>\n\n\n\n<p>\uc124\uce58 \ud6c4 PostgreSQL \uc11c\ube44\uc2a4\uac00 \uc790\ub3d9\uc73c\ub85c \uc2dc\uc791\ub429\ub2c8\ub2e4. \uc0c1\ud0dc \ud655\uc778:<br>After installation, the PostgreSQL service will start automatically. Check its status:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status postgresql<\/code><\/pre>\n\n\n\n<p>\ub610\ub294 \/ or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>service postgresql status<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. \ucd5c\uc2e0 \ubc84\uc804 \uc124\uce58 (\uacf5\uc2dd PostgreSQL \uc800\uc7a5\uc18c \uc0ac\uc6a9)<br>Install the latest version (using the official PostgreSQL repository)<\/h3>\n\n\n\n<p>Ubuntu \uae30\ubcf8 \uc800\uc7a5\uc18c \ubc84\uc804\uc774 \uc544\ub2cc \ucd5c\uc2e0 PostgreSQL (\uc608: 17 \ub610\ub294 18)\uc744 \uc6d0\ud560 \uacbd\uc6b0 \uacf5\uc2dd \uc800\uc7a5\uc18c\ub97c \ucd94\uac00\ud558\uc138\uc694.<br>If you want a newer PostgreSQL version (e.g. 17 or 18) than the Ubuntu default repository version, add the official repository.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install -y postgresql-common\nsudo \/usr\/share\/postgresql-common\/pgdg\/apt.postgresql.org.sh<\/code><\/pre>\n\n\n\n<p>\uc2a4\ud06c\ub9bd\ud2b8\uac00 \uc2e4\ud589\ub418\uba70 \uc800\uc7a5\uc18c\ub97c \uc790\ub3d9 \ucd94\uac00\ud569\ub2c8\ub2e4. \uadf8\ub9ac\uace0 \uc544\ub798 \uba85\ub839\uc5b4\ub97c \uc2e4\ud589\ud569\ub2c8\ub2e4.<br>The script will run and automatically add the repository. Then, run the command below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\n# \ucd5c\uc2e0 \ubc84\uc804 \uc790\ub3d9 \uc124\uce58 \/ Install latest version automatically\nsudo apt install postgresql  \n# \ub610\ub294 \ud2b9\uc815 \ubc84\uc804 \uc9c0\uc815 (\uc608: 17) \/ or specify a specific version (e.g. 17)\nsudo apt install postgresql-17<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3.\ud0a4\ubcf4\ub4dc \uc785\ub825\uc774 \uc548\uba39\ud788\uace0 \ubabb \ube60\uc838\ub098\uac08\ub54c<br>When keyboard input doesn&#8217;t work and you can&#8217;t exit<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>psql\uc5d0\uc11c \uac00\ub054 \uc785\ub825 \ubaa8\ub4dc\uac00 \uc774\uc0c1\ud574\uc838\uc11c \ud0a4 \uc785\ub825\uc774 \uc548 \uba39\ud788\ub294 \uac83\ucc98\ub7fc \ubcf4\uc77c \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n\nCtrl + C \ub97c \ud55c \ubc88 \ub20c\ub7ec\ubcf4\uc138\uc694.\n\u2192 \ud604\uc7ac \uc785\ub825 \uc904\uc774 \ucde8\uc18c\ub418\uace0 \uc0c8 \ud504\ub86c\ud504\ud2b8(postgres=#)\uac00 \ub098\ud0c0\ub0a9\ub2c8\ub2e4.\n\uc774\uac8c \uc81c\uc77c \ud6a8\uacfc\uc801\uc778 \uacbd\uc6b0\uac00 \ub9ce\uc544\uc694!\n\uc548 \ub418\uba74 Ctrl + Z \ub20c\ub7ec\uc11c psql\uc744 \uc77c\uc2dc \uc815\uc9c0\ud55c \ud6c4, \ud130\ubbf8\ub110\uc5d0\uc11c fg \uc785\ub825\ud574\uc11c \ub2e4\uc2dc \ubd88\ub7ec\uc624\uc138\uc694.\n\n: \uc774\ub7f0 \ud504\ub86c\ud504\ud2b8 \uc0c1\ud0dc\uc77c\uacbd\uc6b0 q\uc744 \uc785\ub825\ud558\uba74 \ube60\uc838\ub098\uac11\ub2c8\ub2e4.\n\\q \ub098 ctrl + c \ud558\uba74 \uc885\ub8cc\ub429\ub2c8\ub2e4.\n\nSometimes psql's input mode can get weird, making it seem like your keystrokes aren't working.\n\nTry pressing Ctrl + C.\n\u2192 This will cancel the current input line and bring up a new prompt (postgres=#).\nThis often works best!\nIf that doesn't work, press Ctrl + Z to pause psql, then type fg in the terminal to reload it.\n\n: If you see this prompt, type q to exit.\n\\q or Ctrl + C will exit.<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4. PostgreSQL \uc11c\ubc84\uc640 \ud074\ub77c\uc774\uc5b8\ud2b8\ub9cc \uc0ad\uc81c (\ub370\uc774\ud130\ub294 \ub0a8\uae40, \ub098\uc911\uc5d0 \uc7ac\uc124\uce58 \uac00\ub2a5)<br>Delete only the PostgreSQL server and client (leaving data behind, so you can reinstall later)<\/h3>\n\n\n\n<p>\ub370\uc774\ud130\ubca0\uc774\uc2a4 \ud30c\uc77c\uc740 \uadf8\ub300\ub85c \ub0a8\uc544\uc11c \ub098\uc911\uc5d0 \uc7ac\uc124\uce58\ud558\uba74 \uae30\uc874 \ub370\uc774\ud130 \ubcf5\uad6c \uac00\ub2a5.<br>The database files remain intact, allowing you to recover existing data later when reinstalling.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt remove postgresql postgresql-contrib\n\n# \ubd88\ud544\uc694\ud55c \uc885\uc18d \ud328\ud0a4\uc9c0\uae4c\uc9c0 \uc81c\uac70\n# Remove unnecessary dependent packages\nsudo apt autoremove  <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">5.PostgreSQL \uc644\uc804 \uc0ad\uc81c (\uc124\uc815 \ud30c\uc77c + \ub370\uc774\ud130\uae4c\uc9c0 \ubaa8\ub450 \uc81c\uac70, \ucd94\ucc9c \ub300\ubd80\ubd84 \uacbd\uc6b0)<br>Completely uninstall PostgreSQL (removes all configuration files and data, recommended in most cases)<\/h3>\n\n\n\n<p>\ub370\uc774\ud130\ubca0\uc774\uc2a4 \ud30c\uc77c\uae4c\uc9c0 \uc644\uc804\ud788 \uc0ad\uc81c\ub429\ub2c8\ub2e4. \uae30\uc874 \ub370\uc774\ud130\uac00 \ud544\uc694 \uc5c6\uc73c\uba74 \uc774 \ubc29\ubc95 \uc0ac\uc6a9\ud558\uc138\uc694.<br>This will completely delete all of your database files. Use this method if you no longer need your existing data.<\/p>\n\n\n\n<p>\ud83d\udc49\ud83c\udffb #\ubc88\ud638 \ube14\ub7ed \ub2e8\uc704\ub85c \uba85\ub839\uc5b4 \uc2e4\ud589\ud560 \uac83 \/ Execute commands in number block units<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 1. \ud328\ud0a4\uc9c0 \uc644\uc804 \uc81c\uac70 (\uc124\uc815 \ud30c\uc77c\uae4c\uc9c0 \uc0ad\uc81c)\n# Completely remove the package (including the configuration file)\nsudo apt purge postgresql postgresql-contrib postgresql-* pgadmin* -y\n\n# \ub0a8\uc740 \uc885\uc18d \ud328\ud0a4\uc9c0\uae4c\uc9c0 \uc81c\uac70 \/ Remove remaining dependent packages\nsudo apt autoremove -y  \n\n# 2. \ub0a8\uc740 \uc124\uc815 \ud30c\uc77c\uacfc \ub370\uc774\ud130 \ub514\ub809\ud130\ub9ac \uc218\ub3d9 \uc0ad\uc81c\n# Manually delete remaining configuration files and data directories.\nsudo rm -rf \/etc\/postgresql\/\nsudo rm -rf \/var\/lib\/postgresql\/\n\n# 3. PostgreSQL \uc11c\ube44\uc2a4 \uc815\uc9c0 \ubc0f \uc790\ub3d9 \uc2dc\uc791 \ube44\ud65c\uc131\ud654\n# Stop the PostgreSQL service and disable autostart.\nsudo systemctl stop postgresql 2&gt;\/dev\/null\nsudo systemctl disable postgresql 2&gt;\/dev\/null\nsudo systemctl stop postgresql@*-main 2&gt;\/dev\/null\n\n# 4. \ub0a8\uc544 \uc788\ub294 \ubaa8\ub4e0 postgres \ud504\ub85c\uc138\uc2a4 \uac15\uc81c \uc885\ub8cc (\ud575\uc2ec!)\n# Force kill all remaining postgres processes (critical!)\nsudo pkill -9 -u postgres 2&gt;\/dev\/null\nsudo killall -9 -u postgres 2&gt;\/dev\/null\n\n# 5. postgres \ub9ac\ub205\uc2a4 \uc0ac\uc6a9\uc790 \uc0ad\uc81c\n#  Delete the postgres Linux user\n# -- 2&gt;\/dev\/null :\uc5d0\ub7ec \uba54\uc138\uc9c0\uac00 \ubc1c\uc0dd\ud558\uba74 \ucd9c\ub825\ud558\uc9c0 \uc54a\uace0 \ubc84\ub9bc\n# -- 2&gt;\/dev\/null: If an error message occurs, it is discarded without being printed.\n\nsudo userdel -r postgres 2&gt;\/dev\/null || sudo deluser --remove-home postgres 2&gt;\/dev\/null\n\n# 6. postgres \uadf8\ub8f9 \uc0ad\uc81c\n# Delete the postgres group\nsudo groupdel postgres 2&gt;\/dev\/null || sudo delgroup postgres 2&gt;\/dev\/null\n\n# 7. (\uc120\ud0dd) \ub0a8\uc740 \ud30c\uc77c \ucd5c\uc885 \ud655\uc778 \ubc0f \uc0ad\uc81c\n# (Optional) Final check and deletion of remaining files\nsudo find \/ -name \"*postgres*\" -exec rm -rf {} + 2&gt;\/dev\/null<\/code><\/pre>\n\n\n\n<p>\uc0ad\uc81c \ud6c4 \ud655\uc778 \ubc29\ubc95 \/ How to check after deletion<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \uc124\uce58 \uc5ec\ubd80 \ud655\uc778\n# Check if installed\ndpkg -l | grep postgres\n\n# \uc11c\ube44\uc2a4 \uc2e4\ud589 \uc5ec\ubd80 \ud655\uc778\n# Check if the service is running\nsudo systemctl status postgresql\n\n# \"Unit postgresql.service could not be found.\" \uba54\uc138\uc9c0 \ub098\uc624\uba74 \uc644\uc804 \uc0ad\uc81c \uc131\uacf5\n# If the message \"Unit postgresql.service could not be found.\" appears, complete deletion was successful.<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udc49\ud83c\udffb Xubuntu\ub294 Ubuntu \uae30\ubc18\uc774\ubbc0\ub85c PostgreSQL \uc124\uce58 \ubc29\ubc95\uc774 Ubuntu\uc640 \uc644\uc804\ud788 \ub3d9\uc77c\ud569\ub2c8\ub2e4. \uc544\ub798\uc5d0 \ub2e8\uacc4\ubcc4\ub85c \uc548\ub0b4\ub4dc\ub9ac\uaca0\uc2b5\ub2c8\ub2e4.Since Xubuntu is based on Ubuntu, the PostgreSQL installation process is exactly the same as Ubuntu. We&#8217;ll walk you through the steps below. 1. \uae30\ubcf8 Ubuntu \uc800\uc7a5\uc18c\uc5d0\uc11c \uc124\uce58 (\uac00\uc7a5 \uac04\ub2e8\ud55c \ubc29\ubc95, \ucd94\ucc9c \ucd08\ubcf4\uc790)Install from the default Ubuntu repositories (simplest method, recommended for beginners) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,1],"tags":[],"class_list":["post-3494","post","type-post","status-publish","format-standard","hentry","category-linux","category-uncategorized","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/3494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=3494"}],"version-history":[{"count":35,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/3494\/revisions"}],"predecessor-version":[{"id":5017,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/3494\/revisions\/5017"}],"wp:attachment":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=3494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=3494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=3494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}