If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: How to connect to internet from command line using nmcli

You should at least know a method you connect to your ISP. Common configuration is a router with a built in modem that connects and maintains an Internet connection for all machines on a local network. In that case you need to login to your router through a web browser interface in order to give it command to connect. Some routers provides command line interface, but that varies between routers and that may be too complicated. There are some command line web browsers, but you would probably need an Internet connection to install them.

How about using some other device to connect your router to the Internet, like a smartphone.

Re: How to connect to internet from command line using nmcli

>Smartphone wont connect as my computer does not have builtin WiFi router etc.

Not really, you can set your phone to allow "usb tethering"

Plug the phone to your laptop usb port (needs a microusb to usb cable).
Then set the phone for USB Tethering
(for example in my Android "Nougat" 7.1.1, you go to "Settings"-> "Connections" -> "Mobile Hotspot and Tethering" -> check on the "USB tethering" slider,
the slider will only activate if a usb cable is plugged into a working remote port)

Activate that interface in your computer as your network and you are online. The last step will likely need a nmcli command in your situation with the missing packages you have lost

Re: How to connect to internet from command line using nmcli

Originally Posted by marko

>Smartphone wont connect as my computer does not have builtin WiFi router etc.

Not really, you can set your phone to allow "usb tethering"

Plug the phone to your laptop usb port (needs a microusb to usb cable).
Then set the phone for USB Tethering
(for example in my Android "Nougat" 7.1.1, you go to "Settings"-> "Connections" -> "Mobile Hotspot and Tethering" -> check on the "USB tethering" slider,
the slider will only activate if a usb cable is plugged into a working remote port)

Activate that interface in your computer as your network and you are online. The last step will likely need a nmcli command in your situation with the missing packages you have lost

except that USB tethering is disabled by some wireless providers unless you pay additional for it.

Re: How to connect to internet from command line using nmcli

For working with networkmanager from the command line, you could try using nmtui
You may have to install it, I seem to recall nmtui was not included by default when I last installed a fedora 28 xfce spin and I had to install the NetworkManager-tui package

Re: How to connect to internet from command line using nmcli

To make things worse than I accidentally uninstalled gdm too.

Have you tried simply entering startx at the command line ? You don't need gdm or any desktop manager to start your GUI. If you still have your X-Window system and your desktop environment ( Gnome or whatever you are using ) installed startx should bring up the GUI. Then you can use the Network Manager GUI.

Code:

$ type startx
startx is /usr/bin/startx
NAME
startx - initialize an X session
SYNOPSIS
startx [ [ client ] options ... ] [ -- [ server ] [ display ] options ... ]
DESCRIPTION
The startx script is a front end to xinit(1) that provides a somewhat nicer user interface for running a single session of the X Window System. It is
often run with no arguments.

Re: How to connect to internet from command line using nmcli

Thank You everyone, the problem is now solved.

@Marko: Yes, these smartphone steps worked just fine. In-fact after following the steps i did not even have to use nmcli command or anything else. I was connected to the internet, i installed gdm and updated everything else and also installed NetworkManager-tui.
But when i rebooted i again came to tty instead of gui, so i saw that gdm was disabled from this command:

systemctl status gdm.service

So i enabled it using the following command:

systemctl -f enable gdm.service

I rebooted the computer and the problem is solved. Back from the dead.

@Doug G: I have installed NetworkManager-tui and will try this.

@amiga: Unfortunately (rather fortunately) i could not try startx because i already sorted the things before i saw your reply. May be some other day. It sounds interesting.