Note: This How To article assumes that user has a system where internet was working properly until something went wrong. It is rare but possible that things get broken deeper in the system and other system functions would need to be enabled from terminal for internet to work again. If you have such an issue please ask us in support forum. The following has worked for and been tested numerous times by the author.
Note-2: If any user has questions about the following please ask in support forum.
Sometimes when things don’t work as they should a user may need to boot in to console mode or recovery mode instead of Plasma desktop in order to do maintenance or repair.
Or:
Then user may find that wifi does not work in these modes. To connect to wifi from command line you use the nmcli command. Example:
To determine what device to connect run this command:
$ nmcli dev status
This will list any available network devices. In my instance I know that I am wifi but not wifi-p2p and the command lists my wifi device as wlp4s0 so to connect:
$ nmcli --ask dev con wlp4s0
This should ask for your wifi password and then connect your wifi. Now user can do any maintenance or repairs that require internet access.