Created
April 3, 2025 04:33
-
-
Save techcaotri/27db271aae400d2dc8811ef0dbcd9294 to your computer and use it in GitHub Desktop.
Download, extract and install the latest Cursor IDE on Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Remove any previously installed versions if they exist | |
rm -rf ./squashfs-root || true | |
rm -rf $HOME/Dev/Cursor || true | |
rm -f $HOME/.local/share/applications/cursor.desktop || true | |
rm -f Cursor-*.AppImage | |
# # Download the latest version | |
curl -s "https://www.cursor.com/api/download?releaseTrack=stable&platform=linux-x64" | jq .downloadUrl | xargs axel | |
# # Extract AppImage and fix permissions | |
chmod +x ./Cursor-*.AppImage # Make executable | |
./Cursor-*.AppImage --appimage-extract # Extract appimage | |
# rm ./Cursor-*.AppImage | |
mv ./squashfs-root $HOME/Dev/Cursor # Move extracted image to program directory | |
chown -R $USER: $HOME/Dev/Cursor # Change owner to current user | |
chmod 4755 $HOME/Dev/Cursor/AppRun # Fix permissions for the sandbox file | |
find $HOME/Dev/Cursor -type d -exec chmod 755 {} \; # Some directories are only accessible by root which prevents application from launching. Lets fix | |
chmod 644 $HOME/Dev/Cursor/code.png # Make sure the app icon has permission to be viewed | |
# Create Desktop entry | |
cat > cursor.desktop <<EOL | |
[Desktop Entry] | |
Name=Cursor AI IDE | |
Exec=$HOME/Dev/Cursor/AppRun | |
Icon=$HOME/Dev/Cursor/code.png | |
Type=Application | |
Categories=Development; | |
EOL | |
# Set permisisons for .desktop file and move it to the correct directory | |
chown $USER: cursor.desktop | |
chmod 644 cursor.desktop | |
mv cursor.desktop $HOME/.local/share/applications |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment