No apt package "code", but says it's already installed.

February 3, 2024, 02:11

.gaedel

Installing VSCODE
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done

No apt package "code", but there is a snap with that name.
Try "snap install code"

E: Unable to locate package code
gaedel@gaedel-VirtualBox:~$ snap install code
snap "code" is already installed, see 'snap help refresh'

minkleee

It's installed through snap not apt

minkleee

And there should be a package called code

minkleee

Update and try again maybe

k9t33n

just run snap install code and your fine

.gaedel

I did run
snap install code
, you can see in the second-to-last line. But the last line says
snap "code" is already installed, see 'snap help refresh'
. So then when I ran the pico_setup.sh file again, you can see in the message it said
No apt package "code", but there is a snap with that name.
Since it says the code is already installed, why does the pico_setup.sh say there's no apt package "code" and errors out?

.gaedel

This is the "code" section from the pico_setup.sh file that failed. Do you see anything that might be wrong in this section?
if [[ "$SKIP_VSCODE" == 1 ]]; then
    echo "Skipping VSCODE"
else
    echo "Installing VSCODE"
    sudo apt install -y $VSCODE_DEPS

    # Get extensions
    code --install-extension marus25.cortex-debug
    code --install-extension ms-vscode.cmake-tools
    code --install-extension ms-vscode.cpptools
fi

k9t33n

no but what does snap help refresh output?

k9t33n

also just a sudo apt update; sudo apt upgrade -y; sudo reboot now could fix a few things