{"componentChunkName":"component---src-templates-post-template-js","path":"/note-vscode-onlinux-aptissue-en","result":{"data":{"markdownRemark":{"id":"cc6d0a26-0194-55df-ab44-5e15b048c11d","html":"<blockquote>\n<p>This page has been machine-translated from the <a href=\"/note-vscode-onlinux-aptissue\">original page</a>.</p>\n</blockquote>\n<!-- omit in toc -->\n<h2 id=\"introduction\" style=\"position:relative;\"><a href=\"#introduction\" aria-label=\"introduction permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Introduction</h2>\n<p>I troubleshot the issue where VSCode can no longer be launched with the <code class=\"language-text\">code</code> command after running <code class=\"language-text\">apt update</code> in a Linux environment, so I’m recording the cause and the fix.</p>\n<p>I had installed VSCode using a deb file downloaded from the official site and the <code class=\"language-text\">dpkg -i</code> command.</p>\n<!-- omit in toc -->\n<h2 id=\"table-of-contents\" style=\"position:relative;\"><a href=\"#table-of-contents\" aria-label=\"table of contents permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Table of Contents</h2>\n<ul>\n<li><a href=\"#check-vscode-information\">Check VSCode information</a></li>\n<li><a href=\"#upgrade-vscode\">Upgrade VSCode</a></li>\n<li>\n<p><a href=\"#identify-the-problematic-part\">Identify the problematic part</a></p>\n<ul>\n<li><a href=\"#check-whether-the-vscode-binary-exists\">Check whether the VSCode binary exists</a></li>\n</ul>\n</li>\n<li><a href=\"#solution\">Solution</a></li>\n<li><a href=\"#summary\">Summary</a></li>\n</ul>\n<h2 id=\"check-vscode-information\" style=\"position:relative;\"><a href=\"#check-vscode-information\" aria-label=\"check vscode information permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Check VSCode information</h2>\n<p>First, I confirmed that the <code class=\"language-text\">code</code> package existed.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token variable\">$sudo</span> dpkg -l <span class=\"token operator\">|</span> <span class=\"token function\">grep</span> code\nii  code                                     <span class=\"token number\">1.57</span>.0-1623259737                  amd64        Code editing. Redefined.</code></pre></div>\n<p>Next, check what the <code class=\"language-text\">code</code> command is calling.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token variable\">$which</span> code\n/usr/bin/code</code></pre></div>\n<p>Apparently, <code class=\"language-text\">/usr/bin/code</code> is a symbolic link to <code class=\"language-text\">/usr/share/code/bin/code</code>.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token variable\">$file</span> /usr/bin/code\n/usr/bin/code: symbolic <span class=\"token function\">link</span> to /usr/share/code/bin/code</code></pre></div>\n<p>When I looked into <code class=\"language-text\">/usr/share/code/bin/code</code>, it turned out to be an executable shell script, so I checked its contents.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token variable\">$cat</span> /usr/share/code/bin/code \n<span class=\"token comment\">#!/usr/bin/env sh</span>\n<span class=\"token comment\">#</span>\n<span class=\"token comment\"># Copyright (c) Microsoft Corporation. All rights reserved.</span>\n<span class=\"token comment\"># Licensed under the MIT License. See License.txt in the project root for license information.</span>\n\n<span class=\"token comment\"># test that VSCode wasn't installed inside WSL</span>\n<span class=\"token keyword\">if</span> <span class=\"token function\">grep</span> -qi Microsoft /proc/version <span class=\"token operator\">&amp;&amp;</span> <span class=\"token punctuation\">[</span> -z <span class=\"token string\">\"<span class=\"token variable\">$DONT_PROMPT_WSL_INSTALL</span>\"</span> <span class=\"token punctuation\">]</span><span class=\"token punctuation\">;</span> <span class=\"token keyword\">then</span>\n<span class=\"token builtin class-name\">echo</span> <span class=\"token string\">\"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 \\<span class=\"token variable\"><span class=\"token variable\">`</span>code<span class=\"token punctuation\">\\</span><span class=\"token variable\">`</span></span> command in a WSL terminal just as you would in a normal command prompt.\"</span> <span class=\"token operator\"><span class=\"token file-descriptor important\">1</span>></span><span class=\"token file-descriptor important\">&amp;2</span>\n<span class=\"token builtin class-name\">printf</span> <span class=\"token string\">\"Do you want to continue anyway? [y/N] \"</span> <span class=\"token operator\"><span class=\"token file-descriptor important\">1</span>></span><span class=\"token file-descriptor important\">&amp;2</span>\n<span class=\"token builtin class-name\">read</span> -r YN\n<span class=\"token assign-left variable\">YN</span><span class=\"token operator\">=</span><span class=\"token variable\"><span class=\"token variable\">$(</span><span class=\"token builtin class-name\">printf</span> <span class=\"token string\">'%s'</span> <span class=\"token string\">\"<span class=\"token variable\">$YN</span>\"</span> <span class=\"token operator\">|</span> <span class=\"token function\">tr</span> <span class=\"token string\">'[:upper:]'</span> <span class=\"token string\">'[:lower:]'</span><span class=\"token variable\">)</span></span>\n<span class=\"token keyword\">case</span> <span class=\"token string\">\"<span class=\"token variable\">$YN</span>\"</span> <span class=\"token keyword\">in</span>\ny <span class=\"token operator\">|</span> <span class=\"token function\">yes</span> <span class=\"token punctuation\">)</span>\n<span class=\"token punctuation\">;</span><span class=\"token punctuation\">;</span>\n* <span class=\"token punctuation\">)</span>\n<span class=\"token builtin class-name\">exit</span> <span class=\"token number\">1</span>\n<span class=\"token punctuation\">;</span><span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">esac</span>\n<span class=\"token builtin class-name\">echo</span> <span class=\"token string\">\"To no longer see this prompt, start Visual Studio Code with the environment variable DONT_PROMPT_WSL_INSTALL defined.\"</span> <span class=\"token operator\"><span class=\"token file-descriptor important\">1</span>></span><span class=\"token file-descriptor important\">&amp;2</span>\n<span class=\"token keyword\">fi</span>\n\n<span class=\"token comment\"># If root, ensure that --user-data-dir or --file-write is specified</span>\n<span class=\"token keyword\">if</span> <span class=\"token punctuation\">[</span> <span class=\"token string\">\"<span class=\"token variable\"><span class=\"token variable\">$(</span><span class=\"token function\">id</span> -u<span class=\"token variable\">)</span></span>\"</span> <span class=\"token operator\">=</span> <span class=\"token string\">\"0\"</span> <span class=\"token punctuation\">]</span><span class=\"token punctuation\">;</span> <span class=\"token keyword\">then</span>\n<span class=\"token keyword\">for</span> <span class=\"token for-or-select variable\">i</span> <span class=\"token keyword\">in</span> <span class=\"token string\">\"<span class=\"token variable\">$@</span>\"</span>\n<span class=\"token keyword\">do</span>\n<span class=\"token keyword\">case</span> <span class=\"token string\">\"<span class=\"token variable\">$i</span>\"</span> <span class=\"token keyword\">in</span>\n--user-data-dir <span class=\"token operator\">|</span> --user-data-dir<span class=\"token operator\">=</span>* <span class=\"token operator\">|</span> --file-write <span class=\"token punctuation\">)</span>\n<span class=\"token assign-left variable\">CAN_LAUNCH_AS_ROOT</span><span class=\"token operator\">=</span><span class=\"token number\">1</span>\n<span class=\"token punctuation\">;</span><span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">esac</span>\n<span class=\"token keyword\">done</span>\n<span class=\"token keyword\">if</span> <span class=\"token punctuation\">[</span> -z <span class=\"token variable\">$CAN_LAUNCH_AS_ROOT</span> <span class=\"token punctuation\">]</span><span class=\"token punctuation\">;</span> <span class=\"token keyword\">then</span>\n<span class=\"token builtin class-name\">echo</span> <span class=\"token string\">\"You are trying to start Visual Studio Code as a super user which isn't recommended. If this was intended, please specify an alternate user data directory using the \\<span class=\"token variable\"><span class=\"token variable\">`</span>--user-data-dir<span class=\"token punctuation\">\\</span><span class=\"token variable\">`</span></span> argument.\"</span> <span class=\"token operator\"><span class=\"token file-descriptor important\">1</span>></span><span class=\"token file-descriptor important\">&amp;2</span>\n<span class=\"token builtin class-name\">exit</span> <span class=\"token number\">1</span>\n<span class=\"token keyword\">fi</span>\n<span class=\"token keyword\">fi</span>\n\n<span class=\"token keyword\">if</span> <span class=\"token punctuation\">[</span> <span class=\"token operator\">!</span> -L <span class=\"token string\">\"<span class=\"token variable\">$0</span>\"</span> <span class=\"token punctuation\">]</span><span class=\"token punctuation\">;</span> <span class=\"token keyword\">then</span>\n<span class=\"token comment\"># if path is not a symlink, find relatively</span>\n<span class=\"token assign-left variable\">VSCODE_PATH</span><span class=\"token operator\">=</span><span class=\"token string\">\"<span class=\"token variable\"><span class=\"token variable\">$(</span><span class=\"token function\">dirname</span> <span class=\"token string\">\"<span class=\"token variable\">$0</span>\"</span><span class=\"token variable\">)</span></span>/..\"</span>\n<span class=\"token keyword\">else</span>\n<span class=\"token keyword\">if</span> <span class=\"token builtin class-name\">command</span> -v readlink <span class=\"token operator\">></span>/dev/null<span class=\"token punctuation\">;</span> <span class=\"token keyword\">then</span>\n<span class=\"token comment\"># if readlink exists, follow the symlink and find relatively</span>\n<span class=\"token assign-left variable\">VSCODE_PATH</span><span class=\"token operator\">=</span><span class=\"token string\">\"$(dirname \"<span class=\"token variable\"><span class=\"token variable\">$(</span>readlink -f <span class=\"token string\">\"<span class=\"token variable\">$0</span>\"</span><span class=\"token variable\">)</span></span>\"</span><span class=\"token punctuation\">)</span>/<span class=\"token punctuation\">..</span><span class=\"token string\">\"\nelse\n# else use the standard install location\nVSCODE_PATH=\"</span>/usr/share/code<span class=\"token string\">\"\nfi\nfi\n\nELECTRON=\"</span><span class=\"token variable\">$VSCODE_PATH</span>/code<span class=\"token string\">\"\nCLI=\"</span><span class=\"token variable\">$VSCODE_PATH</span>/resources/app/out/cli.js<span class=\"token string\">\"\nELECTRON_RUN_AS_NODE=1 \"</span><span class=\"token variable\">$ELECTRON</span><span class=\"token string\">\" \"</span><span class=\"token variable\">$CLI</span><span class=\"token string\">\" \"</span><span class=\"token variable\">$@</span>\"\n<span class=\"token builtin class-name\">exit</span> <span class=\"token variable\">$?</span></code></pre></div>\n<p>By reading this script, I confirmed that the actual VSCode executable is <code class=\"language-text\">/usr/share/code/code</code>.</p>\n<p>If you run the <code class=\"language-text\">file</code> command on it, you can confirm that it is an ELF file.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token variable\">$file</span> /usr/share/code/code \n/usr/share/code/code: ELF <span class=\"token number\">64</span>-bit LSB pie executable, x86-64, version <span class=\"token number\">1</span> <span class=\"token punctuation\">(</span>SYSV<span class=\"token punctuation\">)</span>, dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, <span class=\"token keyword\">for</span> GNU/Linux <span class=\"token number\">3.2</span>.0, BuildID<span class=\"token punctuation\">[</span>sha1<span class=\"token punctuation\">]</span><span class=\"token operator\">=</span>09e8dc044d33f961bfddaa7b20750bdf7d1f3005, not stripped</code></pre></div>\n<h2 id=\"upgrade-vscode\" style=\"position:relative;\"><a href=\"#upgrade-vscode\" aria-label=\"upgrade vscode permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Upgrade VSCode</h2>\n<p>Now that the preliminary investigation is done, let’s reproduce the issue.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token function\">sudo</span> <span class=\"token function\">apt</span> update <span class=\"token operator\">&amp;&amp;</span> <span class=\"token function\">sudo</span> <span class=\"token function\">apt</span> upgrade code</code></pre></div>\n<p>After this, VSCode on Linux was upgraded, and I could no longer launch VSCode from the terminal with the <code class=\"language-text\">code</code> command.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token variable\">$code</span>\nbash: code: <span class=\"token builtin class-name\">command</span> not found</code></pre></div>\n<h2 id=\"identify-the-problematic-part\" style=\"position:relative;\"><a href=\"#identify-the-problematic-part\" aria-label=\"identify the problematic part permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Identify the problematic part</h2>\n<p>From the investigation above, we can see that starting VSCode with the <code class=\"language-text\">code</code> command goes through the following steps.</p>\n<ul>\n<li>The <code class=\"language-text\">code</code> command calls <code class=\"language-text\">/usr/bin/code</code></li>\n<li><code class=\"language-text\">/usr/bin/code</code> is a symbolic link to <code class=\"language-text\">/usr/share/code/bin/code</code></li>\n<li><code class=\"language-text\">/usr/share/code/bin/code</code> is an executable shell script and calls <code class=\"language-text\">/usr/share/code/code</code></li>\n</ul>\n<p>Here, I will identify at which step the problem occurs.</p>\n<h3 id=\"check-whether-the-vscode-binary-exists\" style=\"position:relative;\"><a href=\"#check-whether-the-vscode-binary-exists\" aria-label=\"check whether the vscode binary exists permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Check whether the VSCode binary exists</h3>\n<p>Let’s work backward from the goal.</p>\n<p>Surprisingly, after running <code class=\"language-text\">apt upgrade code</code>, <code class=\"language-text\">/usr/share/code/code</code> had disappeared.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token variable\">$file</span> /usr/share/code/code\n/usr/share/code/code: cannot <span class=\"token function\">open</span> `/usr/share/code/code' <span class=\"token punctuation\">(</span>No such <span class=\"token function\">file</span> or directory<span class=\"token punctuation\">)</span></code></pre></div>\n<p>I tried <code class=\"language-text\">apt install</code>, but apparently it had not been uninstalled.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token variable\">$sudo</span> <span class=\"token function\">apt</span> <span class=\"token function\">install</span> code\nReading package lists<span class=\"token punctuation\">..</span>. Done\nBuilding dependency tree<span class=\"token punctuation\">..</span>. Done\nReading state information<span class=\"token punctuation\">..</span>. Done\ncode is already the newest version <span class=\"token punctuation\">(</span><span class=\"token number\">4.11</span>.5<span class=\"token punctuation\">)</span>.\n<span class=\"token number\">0</span> upgraded, <span class=\"token number\">0</span> newly installed, <span class=\"token number\">0</span> to remove and <span class=\"token number\">2</span> not upgraded.</code></pre></div>\n<p>Then, after exploring a few directories, I found an executable called <code class=\"language-text\">/usr/bin/codium</code>.</p>\n<p>Apparently, codium is an application in which VSCode has been made fully open source, and except for appearance-related parts such as Microsoft’s logo, it is almost completely identical to VSCode.\n(It seems some extensions I always use do not work, though…)</p>\n<p>It seems that the VSCode I had originally installed using a deb file downloaded from Microsoft’s page also had the same contents as codium, with only the outer shell being different.</p>\n<p>And in the Description of <code class=\"language-text\">apt show code</code>, I found the following.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">Description: Free/Libre Open Source Software Binaries of VSCode <span class=\"token punctuation\">(</span>VSCodium<span class=\"token punctuation\">)</span>\nTransitional package. Moved to codium.</code></pre></div>\n<p>Apparently, the <code class=\"language-text\">code</code> package has moved to <code class=\"language-text\">codium</code>.</p>\n<p>Because of that, when I upgraded <code class=\"language-text\">code</code> with apt, I could no longer launch the application with the <code class=\"language-text\">code</code> command.</p>\n<h2 id=\"solution\" style=\"position:relative;\"><a href=\"#solution\" aria-label=\"solution permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Solution</h2>\n<p>I simply created an alias.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token builtin class-name\">alias</span> <span class=\"token assign-left variable\">code</span><span class=\"token operator\">=</span>codium</code></pre></div>\n<p>This lets me launch VSCode (codium) with the same feel as before.</p>\n<h2 id=\"summary\" style=\"position:relative;\"><a href=\"#summary\" aria-label=\"summary permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Summary</h2>\n<p>This time, I troubleshot the issue where the <code class=\"language-text\">code</code> command stops working after an upgrade in an environment where VSCode had been installed using a deb file downloaded from the official site and the <code class=\"language-text\">dpkg -i</code> command.</p>","fields":{"slug":"/note-vscode-onlinux-aptissue-en","tagSlugs":["/tag/notes/","/tag/vs-code/","/tag/memo/","/tag/english/"]},"frontmatter":{"date":"2021-07-02","description":"I troubleshot the issue where VSCode can no longer be launched with the `code` command after running `apt update` in a Linux environment, so I’m recording the cause and the fix.","tags":["Notes","VSCode","Memo","English"],"title":"Why the `code` Command Stops Working After `apt upgrade` on Linux and How to Fix It","socialImage":{"publicURL":"/static/dc4d8b7f8795f3c3d3489d9957d155f2/no-image.png"}}}},"pageContext":{"slug":"/note-vscode-onlinux-aptissue-en"}},"staticQueryHashes":["251939775","401334301","825871152"]}