Install vscode in Ubuntu 18.04 (2)


Vscode is a very lightweight editor. You can install or even write some small plug-ins to meet different needs. It is very easy to use.

Mode 1: Graphic installation

1. Find the application center on Ubuntu desktop

2. In the software center, search for visual studio code

3. On the page, you can directly choose to install

Mode 2: Command installation

1. Download the latest version from vscode official website, Deb package download address:

Download using WGet download address

2. Installation:dpkg -i Installation package

3. After the installation is successful, execute the code command to open the vscode interface

Errors are reported due to installation package dependency during installation. The solution is as follows:

Deb installation has dependency problems and can be executedapt --fix-broken install Used to automatically repair and install the broken package

againsudo dpkg -i Installation package reinstallation

Vscode configures cmakelist and debugs C + + program

First, install the plug-in of vscode, C / C + +, C + + intelligent, cmake, cmake tools;

Run in sequence, cmake, build, debug

Switch [all] to the executable file you want to debug, and click debug (bug icon),

If prompted`Target debugging is no longer supported with the legacy driver`

This is because the installed version of cmake is too low

Solution: [note]

Check your own version of cmake. Ubuntu 16.04 installs version 3.5.1 by default, while vscode’s cmake plug-in requires cmake > = 3.7.1. Update your own cmake, reopen vscode, run it in turn, cmake, build, debug, and then you can debug successfully

This article about installing vscode (2 kinds) in Ubuntu 18.04 is introduced here. For more information about installing vscode in Ubuntu 18, please search the previous articles of developepaer or continue to browse the following articles. I hope you can support developepaer in the future!