Installing Cursor via APT .deb Package Breaks apt update

I’ve similar problem on Linux Mint, that what I’ve do, it works for me - instruction was prepared by AI.

After installing Cursor IDE on Ubuntu (or Linux Mint based on Ubuntu), you may run into errors during apt-get update such as:

The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 42A1772E62E492D6
E: The repository 'https://downloads.cursor.com/aptrepo stable InRelease' is not signed.

or

E: Conflicting values set for option Signed-By regarding source https://downloads.cursor.com/aptrepo/ ...

This guide explains how to fix these issues properly (without using deprecated apt-key).


1. Remove Old/Duplicate Entries

Check if you have multiple repo entries for Cursor:

grep -R "downloads.cursor.com/aptrepo" /etc/apt/sources.list /etc/apt/sources.list.d -n

Typical duplicates:

  • /etc/apt/sources.list.d/cursor.list
  • /etc/apt/sources.list.d/cursor.sources

:backhand_index_pointing_right: Keep only one of them.
If you prefer the traditional .list format, disable the .sources file:

sudo mv /etc/apt/sources.list.d/cursor.sources /etc/apt/sources.list.d/cursor.sources.disabled

Or vice versa (if you prefer Deb822 .sources), disable the .list file.


2. Add the Cursor GPG Key (modern method)

Create a dedicated keyring directory and import Cursor’s official key:

sudo mkdir -p /etc/apt/keyrings

curl -fsSL https://downloads.cursor.com/keys/anysphere.asc \
  | gpg --dearmor \
  | sudo tee /etc/apt/keyrings/cursor.gpg >/dev/null

sudo chmod 644 /etc/apt/keyrings/cursor.gpg

3. Configure the Repository with signed-by

If using the .list format, create/update:

echo 'deb [arch=amd64 signed-by=/etc/apt/keyrings/cursor.gpg] https://downloads.cursor.com/aptrepo stable main' \
 | sudo tee /etc/apt/sources.list.d/cursor.list

If using .sources format (Deb822), make sure it looks like this:

Types: deb
URIs: https://downloads.cursor.com/aptrepo
Suites: stable
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/cursor.gpg

4. Remove Old Keys from trusted.gpg

If you previously added Cursor with apt-key, the key may still live in the deprecated global keyring (/etc/apt/trusted.gpg). This can cause warnings.

List keys:

sudo gpg --no-default-keyring --keyring /etc/apt/trusted.gpg --list-keys

Delete the Cursor key (ID: 42A1772E62E492D6):

sudo gpg --no-default-keyring --keyring /etc/apt/trusted.gpg --delete-key 42A1772E62E492D6

5. Clean Up APT Warnings

  • If you see:

    Ignoring file "nosnap.backup" in /etc/apt/preferences.d/ ...
    

    → Rename or delete the file:

    sudo mv /etc/apt/preferences.d/nosnap.backup /etc/apt/preferences.d/nosnap.pref
    

    or

    sudo rm /etc/apt/preferences.d/nosnap.backup
    

6. Update & Upgrade

Now you should be able to update without errors:

sudo apt-get update
sudo apt-get upgrade

7. About “kept back” packages

Sometimes you’ll see:

Some packages may have been kept back due to phasing.

This is normal on Ubuntu — updates are rolled out in phases. You can:

  • Wait (recommended), or

  • Force upgrade immediately:

    sudo apt-get full-upgrade
    

    or

    sudo apt-get -o APT::Get::Always-Include-Phased-Updates=true upgrade
    

:white_check_mark: Final Result

  • Cursor repository works with no GPG errors.
  • No more apt-key deprecation warnings.
  • System updates cleanly without duplicate repos or key conflicts.

Notes

  • Cursor also provides an AppImage version, which avoids repo/key issues. Just download it, make it executable, and run:

    chmod +x ~/Downloads/cursor-*.AppImage
    ~/Downloads/cursor-*.AppImage
    
4 Likes