Skip to content

Instantly share code, notes, and snippets.

@jarun
Created May 16, 2021 07:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarun/d118d8dd9490e094dd1c470f28d50e52 to your computer and use it in GitHub Desktop.
Save jarun/d118d8dd9490e094dd1c470f28d50e52 to your computer and use it in GitHub Desktop.
How to reinstall network-manager after accidental removal from terminal
  1. Look up the interface
$ sudo iw dev                            
phy#0
	Unnamed/non-netdev interface
		wdev 0x3
		addr 98:54:1b:0a:9f:16
		type P2P-device
		txpower 0.00 dBm
	Interface wlp1s0
		ifindex 2
		wdev 0x1
		addr 98:54:1b:0a:9f:15
		ssid Bukur Bari 5G
		type managed
		channel 44 (5220 MHz), width: 80 MHz, center1: 5210 MHz
		txpower 22.00 dBm
		multicast TXQ:
			qsz-byt	qsz-pkt	flows	drops	marks	overlmt	hashcol	tx-bytes	tx-packets
			0	0	0	0	0	0	0	0		0
  1. Check if it's connected to an SSID
$ sudo iw wlp1s0 link
Not connected.
  1. Optionally scan for your SSID if you don't remember the name
sudo iw wlan0 scan
  1. Edit /etc/network/interfaces and add your interface
sudo vi /etc/network/interfaces

auto wlp1s0
iface wlp1s0 inet dhcp
wpa-essid My Wireless
wpa-psk ****
  1. Restart the interface
ifdown wlp1s0 && sudo ifup -v wlp1s0
  1. See if you can reach google
ping www.google.com
ping: www.google.com: Temporary failure in name resolution
  1. Add google free DNS server to /etc/resolv.conf
sudo vi /etc/resolv.conf

nameserver 8.8.8.8
  1. Restart name resolution service
sudo systemctl restart systemd-resolved.service
  1. Now your network should be up and running. Install network-manager
sudo apt-get install network-manager
  1. Remove the entry from /etc/network/interfaces