Can someone assist me with removing openvpn from ubuntu 18.04?

53,963

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

Share:
53,963

Related videos on Youtube

Rusynic
Author by

Rusynic

Updated on September 18, 2022

Comments

  • Rusynic
    Rusynic almost 2 years

    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.

  • Rusynic
    Rusynic over 5 years
    Okay cool, this worked and now when i do: dpkg --list openvpn it doesnt show up. I used dpkg because i saw it in youtube videos. Should i just use apt instead? im just trying to learn the best way to do things.
  • Rusynic
    Rusynic over 5 years
    This worked also, the terminal displayed each connection being removed. I used sudo rm -vf PIA* because each connection was marked with PIA at the front. After that i restarted the network manager with sudo service network-manager restart and then all the connections were gone from the VPN menu. Much appreciated. Also thanks for explaining what pi, ii and all that means. Now i know what im looking at.
  • Rusynic
    Rusynic over 5 years
    I keep trying to mark this as the answer by clicking the check mark but it won't let me. And i tried to vote up on the other answer because it was also helpful but it wont let me do that either. I will try again later.
  • Liso
    Liso over 5 years
    @Rusynic why do you un-accept the answer ?
  • Rusynic
    Rusynic over 5 years
    I dont know what im doing. I am trying to select it as the answer.
  • Jeremy Andrews
    Jeremy Andrews about 4 years
    Thanks it worked except for : dpkg: warning: while removing openvpn, directory '/var/log/openvpn' not empty so not removed dpkg: warning: while removing openvpn, directory '/etc/openvpn/client' not empty so not removed I then manually removed those
  • Admin
    Admin about 2 years
    This didn't work for me, it still shows up and the service is still running. $ 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 +++-==============-============-============-===============‌​================== un openvpn <none> <none> (no description available)