wsl2에서 code 관련된 package를 제거한 다음에 다시 설치하면 된다.
1. 에러 발견
hklee@DESKTOP-O3S1JC0:~$ code .
To use Visual Studio Code with the Windows Subsystem for Linux, please install Visual Studio Code in Windows and uninstall the Linux version in WSL. You can then use the `code` command in a WSL terminal just as you would in a normal command prompt.
Do you want to continue anyway? [y/N] y
To no longer see this prompt, start Visual Studio Code with the environment variable DONT_PROMPT_WSL_INSTALL defined.
2. VSCode에서 extension제거
visual code의 extension 에서 Remote - WSL 제거
(안해도 될것 같지만 혹시나해서 해봤다)
3. WSL2에서 code 제거
hklee@DESKTOP-O3S1JC0:~$ sudo apt purge code
[sudo] password for hklee:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
adwaita-icon-theme at-spi2-core fontconfig gtk-update-icon-cache hicolor-icon-theme humanity-icon-theme
libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-client3 libavahi-common-data libavahi-common3
libcairo-gobject2 libcairo2 libcolord2 libcups2 libdatrie1 libepoxy0 libgbm1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-bin
libgdk-pixbuf2.0-common libgraphite2-3 libgtk-3-0 libgtk-3-bin libgtk-3-common libharfbuzz0b libjbig0 libjpeg-turbo8
libjpeg8 liblcms2-2 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0
librest-0.7-0 librsvg2-2 librsvg2-common libsecret-1-0 libsecret-common libsoup-gnome2.4-1 libthai-data libthai0
libtiff5 libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebp6 libxcb-render0 libxcb-shm0 libxkbcommon0
libxss1 ubuntu-mono
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
code*
0 upgraded, 0 newly installed, 1 to remove and 222 not upgraded.
After this operation, 296 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 85267 files and directories currently installed.)
Removing code (1.59.1-1629375198) ...
Processing triggers for shared-mime-info (1.15-1) ...
Processing triggers for mime-support (3.64ubuntu1) ...
(Reading database ... 83161 files and directories currently installed.)
Purging configuration files for code (1.59.1-1629375198) ...
hklee@DESKTOP-O3S1JC0:~$ code
-bash: /usr/bin/code: No such file or directory
hklee@DESKTOP-O3S1JC0:~$
3. VSCode에서 extension 설치
visual code에서 Remote - WSL 설치
4. WSL2에서 다시 code 설치
hklee@DESKTOP-O3S1JC0:~$ code .
Updating VS Code Server to version 3866c3553be8b268c8a7f8c0482c0c0177aa8bfa
Removing previous installation...
Installing VS Code Server for x64 (3866c3553be8b268c8a7f8c0482c0c0177aa8bfa)
Downloading: 100%
Unpacking: 100%
Unpacked 2086 files and folders to /home/hklee/.vscode-server/bin/3866c3553be8b268c8a7f8c0482c0c0177aa8bfa.