0

I was having problems upgrading from 20.04 to 20.10. I read on SO that someone fixed the issue by uninstalling libssh-4, so I ran sudo apt remove libssh-4. To my horror a lot of things were removed, including Libre Office, network services and many other things.

The prompt showed a list of what would be removed, but it didnt include network services, eg:

The following packages were automatically installed and are no longer required:
  libiw30 libkeybinder0 libnghttp2-14 librtmp1 libwnck-common libwnck22 libxres1 lxpanel-data
Use 'apt autoremove' to remove them.

I now have no wifi or ethernet capabilities. And I dont have a usb stick present with which to try re-installing.

Is there way I can reinstall networking capabilities?

Magick
  • 174
  • "To my horror a lot of things were removed" ... When you run this command, it generates a summary of what will happen if you hit Y and Enter. My intention isn't to rub it in, but this was avoidable. If you have a list of packages you need to reinstall (check apt logs) then you can search on AU for how to install software without an Internet connection. But honestly you're probably better off to reinstall the system. – Nmath Nov 13 '20 at 05:25
  • It only said libssh-4 would be removed. I definitely wouldnt have proceeded if I had seen a lenghtly list of components that I depend on. – Magick Nov 13 '20 at 05:36
  • If that's really true, you've discovered an outrageous bug and should file a bug report. – Nmath Nov 13 '20 at 05:38
  • Then run sudo systemctl restart network-manager and see what happens. – mchid Nov 13 '20 at 06:01
  • Ok, that did start the network manager! However the wifi and networking settings GUI have also been removed. How can I now configure networking? – Magick Nov 13 '20 at 06:04
  • Have you tried to reboot? – mchid Nov 13 '20 at 06:12
  • @Magick See below. – mchid Nov 13 '20 at 06:41

2 Answers2

0

To figure out what was uninstalled, you can run the following command:

cat /var/log/apt/history.log | grep -A3 'apt remove libssh-4' | sed 's/([^)]*)//g;s/,//g'

Then, you can either download the deb files from https://packages.ubuntu.com and manually install them

or you should still have networking capabilities through network-manager

First, run the following command to start NetworkManager:

sudo systemctl start network-manager

Then, try running an update command to see if you have networking capabilities (you should have full network capabilities):

sudo apt update

If you don't have a network set up, you can use nmcli commands to connect to the network.

First, scan for networks:

sudo nmcli device wifi rescan

Then, list your available networks by SSID:

nmcli device wifi list

Finally, use the following command to connect to a network:

sudo nmcli device wifi connect SSID password wireless-password

and replace "SSID" and "wireless-password" with the correct parameters


Once you have your network up again, you can reinstall the uninstalled packages.

Source: nullr0ute.com

Click here for more information.

mchid
  • 43,546
  • 8
  • 97
  • 150
0

If

sudo systemctl restart network-manager

code worked, then try this: check which network adapter is from your ethernet (probably "eth0") and see if has an ipaddress.

ifconfig

If not, then you can do this:

sudo nano /etc/network/interfaces

and enter the following two lines:

auto eth0

iface eth0 inet dhcp

Then do CTRL+O and press enter Then CTRL+X And use the command below again:

sudo systemctl restart network-manager

If it worked you can reinstall your packages again from the internet

But I actually recommend you to just reinstall Ubuntu when possible, because as you say, you don't know which packages are missing, so you can run into trouble later if you miss some important ones.


EDIT: as @mchid just commented, you can check the missing packages using

sudo nano /var/log/apt/history.log

I didn't know that, so I learned some more things today :)