GNU/Linux >> Linux の 問題 >  >> Fedora

VisualStudioCodeをFedora35にインストールする方法

Visual Studio Codeは、Microsoftによって開発されたクロスプラットフォームのソースコードエディターです。組み込みのデバッグサポート、構文の強調表示、コードの補完、埋め込まれたGitコントロール、コードのリファクタリング、およびスニペットがあります。

Visual Studio Marketplaceには、VSコードの機能を拡張するためのプラグインと拡張機能が多数用意されています。

ここでは、VisualStudioCodeをFedora35にインストールする方法を説明します。

VSコードリポジトリを追加

Visual Studio Codeは、FedoraオペレーティングシステムのMicrosoftリポジトリから入手できます。したがって、VS Codeパッケージを取得するには、システムにMicrosoftリポジトリを設定する必要があります。

まず、rootユーザーに切り替えます。

sudo su -

次に、ターミナルで次のコマンドを使用して、Microsoft署名GPGキーをダウンロードしてインポートします。

rpm --import https://packages.microsoft.com/keys/microsoft.asc

最後に、Microsoft VisualStudioCodeリポジトリをシステムに追加します。

cat << EOF > /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
EOF

Fedora35にVisualStudioCodeをインストールする

リポジトリをシステムに追加したら、dnfを使用します VisualStudioCodeをインストールするコマンド。

dnf install -y code

出力:

Fedora 35 - x86_64                                                             2.3 MB/s |  61 MB     00:27
Fedora 35 openh264 (From Cisco) - x86_64                                       2.9 kB/s | 2.5 kB     00:00
Fedora Modular 35 - x86_64                                                     462 kB/s | 2.6 MB     00:05
Fedora 35 - x86_64 - Updates                                                   1.9 MB/s | 9.8 MB     00:05
Fedora Modular 35 - x86_64 - Updates                                           1.3 MB/s | 3.3 MB     00:02
Visual Studio Code                                                              11 MB/s |  19 MB     00:01
Dependencies resolved.
===============================================================================================================
 Package                      Architecture       Version                              Repository          Size
===============================================================================================================
Installing:
 code                         x86_64             1.62.0-1635954170.el7                code               103 M
Installing dependencies:
 gtk2                         x86_64             2.24.33-5.fc35                       fedora             3.5 M
 ibus-gtk2                    x86_64             1.5.25-4.fc35                        fedora              27 k
Installing weak dependencies:
 libcanberra-gtk2             x86_64             0.30-26.fc35                         fedora              25 k

Transaction Summary
===============================================================================================================
Install  4 Packages

Total download size: 106 M
Installed size: 306 M
Downloading Packages:
(1/4): libcanberra-gtk2-0.30-26.fc35.x86_64.rpm                                 48 kB/s |  25 kB     00:00
(2/4): ibus-gtk2-1.5.25-4.fc35.x86_64.rpm                                       50 kB/s |  27 kB     00:00
(3/4): code-1.62.0-1635954170.el7.x86_64.rpm                                   8.6 MB/s | 103 MB     00:11
(4/4): gtk2-2.24.33-5.fc35.x86_64.rpm                                          196 kB/s | 3.5 MB     00:18
---------------------------------------------------------------------------------------------------------------
Total                                                                          5.9 MB/s | 106 MB     00:18
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                       1/1
  Installing       : libcanberra-gtk2-0.30-26.fc35.x86_64                                                  1/4
  Installing       : gtk2-2.24.33-5.fc35.x86_64                                                            2/4
  Installing       : ibus-gtk2-1.5.25-4.fc35.x86_64                                                        3/4
  Installing       : code-1.62.0-1635954170.el7.x86_64                                                     4/4
  Running scriptlet: code-1.62.0-1635954170.el7.x86_64                                                     4/4
  Verifying        : gtk2-2.24.33-5.fc35.x86_64                                                            1/4
  Verifying        : ibus-gtk2-1.5.25-4.fc35.x86_64                                                        2/4
  Verifying        : libcanberra-gtk2-0.30-26.fc35.x86_64                                                  3/4
  Verifying        : code-1.62.0-1635954170.el7.x86_64                                                     4/4

Installed:
  code-1.62.0-1635954170.el7.x86_64         gtk2-2.24.33-5.fc35.x86_64      ibus-gtk2-1.5.25-4.fc35.x86_64
  libcanberra-gtk2-0.30-26.fc35.x86_64

Complete!

VisualStudioCodeを起動する

VS Codeがシステムにインストールされたら、アクティビティに移動して起動できます。>> VisualStudioCodeを検索 またはコマンドcodeを実行します ターミナルで。

Fedora35で実行されているVisualStudioCode:

VisualStudioコードを更新する

Microsoftは、VisualStudioCodeの更新プログラムを毎月リリースしています。したがって、Visual Studio Codeを最新バージョンに更新するには、以下のコマンドを使用します。

dnf update code

結論

Visual StudioCodeがFedora35に正常にインストールされたことを願っています。次に、拡張機能をインストールし、好みに応じてVSCodeを構成できます。


Fedora
  1. Ubuntu20.04以降にVisualStudioCodeをインストールする方法

  2. Ubuntu18.04にVisualStudioCodeをインストールする方法

  3. CentOS7にVisualStudioCodeをインストールするにはどうすればよいですか?

  1. Ubuntu20.04にVisualStudioCodeをインストールする方法

  2. CentOS7にVisualStudioCodeをインストールする方法

  3. CentOS8にVisualStudioCodeをインストールする方法

  1. Debian10にVisualStudioCodeをインストールする方法

  2. Debian9にVisualStudioCodeをインストールする方法

  3. Ubuntu20.04にMicrosoftVisualStudioCodeをインストールする方法