Reinstalling and/or wiping out all data (factory resetting) Network Manager

I thought it would be most appropriate if I posted this in the software tag, as I’m just trying to reinstall/factory reset the network manager program, not seeking a fix for a certain problem (although I hope it will help with the problem I have in the end).

What I am trying to do is exactly what’s in the title - either reinstall or factory reset the network manager so that absolutely no configuration settings, past connections, or any other data remains in the program besides the data that it comes with right out of the box. The only solutions I’ve found online are for Ubuntu systems, so the command lines are for apt, not pacman. I don’t know how to do this through pacman myself.

Background (not necessary to read):
The network manager works fine, connecting to every WiFi connection except one. My router has 2 “WiFi’s” - a 5Ghz connection and a 2.4Ghz connection, each with a different SSID but the same configuration (except the frequency, obviously) - I can connect to the 5Ghz network but not to the 2.4Ghz one - and I think it’s because the 2.4Ghz network has the same SSID as the previous WiFi I had before replacing the router. So maybe something went wrong and the network manager is confusing the current WiFi with the older, now non-existent, previous one I had. Otherwise I couldn’t find an explanation as to why everything else except this particular connection just works. I tried deleting the data for that network both through the system settings module and through deleting the file directly from /etc/NetworkManager/system-connections/NETWORKNAME, both did not fix the problem. I know that reinstalling all of network manager is probably overkill, but I can’t think of any other option.

Removing a package will not remove also its ‘save files’ by default.
To do that (n) along with dependencies (s) it would look something like:

sudo pacman -Rns networkmanager

It also wont touch anything in your HOME … so you might need to go looking in there, though there isnt much besides ~/.local/share/networkmanagement/certificates


Thank you! Would it work if I uninstalled the network manager and used a cable connection to reinstall it, or would I still not have access to the internet? Should I just download a package instead?
I will still have a backup in case I break things beyond repair (although I’d much rather not use it). I’d appreciate it if you could explain a reinstallation process to me like I’m a 5 year old - sort of step by step.

In your case if you must remove networkmanager I might suggest using -dd in the flag as well to avoid removing its dependencies as well.

The package should still be in the cache so you shouldnt need to redownload it.

sudo pacman -U /var/cache/pacman/pkg/PACKAGE-VERSION.tar.xz

So … in the terminal you would enter each of the following commands:

sudo pacman -Rnsdd networkmanager
sudo pacman -U /var/cache/pacman/pkg/networkmanager-1.26.4-1-x86_64.pkg.tar.zst

But back to your original scenario … I might use something like nmcli c show to see if you have the old AP still listed, then nmcli c delete 'My Old Connection'

1 Like

Forgot to mention that I did try the nmcli method and did delete the connection but it still refused to work afterwards.

I did go ahead with reinstalling network manager - everything went smoothly but after a reboot I realized that it still had some left over data that was saved (maybe in /etc/NetworkManager) which wasn’t deleted when uninstalling - I figured that out because I was automatically connected to the 5Ghz network, which shouldn’t have happened if all the data was deleted.

I assume, though I’m not sure, that nothing would go wrong if I deleted network manager, then deleted /etc/NetworkManager (in hopes that no leftover data remains from it), and after that reinstalled the whole thing?

You can check what owns a file ow directory using

pacman -Qo /path/to/thing

Thanks, I checked and it’s owned by networkmanager.

I deleted network manager, i deleted the folder in /etc/, reinstalled network manager.

Rebooted and network manager was working, it was back to it’s default settings… and the connection still doesn’t work. I can’t figure it out for the life of me - it works when I boot on windows (I have a dual boot system) to connect to that particular network, and on Manjaro I can connect to everything else except the connection that I’m having problems with.

Thank you for your help!

Hm. maybe open a new thread with your network issue.
It might get better traction that way.

I did have one open for a day now. I wouldn’t want to spam by starting another.

Another update:

It seems that no matter what I did with the network manager - reinstalling, wiping out data etc. it still wouldn’t have worked - I have tried to access the network from a live USB with a Manjaro KDE iso and it did the same thing even in the live environment. It seems that the problem is from the network manager itself, not just from some “bug”.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.