1

>NOT ABOUT SNAP VERSION<

Installed Visual Studio Code via terminal using the instructions here: https://code.visualstudio.com/docs/setup/linux

I didn't do the sudo dpkg -i <file>.deb and sudo apt-get install -f but went right to adding repository and key, followed by updating and installing (sudo apt install code).

When starting it the normal way (Super and typing visual, enter to start the app) shows the busy-cursor for a while and then stops. Nothing happens.

When starting using the terminal, typing code, nothing happens.

$ code --verbose

[main 9:06:54 PM] Startup error: ,,Error: EACCES: permission denied, mkdir '/home/*myusername*/.config/Code/CachedData',Error: EACCES: permission denied, mkdir '/home/*myusername*/.config/Code/logs/20180723T210654'
[main 9:06:54 PM] Lifecycle#kill()

$ apt list --installed code

Listing... Done
code/stable,now 1.25.1-1531323788 amd64 [installed]
N: There are 39 additional versions. Please use the '-a' switch to see them.

$ apt policy code

code:
  Installed: 1.25.1-1531323788
  Candidate: 1.25.1-1531323788
  Version table:
 *** 1.25.1-1531323788 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
        100 /var/lib/dpkg/status
     1.25.0-1530796411 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.24.1-1528912196 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.24.0-1528306776 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.23.1-1525968403 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.23.0-1525361119 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.22.2-1523551015 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.22.1-1522974421 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.21.1-1521038896 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.21.0-1520420608 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.20.1-1518535978 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.20.0-1518023506 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.19.3-1516876437 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.19.2-1515599945 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.19.1-1513676564 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.19.0-1513245498 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.18.1-1510857349 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.18.0-1510145176 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.17.2-1508162334 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.17.1-1507645403 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.17.0-1507160143 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.16.1-1505406497 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.16.0-1504714880 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.15.1-1502903936 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.15.0-1502309460 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.14.2-1500506907 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.14.1-1499973263 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.14.0-1499719149 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.13.1-1497464373 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.13.0-1496940180 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.12.2-1494422229 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.12.1-1493934083 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.12.0-1493915672 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.11.2-1492070517 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.11.1-1491486998 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.11.0-1491426847 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.10.2-1488981323 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.10.1-1488415350 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.10.0-1488387854 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages
     1.9.1-1486597190 500
        500 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages

As for the rights on the .config dir:

$ ls -la ~/.config/Code

total 24
drwxr-xr-x  4 root   root   4096 jun 25 23:08 .
drwx------ 19 myusername myusername 4096 jun 29 18:59 ..
-rw-r--r--  1 root   root     18 jun 25 23:08 installSource
drwxr-xr-x  4 root   root   4096 jun 25 23:08 logs
-rw-r--r--  1 root   root     36 jun 25 23:08 machineid
drwxr-xr-x  2 root   root   4096 jun 25 23:08 User

I'm pretty new. Apparently "sudo code" is not a safe way to solve my problem so what should I do?

Running Ubuntu 18.04

  • How did you install visual code ? On this page several methods are mentioned! Did you get installation errors? What is the output of apt policy codeand what shows apt list --installed code . Put the output of this commands into your original post – abu_bua Jul 24 '18 at 00:34
  • Thanks for your reply @abu_bua! I just clarified which instructions I used. I will add the output later today when I have access to my system again. – Lallebal Jul 24 '18 at 09:58
  • @abu_bua I added the output. Hope that makes things clearer. – Lallebal Jul 24 '18 at 16:23
  • Thanks for the suggestion, @karel. I prefer to avoid a snap version of it, for now, though. :) – Lallebal Jul 24 '18 at 16:25
  • Seems you don't have write access in the config dir. What does the command ls -la ~/config/Codeoutputs ? – abu_bua Jul 24 '18 at 16:47
  • @abu_bua, I added the output. That indicates that I do have write permission, right? – Lallebal Jul 24 '18 at 21:04
  • No. First the apt policy seems to be right. For some reason however the right permissions are set wrong, see my answer above. I have installed Code for x-times, and it is strange that you root permissions in your config file. Maybe it results from a former wrong installation. – abu_bua Jul 24 '18 at 21:54
  • @Thomas No, I already mentioned above that this is not about a snap version. Thanks, though. :) – Lallebal Jul 25 '18 at 10:42
  • @N0rbert It isn't. – Lallebal Jul 26 '18 at 21:44

1 Answers1

4

You have to change the permission! The settings are wrong. If you have a new installation and never had projects on your machine, try to reinstall code, by deleting all code-made-files

sudo apt purge code

and then reinstall it with

sudo apt install code

If you have had projects, you may try to change your access of the config dir:

sudo chown -R myusername:myusername ~/.config/Code
abu_bua
  • 10,783