vscode command not found - Ubuntu
How to Install vscode Command on Ubuntu
If you are using Ubuntu and trying to install the vscode command, you may encounter the error “vscode command not found”. This is because vscode is not a built-in command in Ubuntu.
What is vscode?
vscode is a popular source-code editor developed by Microsoft for Windows, Linux, and macOS. It provides features like debugging, syntax highlighting, intelligent code completion, snippets, and code refactoring.
Installation Steps
To install vscode on Ubuntu, follow these steps:
-
Download Visual Studio Code: Visit the official website and download the
.debpackage for Ubuntu. -
Install Visual Studio Code: Once the download is complete, navigate to the directory where the
.debfile is saved and run the following command to installvscode:sudo dpkg -i <file_name>.deb -
Launch Visual Studio Code: After the installation is complete, you can launch
vscodeby searching for it in the application menu or by running the following command in the terminal:code -
Set Up Command Line Shortcut: To be able to launch
vscodefrom the command line, you can set up a symbolic link by running the following command:sudo ln -s /usr/share/code/bin/code /usr/bin/code
Now you should be able to run the vscode command in your terminal and open the Visual Studio Code editor.
Compatibility with Ubuntu
If the above commands are not compatible with your Ubuntu system, you can try the following alternative steps:
-
Snap Package: You can install
vscodevia the Snap package manager by running the commandsudo snap install code --classic. -
PPA Repository: If you prefer to install from a repository, you can add the Visual Studio Code repository by running the commands:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/ sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list' sudo apt-get update sudo apt-get install code
By following these steps, you should be able to successfully install and use the vscode command on your Ubuntu system.
Conclusion
In this tutorial, you learned how to install the vscode command on Ubuntu and different methods to ensure compatibility with your system. Visual Studio Code is a powerful tool for developers, and having the command line shortcut makes it even more convenient to use. Happy coding!