Microsoft Visual Studio is an Integrated Development Environment (IDE) used to develop computer programs, web, and mobile applications. It is an IDE for .NET AND C++ developers that is available for Windows, macOS, and Linux operating systems. It is packed with a selection of features and tools to advance and improve each level of software development. The 64-bit IDE makes it easier to work with large projects and more complex workloads.

Features of Visual Studio Code

  • Productive as it can scale to work on projects of any size.
  • Modern and cross-platform with responsive UIs
  • Integrated debugging
  • Analyze how much code you’re testing and see instant results.
  • Supports IntelliCode which is a powerful set of automatic code completion tools.
  • CodeLens helps you easily find important insights.
  • Live Share’s real-time collaboration sessions to speed up your team’s edit and debugging cycles.
  • Seamless cloud integration

This guide shows you how to install and Use Visual Studio Code on Ubuntu / Debian

Install Visual Studio Code on Ubuntu / Debian

Install missing dependencies.

sudo apt update
sudo apt install wget gpg

Download and install the official GPG key with the following command.

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg

Install the repository with the follwoing script.

sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg

Update the package cache then install the visual studio package with the following command

sudo apt install apt-transport-https
sudo apt update
sudo apt install code

Check the version

$ code -v
1.71.0
3b889b090b5ad5793f524b5d1d39fda662b96a2a
x64

Launch the application from the command line or through the application launcher

code

The Program opens as shown below for the first time.

Use Visual Studio Code on Ubuntu|Debian

The interface is not hard to go about. It has shortcuts to various tools like Source controls, Search, Testing, Run & Debug, and Extensions.

You can change the color theme at the start of the application. You can also go to the command palette by clicking ctrl+shift+p and then search color themes

You can then search for a theme and choose for the list the one you would want to apply.

You can also click on browse additional and get a list of other available themes. You can also search for the theme by its name.

You can also add extensions that might be required by the editor to work with different programming languages. For Example Python extension that includes features like IntelliSense and debugging.

You can also add another extension for HTML preview on the layout. This allows you to see the HTML output on the editor without opening the browser.

Create a Program with Visual Studio Code

We will create a simple python program from the editor to see how it runs. You should have Python on your system if not, Install Python and pip on your system:

sudo apt install python3 python3-venv python3-pip

Install get-pip.py to install other Python packages

curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py

Verify Python installation:

$ python3 --version
Python 3.10.4

Create a folder that will hold your project files and assign proper permissions to that directory.

sudo mkdir VSProjects
sudo chown -R technixleo /home/technixleo/VSProjects

Replace technixleo with your actual username and the directory.

Change to that directory and open Visual studio code from that Project Workspace.

cd VSProjects
code .

On the visual studio code interface, click on New File and name your File with the .py extension.

Press Enter and the editor automatically opens as shown below.

Add the following codes or create a simple Python program of your choice.

print("____________________")
print(" Hello From Technixleo! ")
print("____________________")

It appears as shown below.

Then execute the program with the run command or press F.

The results appear on the inbuilt terminal.

Uninstall Visual Studio Code from Ubuntu / Debian

To uninstall, use the following command

sudo apt remove code

Conclusion

We have installed Visual Studio Code on Ubuntu / Debian. Visual Studio Code is a free code editor that is built on open source and runs everywhere with hundreds of programming languages supported. It supports different programming languages and provides additional features that may be required by the languages while using them.

LEAVE A REPLY

Please enter your comment!
Please enter your name here