
{"id":45055,"date":"2023-12-31T15:08:57","date_gmt":"2023-12-31T15:08:57","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=45055"},"modified":"2026-01-09T09:41:30","modified_gmt":"2026-01-09T09:41:30","slug":"install-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2023\/12\/install-ubuntu-24-04\/","title":{"rendered":"How to Install Visual Studio Code in Ubuntu 22.04 &#038; 24.04 [3 ways]"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-icon.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-45056\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-icon-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-icon-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-icon-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-icon-700x700.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-icon-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-icon.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>This is a step by step beginner&#8217;s guide shows how to install VS Code IDE and keep it up-to-date in Ubuntu 22.04, Ubuntu 24.04, Ubuntu 25.04 using 3 different ways.<\/p>\n<p>Microsoft provides official code packages for Linux through native <code>.deb<\/code> (for Debian\/Ubuntu), <code>.rpm<\/code> (for Fedora\/SUSE), and universal <code>Snap<\/code> package run in sandbox.<\/p>\n<p>For choice, there&#8217;s also a community maintained <code>Flatpak<\/code> package which also runs in sandbox.<\/p>\n<p>So, there are 3 common ways to install this IDE in your Ubuntu Desktop!<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-welcome.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45065\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-welcome-700x450.webp\" alt=\"\" width=\"610\" height=\"392\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-welcome-700x450.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-welcome-300x193.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-welcome-768x493.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-welcome.webp 1272w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><br \/>\n<!--more--><\/p>\n<h3>Option 1: Install VS Code via Snap (Official)<\/h3>\n<p>Snap package is the <b>easiest way<\/b> to install VS Code (or code-insider) in Ubuntu. Which, also receives update automatically silently in the background. So, just install it, then you always have the latest version.<\/p>\n<p>However, the Snap app runs in sandbox which might have permission or compatibility issues. And, so far it only support <b>x86_64<\/b> (<code>Intel\/AMD<\/code> CPUs) CPU architecture types.<\/p>\n<p>To install the package, simply search for &amp; install it from Ubuntu Software (or App Center for 24.04 and higher):<\/p>\n<div id=\"attachment_45057\" style=\"width: 620px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/code-appcenter.webp\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-45057\" class=\"size-large wp-image-45057\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/code-appcenter-700x433.webp\" alt=\"\" width=\"610\" height=\"377\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/code-appcenter-700x433.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/code-appcenter-300x186.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/code-appcenter-768x475.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/code-appcenter.webp 1204w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><p id=\"caption-attachment-45057\" class=\"wp-caption-text\">VS Code in App Center<\/p><\/div>\n<p>Or, press <code>Ctrl+Alt+T<\/code> on keyboard to open terminal, and run command to install the Snap package:<\/p>\n<pre>snap install code --classic<\/pre>\n<p>The Snap package can also be installed in most other Linux, see <a href=\"https:\/\/snapcraft.io\/code\" target=\"_blank\" rel=\"noopener\">this page<\/a> for details.<\/p>\n<h3>Option 2: Install VS Code via Flatpak<\/h3>\n<p><b>VS Code official installers are proprietary. For those who prefer open-source, there&#8217;s a community maintained Flatpak package available.<\/b><\/p>\n<p>VS Code is available to install as Flatpak package in both <b>x86_64<\/b> (Intel\/AMD CPUS) and <b>arm64<\/b> (Rasperry Pi, Apple Silicon, etc) machines.<\/p>\n<p>Same to Snap, the only downside could be that it might have more issues compare to the native <code>.deb<\/code> package.<\/p>\n<p>Linux Mint (since 21) can search for install Code IDE as Flatpak directly from Software Manager. While, Ubuntu and Debian users need to run the commands below one by one to get it:<\/p>\n<ul>\n<li>First, open terminal (<code>Ctrl+Alt+T<\/code>) and run command to enable Flatpak support:\n<pre>sudo apt install flatpak<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-flatpak-jammy.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-39141\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-flatpak-jammy-600x229.webp\" alt=\"\" width=\"600\" height=\"229\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-flatpak-jammy-600x229.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-flatpak-jammy-300x115.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-flatpak-jammy-768x294.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-flatpak-jammy.webp 777w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/li>\n<li>Then, run command to install VS Code as Flatpak:\n<pre>flatpak install https:\/\/dl.flathub.org\/repo\/appstream\/com.visualstudio.code.flatpakref<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/flatpak-code.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45058\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/flatpak-code-700x461.webp\" alt=\"\" width=\"610\" height=\"402\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/flatpak-code-700x461.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/flatpak-code-300x197.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/flatpak-code-768x505.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/flatpak-code.webp 1029w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/li>\n<\/ul>\n<p>Finally, search for &amp; launch the IDE from overview or start menu depends on your desktop environment (<i>may need to log out and back in<\/i>):<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/launch-code.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-45059\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/launch-code.webp\" alt=\"\" width=\"577\" height=\"299\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/launch-code.webp 577w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/launch-code-300x155.webp 300w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/a><\/p>\n<p>To install updates, use the command below in a terminal window:<\/p>\n<pre>flatpak update com.visualstudio.code<\/pre>\n<p>For more about the Flatpak package, go check the <a href=\"https:\/\/flathub.org\/apps\/com.visualstudio.code\" target=\"_blank\" rel=\"noopener\">Flathub.org<\/a>.<\/p>\n<h3>Option 3: Install VS Code via .deb package (Official)<\/h3>\n<p>For those who do not like running app in sandbox, Microsoft also provides the classic <code>.deb<\/code> package for Debian\/Ubuntu, which so far supports <b>x86_64<\/b> (amd64), <b>arm64<\/b>, and <b>armhf<\/b> CPU architecture types.<\/p>\n<p>To download the package, simply go to its website via the link below:<\/p>\n<div class=\"wp-block-buttons aligncenter\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-vivid-cyan-blue-to-vivid-purple-gradient-background has-text-color has-background\" href=\"https:\/\/code.visualstudio.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Download VS Code<\/a><\/div>\n<\/div>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/download-code.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45060\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/download-code-700x390.webp\" alt=\"\" width=\"610\" height=\"340\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/download-code-700x390.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/download-code-300x167.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/download-code-768x428.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/download-code.webp 1186w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>Then, either double-click the <code>.deb<\/code> package in file manager to open &amp; install via &#8220;<i>Software Install<\/i>&#8220;. Or, press <code>Ctrl+Alt+T<\/code> to open terminal, and run command to install the downloaded package:<\/p>\n<pre>sudo apt install ~\/Downloads\/code_*.deb<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/install-vscode197.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-48096\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/install-vscode197-700x339.webp\" alt=\"\" width=\"610\" height=\"295\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/install-vscode197-700x339.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/install-vscode197-300x145.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/install-vscode197-768x372.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/install-vscode197.webp 1310w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h4>Setup VS Code repository to keep the .deb package up-to-date<\/h4>\n<p>Installing the official <code>.deb<\/code> package will ask if you want to the apt repository for installing updates! Which, however uses the <del datetime=\"2025-07-12T15:22:20+00:00\"><b>old deprecated way<\/b><\/del> due to Debian\/Ubuntu policy changes!<\/p>\n<p><b>UPDATE: Microsoft has UPDATED the .deb installer with correct postinstall script to auto-add the apt repository!!<\/b><\/p>\n<p>If it somehow didn&#8217;t add the repository for you, then follow the steps below to add manually:<\/p>\n<p><b>1<\/b> First, open terminal (<code>Ctrl+Alt+T<\/code>) and run command to delete old in-correct source &amp; key files if any.<\/p>\n<pre>sudo rm \/etc\/apt\/sources.list.d\/*vscode* \/etc\/apt\/trusted.gpg.d\/microsoft.gpg<\/pre>\n<p><b>2.<\/b> Then, run command to download the key, de-armor it (so unreadable), and finally save to <code>\/etc\/apt\/keyrings<\/code> directory.<\/p>\n<pre>wget -q -O- https:\/\/packages.microsoft.com\/keys\/microsoft.asc | gpg --dearmor | sudo tee \/etc\/apt\/keyrings\/microsoft.gpg<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/microsoft-key-wget.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45062\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/microsoft-key-wget-700x314.webp\" alt=\"\" width=\"610\" height=\"274\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/microsoft-key-wget-700x314.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/microsoft-key-wget-300x135.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/microsoft-key-wget-768x345.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/microsoft-key-wget.webp 822w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>3.<\/b> Next, run command to create the source according to new Ubuntu policy:<\/p>\n<pre>sudo nano \/etc\/apt\/sources.list.d\/vscode.sources<\/pre>\n<p>This command will create the <code>.sources<\/code> file and open it in nano command line editor. There, just paste following lines into it:<\/p>\n<pre>Types: deb\r\nURIs: https:\/\/packages.microsoft.com\/repos\/code\r\nSuites: stable\r\nComponents: main\r\nArchitectures: amd64 arm64 armhf\r\nSigned-By: \/etc\/apt\/keyrings\/microsoft.gpg<\/pre>\n<p>When done, press <b>Ctrl+S<\/b> (or Ctrl+O) to save file, and <b>Ctrl+X<\/b> to exit.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-sources.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45063\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-sources-700x454.webp\" alt=\"\" width=\"610\" height=\"396\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-sources-700x454.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-sources-300x195.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-sources-768x498.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vscode-sources.webp 822w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>Finally, either run 2 commands below one by one to refresh package cache and install VS Code for the first time:<\/p>\n<pre>sudo apt update<\/pre>\n<pre>sudo apt install code<\/pre>\n<p>For choice, replace <code>code<\/code> with <code>code-insider<\/code> or <code>code-exploration<\/code> to install the different versions.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/apt-codeide.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45064\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/apt-codeide-700x454.webp\" alt=\"\" width=\"610\" height=\"396\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/apt-codeide-700x454.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/apt-codeide-300x195.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/apt-codeide-768x498.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/apt-codeide.webp 822w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>Or, launch <b>Software Updater<\/b> (Update Manager) to check if there&#8217;s any update for the package.<\/p>\n<h3>Uninstall Code IDE<\/h3>\n<p>Depends on how you installed the IDE package, you may uninstall it through one of the ways below:<\/p>\n<ul>\n<li>To remove the Snap package, either use Ubuntu Software (App Center) or run command:\n<pre>snap remove code code-insider<\/pre>\n<\/li>\n<li>To remove the Flatpak package, run command in terminal (Ctrl+Alt+T):\n<pre>flatpak uninstall --delete-data com.visualstudio.code<\/pre>\n<p>Also run <code>flatpak uninstall --unused<\/code> to clear up run-time libraries.<\/li>\n<li>For the classic <code>.deb<\/code> package, remove it by running command:\n<pre>sudo apt remove --autoremove code code-insider<\/pre>\n<p>Also, remove the source repository by deleting the corresponding files:<\/p>\n<pre>sudo rm \/etc\/apt\/sources.list.d\/*vscode* \/etc\/apt\/keyrings\/microsoft.gpg<\/pre>\n<p>Finally, run <code>sudo apt update<\/code> to refresh system package cache.<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>This is a step by step beginner&#8217;s guide shows how to install VS Code IDE and keep it up-to-date in Ubuntu 22.04, Ubuntu 24.04, Ubuntu 25.04 using 3 different ways. Microsoft provides official code packages for Linux through native .deb (for Debian\/Ubuntu), .rpm (for Fedora\/SUSE), and universal Snap package run in sandbox. For choice, there&#8217;s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":45056,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[981,1449],"class_list":["post-45055","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-ide","tag-visual-studio-code"],"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/45055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=45055"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/45055\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/45056"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=45055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=45055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=45055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}