
{"id":39416,"date":"2022-05-05T15:54:48","date_gmt":"2022-05-05T15:54:48","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=39416"},"modified":"2024-11-28T08:46:13","modified_gmt":"2024-11-28T08:46:13","slug":"install-sublime-text-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2022\/05\/install-sublime-text-ubuntu-22-04\/","title":{"rendered":"How to Install Sublime Text 4 in Ubuntu 24.04 | 22.04 (Updated)"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-logo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-39417\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-logo-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-logo-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-logo-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-logo-600x600.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-logo-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-logo.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 Sublime Text code editor in Ubuntu 22.04 and Ubuntu 24.04.<\/p>\n<p>Sublime Text is available to install in Ubuntu Linux through 3 different ways. They include:<\/p>\n<ul>\n<li><b>Snap package<\/b> &#8211; maintained by contributors.<\/li>\n<li><b>Deb pacakge<\/b> &#8211; through its official repository.<\/li>\n<li><b>Flatpak package<\/b> (Sublime Text 3) &#8211; maintained by contributors.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext.webp\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-39420\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-600x373.webp\" alt=\"\" width=\"600\" height=\"373\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-600x373.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-300x187.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-768x478.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext.webp 1067w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>Option 1: Snap package<\/h3>\n<p>A <a href=\"https:\/\/github.com\/snapcrafters\/sublime-text\/graphs\/contributors\" target=\"_blank\" rel=\"noopener\">group of contributers<\/a> maintain the text editor in Snap package format, which runs in sandbox. The package so far supports <code>amd64<\/code> (Intel\/AMD) and <code>arm64<\/code> (Raspberry Pi) devices.<\/p>\n<p>Ubuntu 20.04 and higher can simply search for and install it from Ubuntu Software (or App Center):<\/p>\n<div id=\"attachment_45917\" style=\"width: 620px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-appcenter.webp\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-45917\" class=\"size-large wp-image-45917\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-appcenter-700x428.webp\" alt=\"\" width=\"610\" height=\"373\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-appcenter-700x428.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-appcenter-300x183.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-appcenter-768x470.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublimetext-appcenter.webp 1130w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><p id=\"caption-attachment-45917\" class=\"wp-caption-text\">Sublime Text Snap package in Ubuntu Software \/ App Center<\/p><\/div>\n<p><b>The snap package runs in sandbox and always up-to-date<\/b> since it receives updates automatically. The only downside could be that some do NOT like sandboxing apps.<\/p>\n<p>For those prefer Linux commands, the package also can be installed by running the command below in terminal:<\/p>\n<pre>sudo snap install sublime-text --classic<\/pre>\n<h3>Option 2: Official Apt repository (.deb package)<\/h3>\n<p><b>Sublime has an <a href=\"https:\/\/www.sublimetext.com\/docs\/linux_repositories.html#apt\" target=\"_blank\" rel=\"noopener\">official guide<\/a> for installing the deb package from apt repository. However, it&#8217;s outdated due to Debian policy change!<\/b><\/p>\n<p>This is the <b>official <code>.deb<\/code> package works in Ubuntu, Linux Mint, Debian, and even Raspberry Pi OS (arm64)<\/b>.<\/p>\n<p><b>1.<\/b> Firstly, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run the command below to make sure &#8216;https&#8217; source is supported:<\/p>\n<pre>sudo apt install apt-transport-https<\/pre>\n<p><b>2. Add the repository key<\/b><\/p>\n<p>The sublime text website still use the &#8216;<code>apt-key<\/code>&#8216; command in its document, which is deprecated.<\/p>\n<p>For security reason, Debian has updated the policy. And, it&#8217;s recommend to use the command below instead to install the key:<\/p>\n<pre>wget -qO - https:\/\/download.sublimetext.com\/sublimehq-pub.gpg | gpg --dearmor | sudo tee \/etc\/apt\/keyrings\/sublimehq-pub.gpg<\/pre>\n<p>It will download the key from its website, convert it to un-readable encrypted key, and put into &#8220;\/etc\/apt\/keyring&#8221; directory.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublime-text-keyring.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45918\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublime-text-keyring-700x489.webp\" alt=\"\" width=\"610\" height=\"426\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublime-text-keyring-700x489.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublime-text-keyring-300x210.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublime-text-keyring-768x537.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/sublime-text-keyring.webp 866w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>3. Add the official repository<\/b><\/p>\n<p>Next, run the command below to create a source file and edit it via Gnome text editor:<\/p>\n<pre>sudo gnome-text-editor \/etc\/apt\/sources.list.d\/sublime-text.list<\/pre>\n<p>For Ubuntu 22.04 and earlier, replace <code>gnome-text-editor<\/code> with <code>gedit<\/code>. Or use <code>mousepad<\/code> for XFCE, <code>pluma<\/code> for MATE, or <code>nano<\/code> command line text editor that works in most desktop environments.<\/p>\n<p>When the file opens, add the following line (<i>it&#8217;s a single line<\/i>) and save it.<\/p>\n<p><b>deb [signed-by=\/etc\/apt\/keyrings\/sublimehq-pub.gpg] https:\/\/download.sublimetext.com\/ apt\/stable\/<\/b><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/add-sublime-repo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45919\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/add-sublime-repo-700x217.webp\" alt=\"\" width=\"610\" height=\"189\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/add-sublime-repo-700x217.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/add-sublime-repo-300x93.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/add-sublime-repo-768x238.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/add-sublime-repo.webp 1009w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>This step can be done alternatively by running the single command below in terminal:<\/p>\n<pre>echo \"deb [signed-by=\/etc\/apt\/keyrings\/sublimehq-pub.gpg] https:\/\/download.sublimetext.com\/ apt\/stable\/\" | sudo tee \/etc\/apt\/sources.list.d\/sublime-text.list<\/pre>\n<p><b>4<\/b>. Now, run the command below to refresh system package cache:<\/p>\n<pre>sudo apt update<\/pre>\n<p>In the output, it should print a line looks like &#8220;<i>Get: x https:\/\/download.sublimetext.com apt\/stable &#8230;<\/i>&#8221;<\/p>\n<p><b>5.<\/b> Finally, install the code editor from that repository by running command:<\/p>\n<pre>sudo apt install sublime-text<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/apt-sublimetext-noble.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-45920\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/apt-sublimetext-noble-700x352.webp\" alt=\"\" width=\"610\" height=\"307\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/apt-sublimetext-noble-700x352.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/apt-sublimetext-noble-300x151.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/apt-sublimetext-noble.webp 746w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h3>Option 3: Flatpak package<\/h3>\n<p>Sublime Text 4 is NOT available as Flatpak so far. But for the old version <b>3<\/b>, you may install it by running the commands below one by one in terminal.<\/p>\n<p><b>NOTE: Like Snap, the Sublime Text as flatpak is also un-official package maintained by contributors, runs in sandbox.<\/b><\/p>\n<p>Firstly, press Ctrl+Alt+T to open terminal and run command to install Flatpak daemon:<\/p>\n<pre>sudo apt install flatpak<\/pre>\n<p>Then, install Sublime Text 3 via Flatpak by running command:<\/p>\n<pre>flatpak install https:\/\/dl.flathub.org\/repo\/appstream\/com.sublimetext.three.flatpakref<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-39421\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/flatpak-sublime-600x407.webp\" alt=\"\" width=\"600\" height=\"407\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/flatpak-sublime-600x407.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/flatpak-sublime-300x203.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/flatpak-sublime-768x521.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/flatpak-sublime.webp 813w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<h3>Uninstall Sublime Text:<\/h3>\n<p>For the Snap package, remove it either using Ubuntu Software or by running command in terminal:<\/p>\n<pre>sudo snap remove --purge sublime-text<\/pre>\n<p>For the Flatpak package, use the command to uninstall the package:<\/p>\n<pre>flatpak uninstall --delete-data com.sublimetext.three<\/pre>\n<p>and cleanup useless run-times via <code>flatpak uninstall --unused<\/code>.<\/p>\n<p>For the official .deb package, remove it by running command:<\/p>\n<pre>sudo apt remove --autoremove sublime-text<\/pre>\n<p>The apt repository will not display in &#8220;Software &amp; Updates&#8221; utility, so get rid of it by running command to remove the source file:<\/p>\n<pre>sudo rm \/etc\/apt\/sources.list.d\/sublime-text.list<\/pre>\n<p>And remove the key file by running command:<\/p>\n<pre>sudo rm \/usr\/share\/keyrings\/sublimehq-pub.gpg<\/pre>\n<h3>Summary:<\/h3>\n<p>Here I introduced 3 ways to install Sublime Text in Ubuntu. The Snap is the easiest, which is available in Ubuntu Software, but the official apt repository is recommended! For those still looking for the old Sublime Text 3, the Flatpak package is available for choice.<\/p>","protected":false},"excerpt":{"rendered":"<p>This is a step by step beginner&#8217;s guide shows how to install Sublime Text code editor in Ubuntu 22.04 and Ubuntu 24.04. Sublime Text is available to install in Ubuntu Linux through 3 different ways. They include: Snap package &#8211; maintained by contributors. Deb pacakge &#8211; through its official repository. Flatpak package (Sublime Text 3) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":39417,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[41],"class_list":["post-39416","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-sublime-text"],"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/39416","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=39416"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/39416\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/39417"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=39416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=39416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=39416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}