sudo systemctl stop nxserver.service
sudo systemctl disable nxserver.service
sudo apt-get remove --purge nomachine
sudo rm -rf /usr/NX
sudo rm -rf ~/.nx
sudo apt-get autoremove
sudo apt-get autoclean
aptモジュールをアンインストール例

sudo systemctl stop nxserver.service
sudo systemctl disable nxserver.service
sudo apt-get remove --purge nomachine
sudo rm -rf /usr/NX
sudo rm -rf ~/.nx
sudo apt-get autoremove
sudo apt-get autoclean