Navigate to the assigned directory for the PostgreSQL data, and then use the rm command to delete all of your databases and tables. Once you’ve located the package, use YUM’s remove command to uninstall PostgreSQL from your Linux system: 1 Uninstall the PostgreSQL package using YUM remove You can also use grep in conjunction with YUM’s list command to return a list of all package instances of PostgreSQL: 1 If you prefer, you can shorten the search to something like post as well: 1 You can use the rpm command with the -qa options to grep for any packages that contain “postgres” in their name: 1 Grep for the PostgreSQL packages in Fedora using ‘rpm’ Instead, use the su (switch user) command to enter as root and execute the above commands with elevated privileges if necessary. NOTE: Keep in mind that sudo is not enabled for RHEL users by default. To use a wildcard operator ( *) to remove all packages with names beginning with postgres, use the following command: 1īe sure to remove the pgsql directory as well: 1 You can use the YUM repository’s yum command to uninstall PostgreSQL on Fedora-based distributions of Linux such Red Hat or CentOS: 1 Uninstall and remove PostgreSQL packages on Fedora Linux Use the rm command with the -rf options to recursively remove all of the directories and data for the postgresql packages: 1Īfter you complete your rm commands, execute the dpkg -l | grep postgres command one more time to verify that all of the packages have been removed. Remove all of the PostgreSQL data and directories This command will remove the package and purge all the data associated with it: 1 An example of this command is shown below: 1įinally, make sure to use the APT-GET repository’s -purge remove command, followed by the postgres package name. You can use the dpkg command for managing Debian packages, in conjunction with grep, to search for all the package names installed that contain the sub-string postgres. Grep for all PostgreSQL packages in Debian Linux Sudo apt-get –purge remove postgresql postgresql-doc postgresql-common You can use the apt-get command to completely remove PostgreSQL on a Debian-based distribution of Linux such as Linux Mint or Ubuntu: 1 Uninstall and remove PostgreSQL on Debian Linux NOTE: Be sure to elevate the privileges for any of the commands in this article with sudo if the terminal returns a Permission denied error. In this article, we’ll explain how to uninstall PostgreSQL from Linux, macOS and Windows operating systems. It’s important to know how to uninstall PostgreSQL properly to make sure all components of the package are completely removed and you don’t encounter any errors. Use "service postgresql initdb" to initializeĬan someone help, ID what I am doing wrong? Using postgresql-9.2-1.19.If you’re using PostgreSQL, you may need to remove the package from your system at some point. So I try to start the postgresql, which fails too var]$ sudo service postgresql start Lrwxrwxrwx 1 root root 10 mail -> spool/mail Then try initdb, which for some reason fails, /]$ sudo service postgresql initdbīut when I check though, the initdb does create pgsql folder, var]$ ls -lĭrwxr-xr-x 9 root root 4096 Sep 18 09:54 cacheĭrwxr-xr-x 3 root root 4096 Nov 8 06:34 ftpĭrwxr-xr-x 20 root root 4096 Oct 14 07:34 libĭrwxrwxr-x 5 root lock 4096 Jan 21 04:36 lockĭrwxr-xr-x 7 root root 4096 Jan 21 09:31 log I first delete postgres using commands below. Trying to install postgreSQL, and looks liked I have messed something up.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |