9

I'm experiencing an issue with Visual Studio Code on my Ubuntu 22.04 system. I accidentally executed an incorrect command in the terminal, and since then, VS Code hasn't been working properly. Here are the details:

I intended to open a folder in VS Code using code . , but I mistakenly typed code ,

This command seems to have caused issues, and now VS Code fails to launch. When I try to run VS Code, I get various error messages in the terminal. Here are some of the notable logs:

MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory
failed to load driver: iris
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: No such file or directory
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory
failed to load swrast driver

Additionally, I see numerous warnings and errors related to extensions and GPU processes crashing.

I removed the potential problematic file (rm ,). I tried reinstalling VS Code using Snap but still face the same issues: Cleared VS Code cache and settings: Despite these efforts, the problem persists. Has anyone encountered a similar issue or can guide how to resolve this?

4
  • Or you can use vscodium. snap install codium --classic . It's exactly same you just do vscodium . instead of code . Give it a go as it might be useful Commented Jun 6 at 9:47
  • Please stop making this comment in many questions to use some other app when an OP asks about fixing an issue with the app they are using. Are you being paid for this?
    – David
    Commented Jun 6 at 10:13
  • Duplicate of stackoverflow.com/questions/78584630/…?
    – ks1322
    Commented Jun 7 at 18:45
  • @RajeshPaudel: your solution does not make sense. If it's "exactly the same", then it will have exactly the same bug. Commented Jun 12 at 7:09

2 Answers 2

13

I had the same issue today. I was able to revert to a previous version of the snap and it started normally.

$ snap list code --all 
Name  Version   Rev  Tracking       Publisher  Notes
code  dc96b837  159  latest/stable  vscode✓    
disabled,classic
code  89de5a8d  160  latest/stable  vscode✓    classic

So I reverted to the most recent version.

$ sudo snap revert --revision=159 code

or simply

$ sudo snap revert code

I don't want to use the .deb version so this is an alternative for those who wish to stay on snap.

0
11

I faced this issue today on my Ubuntu 24.04 and thought it might be a bug. After several restarts and updates, I realized it was bugging in the Snap Store version. So I downloaded the .deb package from their Official Downloads. Then I used apt to install the package.

sudo apt install ./code_1.90.0-1717531825_amd64.deb

Now my Visual Studio Code is working fine with all my previous data on the latest version.

If you want to use the previous Snap version instead of .deb package, you can use this command:

$ sudo snap revert code
0

You must log in to answer this question.

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