<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Forhad Hosain</title>
    <description>The latest articles on DEV Community by Forhad Hosain (@forhad_hosain_d27ef1edf40).</description>
    <link>https://dev.to/forhad_hosain_d27ef1edf40</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2002240%2Fe54bfb7d-530c-4ed1-999a-c5255961a899.png</url>
      <title>DEV Community: Forhad Hosain</title>
      <link>https://dev.to/forhad_hosain_d27ef1edf40</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/forhad_hosain_d27ef1edf40"/>
    <language>en</language>
    <item>
      <title>How to Install the Cursor (The AI Code Editor) on Ubuntu 24.04: A Simple Guide</title>
      <dc:creator>Forhad Hosain</dc:creator>
      <pubDate>Mon, 02 Sep 2024 07:15:18 +0000</pubDate>
      <link>https://dev.to/forhad_hosain_d27ef1edf40/how-to-install-the-cursor-the-ai-code-editor-on-ubuntu-2404-a-simple-guide-3dn1</link>
      <guid>https://dev.to/forhad_hosain_d27ef1edf40/how-to-install-the-cursor-the-ai-code-editor-on-ubuntu-2404-a-simple-guide-3dn1</guid>
      <description>&lt;p&gt;If you're planning to install Cursor on Ubuntu 24.04, this guide will lead you through the entire process step by step. From setting up the necessary dependencies to creating a desktop entry, and configuring your system so you can easily open a project using the &lt;code&gt;cursor .&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Install Fuse
&lt;/h2&gt;

&lt;p&gt;To begin, you’ll need to install Fuse, which is a prerequisite for running AppImage files. Use the following command to install &lt;code&gt;libfuse2t64&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install libfuse2t64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Download the Cursor AppImage
&lt;/h2&gt;

&lt;p&gt;Head over to the &lt;a href="https://www.cursor.com/" rel="noopener noreferrer"&gt;official Cursor website&lt;/a&gt; and download the AppImage file. Make sure to note the exact file name and version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Make the AppImage Executable
&lt;/h2&gt;

&lt;p&gt;Once you’ve downloaded the Cursor AppImage, navigate to the directory where it’s located, typically the Downloads folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ~/Downloads
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, make the AppImage file executable by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod +x cursor-0.39.5x86_64.AppImage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Modify the file name to match the version you downloaded.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Move the AppImage to a Permanent Location
&lt;/h2&gt;

&lt;p&gt;For easier access, move the AppImage file to the /opt directory and rename it to something simple like cursor.AppImage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mv cursor-0.39.5x86_64.AppImage /opt/cursor.AppImage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5: Create a Desktop Entry for Cursor
&lt;/h2&gt;

&lt;p&gt;To make Cursor easily accessible from your applications menu, you’ll need to create a desktop entry. Open a text editor with root privileges:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /usr/share/applications/cursor.desktop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following content to the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Desktop Entry]
Name=Cursor
Exec=/opt/cursor.AppImage
Icon=&amp;lt;CHANGE THIS TO THE LOCATION OF YOUR ICON FILE&amp;gt;
Type=Application
Categories=Development;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure to replace the Icon path with the actual location of your icon file. If you don’t have an icon yet, see the next step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Get an Icon for Cursor
&lt;/h2&gt;

&lt;p&gt;You’ll want a nice icon to go with your application. Here’s how you can create one:&lt;/p&gt;

&lt;p&gt;Download a logo: Visit the official Cursor website and find the logo video.&lt;/p&gt;

&lt;p&gt;Extract an image: Use &lt;a href="https://ezgif.com/video-to-jpg" rel="noopener noreferrer"&gt;EZGIF&lt;/a&gt; or another tool to create an image from the video.&lt;/p&gt;

&lt;p&gt;Round the edges: You can use online tools or image editing software to round the edges of the icon.&lt;/p&gt;

&lt;p&gt;Save the icon: Create a directory to store your icons:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p ~/.local/share/icons
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save your icon in this directory and update the Icon path in your &lt;code&gt;.desktop&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
Icon=&amp;lt;HOME_DIRECTORY&amp;gt;/.local/share/icons/cursor-logo.png
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 7: Fix the AppArmor Error
&lt;/h2&gt;

&lt;p&gt;Sometimes, running the AppImage may trigger an AppArmor error. Here’s how to fix it:&lt;/p&gt;

&lt;p&gt;Create an AppArmor profile: Open a new file in the following location:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/apparmor.d/cursor-appimage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;abi &amp;lt;abi/4.0&amp;gt;,
include &amp;lt;tunables/global&amp;gt;

profile cursor /opt/cursor.AppImage flags=(unconfined) {
  userns,
  include if exists &amp;lt;local/cursor&amp;gt;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the parser to apply the changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apparmor_parser -r /etc/apparmor.d/cursor-appimage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 8: Create a Wrapper Script
&lt;/h2&gt;

&lt;p&gt;To make launching Cursor easier, create a wrapper script:&lt;/p&gt;

&lt;p&gt;Create the script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /usr/local/bin/cursor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
/opt/cursor.AppImage "$@" &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;
"$@" passes any arguments you give to the cursor command.
&amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp; runs the command in the background, keeping your terminal free.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make the script executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chmod +x /usr/local/bin/cursor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 9: Test the Setup
&lt;/h2&gt;

&lt;p&gt;Finally, navigate to your project directory in the terminal and launch Cursor with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cursor .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should open the Cursor editor without leaving a running session in the terminal.&lt;/p&gt;

&lt;p&gt;And that’s it! You’ve successfully installed and set up Cursor on Ubuntu 24.04. Enjoy your coding with AI!&lt;/p&gt;

&lt;h2&gt;
  
  
  Update Cursor
&lt;/h2&gt;

&lt;p&gt;To update Cursor to the latest version, first download the updated file from the &lt;a href="https://www.cursor.com/" rel="noopener noreferrer"&gt;official Cursor website&lt;/a&gt;, assuming the file is located in the &lt;code&gt;~/Downloads&lt;/code&gt; directory. Next, make the file executable and move it to the &lt;code&gt;/opt&lt;/code&gt; directory by running the following commands in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod +x ~/Downloads/cursor-&amp;lt;VERSION&amp;gt;.AppImage
sudo mv ~/Downloads/cursor-&amp;lt;VERSION&amp;gt;.AppImage /opt/cursor.AppImage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure to replace &lt;code&gt;&amp;lt;VERSION&amp;gt;&lt;/code&gt; with the actual version number of the file you've downloaded. Restart your computer if the icon does not appear properly.&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://askubuntu.com/questions/1516057/secure-install-cursor-sh-in-ubuntu-24-04" rel="noopener noreferrer"&gt;https://askubuntu.com/questions/1516057/secure-install-cursor-sh-in-ubuntu-24-04&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>ubuntu</category>
      <category>cursor</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
