无法卸载postsql-xc

一旦我安装了postgres-xc和postgres-xc-client,Postgressql安装就被破坏了。 我尝试卸载但无法执行此操作。 活动日志如下:

postgres@ashUbuntu:~$ sudo apt-get remove --purge postgres-xc-client postgres-xc [sudo] password for postgres: postgres is not in the sudoers file. This incident will be reported. 

试图添加到sudo组但没有帮助。

 postgres@ashUbuntu:~$ sudo usermod -a -G sudo postgres [sudo] password for postgres: postgres is not in the sudoers file. This incident will be reported. 

现在我很震惊,请帮忙。


@AB解决方案有效,能够卸载:

 ashutosh@ashUbuntu:~$ su ashutosh Password: ashutosh@ashUbuntu:~$ dpkg --purge postgres-xc dpkg: error: requested operation requires superuser privilege ashutosh@ashUbuntu:~$ sudo dpkg --purge postgres-xc [sudo] password for ashutosh: (Reading database ... 792513 files and directories currently installed.) Removing postgres-xc (1.1-2ubuntu2) ... * Stopping Postgres-XC datanode [ OK ] * Stopping Postgres-XC coordinator [ OK ] * Stopping Postgres-XC gtm [ OK ] Purging configuration files for postgres-xc (1.1-2ubuntu2) ... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... ashutosh@ashUbuntu:~$ sudo dpkg --purge postgres-xc-client (Reading database ... 792301 files and directories currently installed.) Removing postgres-xc-client (1.1-2ubuntu2) ... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... ashutosh@ashUbuntu:~$ 

我假设,您的用户帐户不是postgres 。 因此请切换到您的帐户

 su - your_user_name 

然后再次开始卸载