LoginSignup
20
10

More than 3 years have passed since last update.

ChromebookにCrostiniでVisual Studio Code をインストール

Last updated at Posted at 2018-11-13

はじめに

ChromebookにCrostini入れたので、せっかくだからVisual Studio Codeもインストールしてみた。
どうやって入れたらいいかなと少し調べて試してみた。普通に公式サイトのLinux向けの方法でいけた。code.headmelted.comのんは途中でTerminal落ちた。crostini向けではないか。

Running Visual Studio Code on Linux
Visual Studio Code for Chromebooks and Raspberry Pi

追記:2019/10/05
日本語入力の方法を見つけたので、リンクを追記。

追記:2019/11/02
環境リセットしたので、入れ直したらやりかた変わってそうやった。追記した。

追記:2020/02/20
アップデートの仕方、追記した。

環境

Acer
CB3-431
Intel Celeron N3160

インストール(追記:2019/11/02)

ここみて、インストールした。
Running Visual Studio Code on Linux

Debian and Ubuntu based distributionsってところみてやったらすんなり入った。
.deb package (64-bit)のリンクをダウンロードしてcrostiniのディレクトリに保存して下記コマンドを実行するだけ。

sudo apt install ./<file>.deb

なぜかアイコンがうまく設定されなかった。まあいいか。

image.png

インストール(やりかた古そう)

まず、公式サイトに従って、.deb package (64-bit)をダウンロード
今現在、
code_1.28.2-1539735992_amd64.deb
ってバージョンやった。

次に、dpkg -iってコマンドうつと、いろいろ足りないって言われる。

penguin:~$ sudo dpkg -i code_1.28.2-1539735992_amd64.deb Selecting previously unselected package code.
(Reading database ... 44864 files and directories currently installed.)
Preparing to unpack code_1.28.2-1539735992_amd64.deb ...
Unpacking code (1.28.2-1539735992) ...
dpkg: dependency problems prevent configuration of code:
 code depends on libnotify4; however:
  Package libnotify4 is not installed.
 code depends on libnss3 (>= 2:3.26); however:
  Package libnss3 is not installed.
 code depends on libxkbfile1; however:
  Package libxkbfile1 is not installed.
 code depends on libsecret-1-0; however:
  Package libsecret-1-0 is not installed.

dpkg: error processing package code (--install):
 dependency problems - leaving unconfigured
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for mime-support (3.60) ...sudo
Errors were encountered while processing:
 code

なんか、しないといけないと思って少し調べたら無視して次いってよさそうだった。
install - Visual studio code Installation on Ubuntu 16.04 - Stack Overflow

エラーを無視して、apt-get intsall -fと続きのコマンドをコピペしていく。

sudo apt-get install -f # Install dependencies
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install code # or code-insiders

こんな感じで入ってた。
Screenshot 2018-11-12 at 9.47.05 PM.png

code

で実行できる。
GUIはこんな感じ。

image.png

MATLABコードに色をつけてくれるエクステンションも追加できる。

Screenshot 2018-11-13 at 10.52.10 PM.png

日本語入力(追記:2019/10/05)

仕組みがわかってないけれど、下記サイトを参考に設定したら日本語も入力できた。
crostiniのターミナルから実行じゃなくて、アプリをクリックして起動してもちゃんと日本語入力できた。
fcitx+mozcで動作するっぽい。Ubuntuの日本語設定のときもそんなん使った気がする。
これで、ちょっとしたプログラムだけじゃなくて、メモとかドキュメントもかけるようになった。

ChromeOSのLinux(Crostini)で日本語入力(自動起動対応) -

image.png

ちなみに、fcitxをクリックして立ち上げるとき、ずっと立ち上げ中の表示になってて途中で閉じたけれど、ちゃんと動作してそう。次のステップにすすんだらうまくいった。
fcitxをターミナルで実行するとすでに動いているよみたいなこと言われる。

$ fcitx
(省略)
(WARN-5713 /build/fcitx-SJV5lg/fcitx-4.2.9.1/src/module/dbus/dbusstuff.c:246) DBus Service Already Exists
(ERROR-5713 /build/fcitx-SJV5lg/fcitx-4.2.9.1/src/lib/fcitx/instance.c:442) Exiting.

アップデート

アップデートしろって出てくるので、ボタンを押すと下記サイトに飛ばされる。そのあとどうしたらいいのか、悩んだので試した方法を書いておく。
Visual Studio Code - Code Editing. Redefined

このサイト、見ると、
Running Visual Studio Code on Linux

こんなん書かれてる。

Installing the .deb package will automatically install the apt repository and signing key to enable auto-updating using the system's package manager.

sudo apt install codeだけでいいんかなと思ったけど、更新されない。よくわからん。
なので、一度、code_1.42.1-1581432938_amd64.debをブラウザ経由でダウンロードしてDownloadsフォルダからLinux filesフォルダに移動して、下記コマンドを実行した。
(wgetしようと思ったけれど、URLがよくわからんかった。)

~$ sudo apt install ./code_1.42.1-1581432938_amd64.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'code' instead of './code_1.42.1-1581432938_amd64.deb'
The following packages will be upgraded:
  code
1 upgraded, 0 newly installed, 0 to remove and 35 not upgraded.
Need to get 0 B/58.2 MB of archives.
After this operation, 526 kB of additional disk space will be used.
Get:1 /home/naosuke0219/code_1.42.1-1581432938_amd64.deb code amd64 1.42.1-1581432938 [58.2 MB]
(Reading database ... 70680 files and directories currently installed.)
Preparing to unpack .../code_1.42.1-1581432938_amd64.deb ...
Unpacking code (1.42.1-1581432938) over (1.39.2-1571154070) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Setting up code (1.42.1-1581432938) ...

とりあえず、更新されたっぽい。
image.png

Extensionsもそのまま入ってそう。ちゃんとできたんかなー。

おわりに

すごくいい感じ。かんたんに入っていい感じ。

20
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
10