7

I've been using Bash on Ubuntu on Windows since its been announced in beta and have tools installed, bashrc configurations, etc. From what I understand, its not really supported anymore and I have to move to the official store app for Canonical updates and support. What is a sure way routine of doing this without having the reinstall tools and packages?

6
  • You shouldn't have to reinstall anything. The current version should continue to work, you will have to either update WSL yourself manually, or continue using the version you already have installed. I think you mean the Fall Creator Update since WSL was still beta on Creators Update (1703)
    – Ramhound
    Oct 31, 2017 at 2:17
  • What is the process to update WSL manually? is this update part of updating within Ubuntu or within Windows?
    – bl4kh4k
    Oct 31, 2017 at 2:20
  • A small level of research is expected: superuser.com/questions/1103675/… do-release-upgrade. You shouldn't have to reinstall, you have WSL Ubuntu installed, I suspect even if you installed WSL Ubuntu from the Store your current environment would be saved.
    – Ramhound
    Oct 31, 2017 at 2:21
  • Thank you for your help. Looks like a batch script can make this automated as well. Cheers.
    – bl4kh4k
    Oct 31, 2017 at 2:24
  • While upgrading might indeed work, MS officially suggests the following, "We recommend that you migrate your files off the legacy instance and replace it with a store-delivered instance, so that you receive the support of Canonical and Microsoft moving forward.. I’d recommend copying any files you want to keep to somewhere on your Windows filesystem, e.g.: /mnt/c/temp/backups and then copying them back into your new instance"
    – Ramhound
    Oct 31, 2017 at 2:29

1 Answer 1

5

As Ramhound mentioned, MS officially suggested migrating files to the new store-delivered instance (I guess the legary lxrun-installed instance will never receive 18.04 LTS or any later version). I have yet to do the migration, but I think the reasonable way of moving into new instance is like this:

  1. Start sshd on the old instance: sudo /usr/sbin/sshd -D

  2. Run scp from the new instance: scp -r localhost:~/* /tmp/ - this will keep your file modes, while copying to a Windows filesystem will destroy them (setting everything to 0777)

  3. Replace, with sudo, the directory tree in the new instance with what you just copied.

Be sure that nothing is running in the background of WSL if you're going to replace system directories. You will need to copy /bin, /etc, /home, /opt, /sbin, /usr, and /var if you want a full recovery, but only doing /home, /opt, and /usr/local (which contains libraries installed or compiled manually) and install repository packages again with apt might be a safer option.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .