Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninstalling valet #115

Closed
dakira opened this issue Oct 22, 2017 · 33 comments
Closed

Uninstalling valet #115

dakira opened this issue Oct 22, 2017 · 33 comments
Milestone

Comments

@dakira
Copy link

dakira commented Oct 22, 2017

We need a clear path or docs on how to get back to the state pre-valet. I just upgraded my Ubuntu from 17.04 to 17.10 and have absolutely no idea on how to get back network connectivity. The uninstall script just breaks (can't find php-fpm configuration) but I happen to know that it would tell me anyway that I need to manually restore my network connectivity.

With previous versions of valet I was easily able to undo the changes. Now I'm really not sure what valet has done and how to undo it.

Please read the documentation on uninstalling.

Only if it doesn't help, comment here with the specific steps you've taken and at what point they failed.

@dakira
Copy link
Author

dakira commented Oct 22, 2017

Something like this should be in the documentation:

  1. rm /opt/valet
  2. remove valet-specific settings in /etc/NetworkManager/{conf.d,dnsmasq.d}
  3. remove /etc/dnsmasq.d/{valet,options}
  4. Make sure resolved is running, if not, enable and start it systemctl status systemd-resolved.
  5. remove the dnsmasq package (leaving dnsmasq-base!)
  6. rm /etc/resolv.conf && ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
  7. restart NetworkManager systemctl restart NetworkManager.service

@dakira
Copy link
Author

dakira commented Oct 22, 2017

Maybe valet should have some kind of install migrations. So for every installation step, save a script somewhere that ondoes it?

@cpriego cpriego added this to the v2.0.23 milestone Oct 25, 2017
@cpriego cpriego modified the milestones: v2.0.24, v2.0.25 Apr 8, 2018
@cjlaborde
Copy link

What steps should be taken for Ubuntu 18.04? I notice some of those steps different in 18.04.

@dakira
Copy link
Author

dakira commented Aug 13, 2018

@cjlaborde Should still be the same.. nothing changed networking-wise.

@cjlaborde
Copy link

cjlaborde commented Aug 17, 2018

Thank you Dakira. Here steps I followed are they ok? I am stuck in step 5.

  1. rm /opt/valet-linux

(File name changed)

2.remove valet-specific settings in /etc/NetworkManager/{conf.d,dnsmasq.d}

a. /etc/NetworkManager/dnsmasq.d
(empty inside)
b. /etc/NetworkManager/conf.d
(valet.conf inside) Delete this file right?
3. remove /etc/dnsmasq.d/{valet,options}

5.remove the dnsmasq package (leaving dnsmasq-base!)
How to do this? deleting a file or through terminal if file where is it located?

@dakira
Copy link
Author

dakira commented Aug 21, 2018

@cjlaborde sorry, but explaining Ubuntu package management goes beyond what we can do here. Install synaptic and use that to search for dnsmasq and you will see the installed packages.

@j0131n
Copy link

j0131n commented Sep 10, 2018

@dakira Thanks mate! I was experiencing the same issue awhile ago and your solution helped me, I am running ubuntu 18.04.

@cjlaborde as per step 5, just simply run sudo apt remove dnsmasq. Do not worry about dnsmasq-base it won't be deleted, and also a tip if you are having trouble with locating directories from your package you could always run in the terminal: whereis (package or file name)

@cjlaborde
Copy link

cjlaborde commented Sep 14, 2018

Thank you darika and j0131n manage to finally remove valet from my system! and get my internet back to normal.
Another issue in my case was that after restart I was left without internet again.
The problem was this step.
n -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
This command basically creates a shortcut link to /run/systemd/resolve/resolv.conf as etc/resolv.conf
But if systemd-resolved is not enable at restart it will not create the file /run/systemd/resolve/resolv.conf
so the shortcut link in /etc/resolv.conf will not be able to read from /run/systemd/resolve/resolv.conf
Fixed the issue by
▶ sudo systemctl enable systemd-resolved

The where the whole issue is at this file resolv.conf
https://i.imgur.com/nhaD7KD.png

To follow step 5. Uninstall dnsmasq through synapic
https://i.imgur.com/2wFkjaH.png
or
sudo apt remove dnsmasq

@dakira
Copy link
Author

dakira commented Sep 20, 2018

@cjlaborde looks like you missed my step4 which caused your problem.

@wout
Copy link

wout commented Feb 27, 2019

@dakira Thanks for this! To be honest, this should somehow be part of the package.

valet disappear

@wout
Copy link

wout commented Feb 28, 2019

I'd like to add that in my case (Ubuntu 18.10), I had to re-enable systemd-resolved. Otherwise, it wouldn't start after a reboot:

sudo systemctl enable systemd-resolved.service

Now, everything seems to be back to normal.

@cjlaborde
Copy link

I'd like to add that in my case (Ubuntu 18.10), I had to re-enable systemd-resolved. Otherwise, it wouldn't start after a reboot:

sudo systemctl enable systemd-resolved.service

Now, everything seems to be back to normal.

Great you got it resolved, I almost had to reinstall the entire Distro do to this issue..
I had same issue in 18.04 solved mine with.
▶ sudo systemctl enable systemd-resolved
As I mentioned above.

@jmarcher
Copy link
Collaborator

Closing this issue as it seems to be resolved.

@ladsoftware
Copy link

My solution:

  1. backup my files.
  2. do a clean installation.
  3. Stay away from valet.

@jmarcher
Copy link
Collaborator

jmarcher commented May 3, 2019

@ladsoftware If you have any issues just post them here, no need to be sarcastic.

@bergstar
Copy link

This issue is not resolved. On Ubuntu 19.10 it leaves user without access to internet. Also, please keep in mind, the very reason people are using Valet - is to get an easy start.

There should be a clear warning to a user, that after running valet uninstall user will be left without access to the internet. Or at least a warning in the getting started documentation, so user is at least aware of how to fix the issue.

@jmarcher
Copy link
Collaborator

I added a new section in the documentation for this problem.

Note that I use Manjaro and not Ubuntu, therefore I can not test problems with Ubuntu.

@dakira
Copy link
Author

dakira commented Jun 27, 2019

@bergstar As Ubuntu 19.10 hasn't even been released, yet, I would assume that beta-testers also know how to fix their own network stack. That aside, My checklist above still works for 19.04 (just tried it).

@mwkcoding
Copy link

@dakira I am on Ubuntu 19.04 running natively on my machine alongside windows. I'm also ending up without any internet connection after following those steps. When I try to ping it goes "Temporary failure in name resolution".

@dakira
Copy link
Author

dakira commented Aug 12, 2019

@mwkcoding My steps are not a step by step solution. In Point I hint at checking the status of systemd-resolved. It that's not running, you need to run and enable it. Seems like that wasn't clear. Check out the updated documentation.

Repository owner deleted a comment from thekiharani Nov 21, 2019
@hareendranmg
Copy link

I'd like to add that in my case (Ubuntu 18.10), I had to re-enable systemd-resolved. Otherwise, it wouldn't start after a reboot:

sudo systemctl enable systemd-resolved.service

Now, everything seems to be back to normal.

You are god🔥. Thanks mate🤘

@dakira
Copy link
Author

dakira commented May 18, 2020

The uninstall instructions still seem to be unclear to some, so I updated them once again (PR waiting).

@karsakly
Copy link

Something like this should be in the documentation:

  1. rm /opt/valet
  2. remove valet-specific settings in /etc/NetworkManager/{conf.d,dnsmasq.d}
  3. remove /etc/dnsmasq.d/{valet,options}
  4. Make sure resolved is running, if not, enable and start it systemctl status systemd-resolved.
  5. remove the dnsmasq package (leaving dnsmasq-base!)
  6. rm /etc/resolv.conf && ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
  7. restart NetworkManager systemctl restart NetworkManager.service

worked for me
Thank @dakira for help!

@nipunTharuksha
Copy link

I had the same issue even after following all the above steps. But luckily I found this youtube video and it was able to fix my issue. However, at /etc there was no resolv.conf file when I try to update it. So I created a file there and added the content and it fixed the issue.

Ubuntu 22.04
Valet - 2.2.32

sudo touch /etc/resolv.conf
sudo vim /etc/resolv.conf

add below content.

nameserver 8.8.8.8
nameserver 8.8.4.4 

restart NetworkManager systemctl restart NetworkManager.service

@asertym
Copy link

asertym commented Aug 21, 2022

This whole thing is insanely ridiculous

@dakira
Copy link
Author

dakira commented Aug 21, 2022

This whole thing is insanely ridiculous

Hi, this place is for reporting problems. What exactly are your problems? Are the uninstall instructions insufficient? @asertym

@t0ben
Copy link

t0ben commented Sep 23, 2022

Restart or killing this processes is missing, else the resolv.conf file will be relinked ....

root 2074 0.0 0.0 2700 32 ? S Sep14 0:00 inotifywait -q -m -e modify -e create -e delete --format %w%f /run/NetworkManager /opt/valet-linux/custom-nameservers
root 2075 0.0 0.0 7972 876 ? S Sep14 0:01 bash /opt/valet-linux/valet-dns start

@haidarzhy
Copy link

For me after systemctl restart NetworkManager.service symlink /etc/resolv.conf was constantly re-created to missing file /opt/linux-valet

So I had to additionally remove valet-dns service:

systemctl stop valet-dns
systemctl disable valet-dns
rm /etc/systemd/system/valet-dns.service
systemctl daemon-reload
systemctl reset-failed

only after that problem was solved

@ryancwalsh
Copy link

ryancwalsh commented Feb 10, 2023

Thank you, @haidarzhy !!

Team, please update the instructions at https://cpriego.github.io/valet-linux/#uninstalling.

And as others have mentioned above in this issue, also consider warning people during the installation (and/or making the overall setup less error-prone).

I haven't used valet-linux for years and forgot all about it.

Then I upgraded my Ubuntu installation recently and lost my internet connection every time I woke the computer from sleep.

I wasted a whole day on this problem.

I'm so thankful that I finally found this answer from @haidarzhy here! Thank you!

I think my problem is solved now!

P.S. I think these were some (but not all) of the commands that I needed:

composer global remove cpriego/valet-linux
sudo rm -rf /opt/valet-linux/
sudo systemctl revert systemd-resolved
sudo systemctl restart systemd-resolved
sudo apt-get remove dnsmasq
sudo rm /etc/resolv.conf
sudo ln -s /run/resolvconf/resolv.conf /etc/resolv.conf
sudo systemctl stop valet-dns
sudo systemctl disable valet-dns
sudo rm /etc/systemd/system/valet-dns.service
sudo systemctl daemon-reload
sudo systemctl reset-failed
sudo systemctl restart NetworkManager

@dakira
Copy link
Author

dakira commented Feb 10, 2023

Hey. I will try this on some blank Linux installs and update the documentation as soon as I get back from holidays. Thanks for the info @haidarzhy and @ryancwalsh. Maybe we can get this into the uninstall command.

@haidarzhy
Copy link

One more small step is to remove php-fpm pool valet.conf so you don’t have additional php processes running.

@lukastom
Copy link

From a philosophical standpoint, I believe that if a program installs something, it should remove 100 % of this stuff during uninstall. To not delete leftovers is so Windows-like :-)

@haidarzhy
Copy link

Even after the last steps I had a weird problem: DNS lookup for new websites took 30 seconds, after some research I found not working nameservers in /etc/resolv.conf so I reverted it to the default state with:
sudo apt-get install --reinstall resolvconf but now I see some warnings after clicking Power Off or Reboot.

I someone has better ideas how to clean resolv.conf, share please here. I'm ok with these warnings though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests