Warning: failed loading '/etc/yum.repos.d/vscode.repo', skipping., Last metadata expiration check: ... appears in many commands

Asked 2 years ago, Updated 2 years ago, 49 views

Step by installing "Vscode" in CentOs8 - mebee

I tried to install vscode in CentOS(8) by referring to the article in , but it was not possible to install it, and since then, many commands (such as dnf info~) have been used first

Warning: failed loading '/etc/yum.repos.d/vscode.repo', skip.
Last metadata expiration check: xx:xx:xx ago on Frix Oct 2020 xx:xx:xx AM UTC.

It is now displayed as .
How do I turn it off?

Code typed

 sudorpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo vi /etc/yum.repos.d/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
    
sudo dnf install code

environment
·VirtualBox (host environment: Windows 10)

By the way
Why couldn't I install vscode?

centos vscode dnf

2022-09-30 16:43

1 Answers

The warning you see appears to be due to some formatting error in the definition file of the repository you created.
As far as the code in the question is concerned, there seems to be no problem, but what happens if I delete it and recreate it?

The content is ultimately the same as the article that was referenced, but there is also a way to register on the VSCode site as a one-liner, so I will introduce it to you.

Visual Studio Code on Linux

 sudorpm --import https://packages.microsoft.com/keys/microsoft.asc
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'


2022-09-30 16:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.