Blog
This steps are to install visual studio code editor for RHEL, centos or fedora based distributions.
1. Install the key
$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
2. Create a repo file 'vscode.repo' with following configurations using root user.
$ su -
or using
$ sudo -i
Repo file 'vscode.repo'
[code] name=Visual Studio Code baseurl=https://packages.microsoft.com/yumrepos/vscode enabled=1 gpgcheck=1 gpgkey=https://packages.microsoft.com/keys/microsoft.asc
or using echo command, create a repo file.
# echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo
or For sudo users
$ sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
3. Check the updates and update the cache.
$ sudo dnf check-update
this command displays the messages like shown below
Fedora 24 - x86_64 1.9 MB/s | 47 MB 00:24 google-chrome 14 kB/s | 3.4 kB 00:00 Visual Studio Code 86 kB/s | 2.0 MB 00:23 Fedora 24 - x86_64 - Updates 127 kB/s | 24 MB 03:09 google-chrome-stable.x86_64 71.0.3578.98-1 google-chrome
4. Install the visual studio editor using below command.
$ sudo dnf install code
this command displays the messages like shown below
Visual Studio Code 94 kB/s | 2.0 MB 00:21 Failed to synchronize cache for repo 'mstuchli-Python3.5', disabling. Last metadata expiration check: 0:00:14 ago on Fri Dec 14 20:18:17 2018. Dependencies resolved. =================================================================================================================================================================================================================== Package Arch Version Repository Size =================================================================================================================================================================================================================== Installing: code x86_64 1.30.0-1544567256.el7 code 63 M Transaction Summary =================================================================================================================================================================================================================== Install 1 Package Total download size: 63 M Installed size: 184 M Is this ok [y/N]: y Downloading Packages: code-1.30.0-1544567256.el7.x86_64.rpm 173 kB/s | 63 MB 06:10 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 173 kB/s | 63 MB 06:10 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Installing : code-1.30.0-1544567256.el7.x86_64 1/1 Error in file "/usr/share/applications/evince.desktop": "" is an invalid MIME type ("" does not contain a subtype) Verifying : code-1.30.0-1544567256.el7.x86_64 1/1 Installed: code.x86_64 1.30.0-1544567256.el7 Complete!
if dnf command is not supported for older versions of fedora / centos / RHEL, we can use yum command as displayed below.
$ sudo yum check-update $ sudo yum install code
5. Command to launch visual studio code editor on fedora, centos or RHEL environment.
$ code
visual studio code editor is opened.
« Previous Next » Blog
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page