Can someone assist me with removing openvpn from ubuntu 18.04?

So i was trying to install PrivateInternetAccess on my computer and I found some instructions on their website, they had a download for a file but I couldn't figure out how to open the .sh file.

So i went to google and found these instructions. It said to perform the following commands:

sudo apt-get install curl network-manager-openvpn-gnome
wget https://www.privateinternetaccess.com/installer/pia-nm.sh
sudo bash pia-nm.sh

After doing these it installed the VPN but not how I wanted or thought it would. I wanted the application installed and this just put all the VPN connections in my network settings under VPN.

Anyway I figured out how to install the application like I wanted, and now I'm trying to undo where I installed OpenVPN and the other commands. I want to remove the VPN connections from my network settings.

I did the following:

sudo apt-get remove curl network-manager-openvpn-gnome

This seemed to remove the software. But it is still installed apparently. I did this to check if it was removed:

dpkg --list openvpn

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                 Version         Architecture    Description
+++-====================-===============-===============-=============================================

pi  openvpn              2.4.4-2ubuntu1. amd64           virtual private network daemon

(also, the pi next to open VPN was ii earlier, now its showing as pi. Dont know if thats important)

but it shows up anyway. So i noticed when i first installed Ubuntu that it had a VPN section in my network settings from the beginning. Is OpenVPN just part of the system? I tried to remove it again with

sudo dpkg -r openvpn
sudo dpkg --purge openvpn

Both of these failed saying there were dependency problems. I mean its not the end of the world if I cant remove it, but I'd like to know how to. Also can someone help me with understanding how to remove the VPN connections?

I dont know how to undo what I did and google isnt helping me very much with this. I know I could go through each connection inside my network settings and click the gear and then click remove, but i want to know how to undo it from terminal.


Solution 1:

I don't know why you used dpkg to remove OpenVPN, in that case try again but with apt this time.

First, fix any dependencies problem that you might occur, by adding --fix parameter on apt.

sudo apt -f install

Finally, remove openvpn with all their dependencies.

sudo apt purge openvpn

Please report back any error, if any.

Solution 2:

• To delete your OpenVPN profiles via shell,

ll /etc/NetworkManager/system-connections/

You'll see all your saved connections. Use command sudo rm -vf connection_name to delete the OpenVPN profiles you want, you can use regular expressions like sudo rm -vf US* to remove all the profiles that start with "US".

pi from dpkg --list openvpn says the state of the openvpn package, p = the desired state (marked for action) of openvpn which is purged (that you did), i = the current state of the package which is installed (meaning it's not removed yet). ii meant i = desired state installed, i = current state installed.

• Depending on how you installed openvpn there are many possibilities, it's possible that PIA is interfering with the package or PIA is a opnvpn client and depends on it. Try to fix broken packages with sudo apt --fix-broken install, completely remove PIA, then remove openvpn. Anyway if it doesn't work, try this command sudo dpkg --purge --force-all openvpn. If all fails, then you might have to search & manually delete all binary files of openvpn.

• You might also want to consider reinstalling curl, it comes pre-instaled with Ubuntu and an important download utility, sudo apt install curl