xRDP – How To Remove it based on your install option

Hello World, 

Today’s post is again about xRDP software solution.  xRDP is a Linux based software solution that provide remote desktop services capabilities.  After installing the xRDP software layer on a Linux based computer, a user can access the desktop remotely through the RDP protocol. This means that a user working on Windows can access remotely a linux desktop with no need to install any additional software.   

If you are a regular reader of this blog, you problaby know that have been explaining in simple ways how to perform the xRDP installation.  However, some of our readers are also wondering how to remove the xRDP software from their machine.  This question arise usually when there is a problem with the xRDP installation and people want to try from scratch or when they give up… This post will explain how to remove the xRDP software based on the way you have performed the installation..

Let’s quickly see how to perform such easy task….! 

Removing xRDP based on installation process

Remove it when Standard installation has been performed 

So, What’s a standard installation process for xRDP ?  A standard installation means that the standard xrdp package available within the Ubuntu repository has been used to perform the installation.  A fully compiled and package software solution is provided by Canonical and you simply need to execute the apt-get install command to perform the installation.  If you need more information about how to perform a standard installation of xRDP on Ubuntu 17.10, have a look at the following posts 

xRDP – How to Install on Ubuntu 17.10 -Manual Installation

xRDP – How to Install on Ubuntu 17.10 – Automated Install

Before removing xrdp package, the first step would be to stop the service by issuing the following command in a terminal console 

sudo systemctl stop xrdp

When using the standard installation procedure, it’s really easy to remove the xRDP package from your computer.  The command that you have to issue is basically the following 

sudo apt-get remove xrdp

This command will remove the packages but configuration files will not be deleted.  

remove_2

Click on picture for better resolution

To remove packages and any configuration files, you should run the following command 

sudo apt-get purge xrdp

Purge_2

Click on picture for better resolution

In the screenshot, you can clearly see that configuration files are deleted as well. 

You can then reboot your machine and you should not have any xRDP software solution available on your system.  You can then either, try to re-install it if you had problems or use another remote desktop solution….

Remove it when Custom installation has been performed

 you have performed a custom installation of xRDP by running the install-xrdp.sh script (see xRDP – How to perform a custom installation – Scripted Install), it’s still possible to remove the xrdp package from your system. You will not use the built in apt-get remove or apt-get purge command to remove it. To get rid of the xrdp package on your system, you simply need to remove the following files and directories from your system.

  • /etc/xrdp
  • /usr/local/sbin/xrdp
  • /var/run/xrdp.pid
  • /var/run/sesman.pid 

and you would need to clean up the systemd services for xRDP by issuing the following command 

So, again, before uninstalling the xrdp software, you should first stop the service using the command 

sudo systemctl stop xrdp

then you can issue the following command to delete the xrdp files from your system 

rm -r /etc/xrdp 
rm -r /usr/local/sbin/xrdp 
rm /var/run/xrdp.pid
rm /var/run/xrdp-sesman.pid

rm_custom1

Click on picture for better resolution

Then, you can remove the systemd service for xrdp by issuing the following command  

 

sudo systemctl disable xrdp

remove_custom2

Click on picture for better resolution 

Reboot your system so you have a really clean system at this stage…. 

Remove it when Custom installation (with checkinstall) has been performed

If you have been adventurous and you have tried this approach (see this post), the uninstall process is quite easy. Using the checkinstall command when compiling from source makes really easy to remove and re-install the compiled package. checkinstall will basically create a debian package and you can use the standard dpkg command to remove or re-install xrdp software…

So, again, before uninstalling the xrdp software, you should first stop the service using the command 

sudo systemctl stop xrdp

then you can issue the following command to remove the debian xrdp and xorgxrdp package created by the checkinstall from your system.   If you have followed the instructions describe here for the checkinstall, your deb packages are located under ~/Downloads/xrdp and ~/Downloads/xorgxrdp… 

To uninstall the xrdp package, you would simply issue the following command in a terminal console 

sudo dpkg -r xrdp

removecheckinstall_1

Click on picture for better resolution 

To complete the uninstall process, you also need to remove the xorgxrdp package by issuing the following command 

sudo dpkg -r xorgxrdp

removecheckinstall_2

Click on picture for better resolution 

Finally, you can remove xrdp service from the systemd. This is optional but if you want to have a clean system you might want to issue this command 

sudo systemctl disable xrdp

remove_custom2

Click on picture for better resolution 

Reboot your system and check that you cannot remote connect anymore through rdp client.  

Final Notes

As you can see, based on your installation approach, it’s possible to remove the xrdp package in an easy way actually. After explaining so often how to perform a successful installation of xRDP, it’s was time to explain how to remove the xRDP package.   Some people asked me how to remove the xrdp package because they couldn’t get it working and they wanted to redo the installation of xRDP  instead of reinstalling the full Ubuntu operating system.  

This post was due from a long time but I just recently found the time to write it.  Nowadays, the installation process for xRDP is so straight forward that we hope that this post would not be used too often. On the other hand, we are happy to have written this one so xRDP information is becoming quite complete..

Till next time 

See ya

 

4 thoughts on “xRDP – How To Remove it based on your install option

  1. Hi Griffon,
    I followed your instruction for removing custom installation.
    After that I re-installed xrdp via apt-get, this time I totally cannot use.
    It seems there is a dependency error, and the error seems to point to these two files:
    /var/run/xrdp.pid
    /var/run/sesman.pid

    Do you have any ideas on what i should do? I have totally lost the two directory above.

  2. @Johan,
    There should be no dependencies on xrdp.pid and sesman.pid… Have you disabled the service xrdp before deleting the files ?
    DO you have a screenshot of the error or a message error ?
    have you rebooted the machine before trying to install again…. ?
    after removing xrdp, have you checked through systemctl that service is not there anymore….

    The only thing I’m thinking of is that we might need to also remove the xorgxrdp files….. because now the xrdp install comes with this additional component

    Waiting feedback
    Till next time
    See ya

  3. This doesn’t say how to reverse the install of your script in post id# 10513, “Custom Install on 16.04.02”.

  4. @Joey,

    Given the script is using the same installation process, you can assume that the removal process provided in this post should be working also for the custom install for 16.04
    When you perform a custom install (any version), to get rid of it, you simply delete the xRDP files from your system
    Hope this help
    Till next time
    See ya

Leave a Reply