2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

IdeaPad duet で開発環境を整える

Last updated at Posted at 2020-09-02

IdeaPad duet はイイぞ

普段メインマシンとして Macbook Pro 13 インチ を使ってるんだけど、持ち歩くにはちょっと重いからサブ機がほしいなと思っていたところに見つけたこちらの商品
Chromebook って今まで使ったことなかったけど Linux の環境が使えるということで買ってみた

image.png

本題

せっかく Linux が使えるんだからとちょっとした開発環境を整えた
あえてログも残すのでうまくいかない人は参考にしてみてください

$ uname -a
Linux penguin 5.4.40-04224-g891a6cce2d44 #1 SMP PREEMPT Tue Jun 23 20:13:49 PDT 2020 aarch64 GNU/Linux

上の結果を見て分かるとおり、CPU のアーキテクチャが x86 ではなく ARM なのがミソ

AWS CLI v2

参考: AWS CLI v2 now available for Linux ARM


$ curl -O 'https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 28.7M  100 28.7M    0     0  3687k      0  0:00:07  0:00:07 --:--:-- 3914k

$ unzip awscli-exe-linux-aarch64.zip
# 結果は省略

$ sudo ./aws/install
You can now run: /usr/local/bin/aws --version

$ aws --version
aws-cli/2.0.45 Python/3.7.3 Linux/5.4.40-04224-g891a6cce2d44 exe/aarch64.debian.10

Google Cloud SDK

参考: Google Cloud SDK for ARM architecture


$ sudo apt -y update && sudo apt -y upgrade 
Get:1 https://deb.debian.org/debian buster InRelease [122 kB]
Get:2 https://deb.debian.org/debian-security buster/updates InRelease [65.4 kB]
Ign:3 https://storage.googleapis.com/cros-packages/84 buster InRelease
Get:4 https://storage.googleapis.com/cros-packages/84 buster Release [3,119 B]
Get:5 https://storage.googleapis.com/cros-packages/84 buster Release.gpg [819 B]
Get:6 https://deb.debian.org/debian buster/main arm64 Packages [7,736 kB]
Get:7 https://storage.googleapis.com/cros-packages/84 buster/main arm64 Packages [16.1 kB]
Get:8 https://deb.debian.org/debian buster/main Translation-en [5,968 kB]
Get:9 https://deb.debian.org/debian-security buster/updates/main arm64 Packages [219 kB]                                                              
Get:10 https://deb.debian.org/debian-security buster/updates/main Translation-en [122 kB]                                                             
Fetched 14.3 MB in 12s (1,217 kB/s)                                                                                                                   
Reading package lists... Done
Building dependency tree       
Reading state information... Done
30 packages can be upgraded. Run 'apt list --upgradable' to see them.
N: Repository 'https://deb.debian.org/debian buster InRelease' changed its 'Version' value from '10.4' to '10.5'
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:

$ sudo apt-get update && sudo apt-get install google-cloud-sdk
Hit:1 https://deb.debian.org/debian buster InRelease
Hit:2 https://deb.debian.org/debian-security buster/updates InRelease
Ign:3 https://storage.googleapis.com/cros-packages/84 buster InRelease
Get:4 https://packages.cloud.google.com/apt cloud-sdk InRelease [6,349 B]
Hit:5 https://storage.googleapis.com/cros-packages/84 buster Release
Get:6 https://packages.cloud.google.com/apt cloud-sdk/main arm64 Packages [76.3 kB]
Fetched 82.7 kB in 3s (32.8 kB/s) 
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  python3-crcmod
Suggested packages:
  google-cloud-sdk-app-engine-java google-cloud-sdk-app-engine-python google-cloud-sdk-pubsub-emulator google-cloud-sdk-bigtable-emulator
  google-cloud-sdk-datastore-emulator kubectl
The following NEW packages will be installed:
  google-cloud-sdk python3-crcmod
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 69.9 MB of archives.
After this operation, 399 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://packages.cloud.google.com/apt cloud-sdk/main arm64 google-cloud-sdk all 308.0.0-0 [69.9 MB]
Get:2 https://deb.debian.org/debian buster/main arm64 python3-crcmod arm64 1.7+dfsg-1+b1 [19.0 kB]
Fetched 69.9 MB in 16s (4,339 kB/s)                                                                                                                   
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package python3-crcmod.
(Reading database ... 33282 files and directories currently installed.)
Preparing to unpack .../python3-crcmod_1.7+dfsg-1+b1_arm64.deb ...
Unpacking python3-crcmod (1.7+dfsg-1+b1) ...
Selecting previously unselected package google-cloud-sdk.
Preparing to unpack .../google-cloud-sdk_308.0.0-0_all.deb ...
Unpacking google-cloud-sdk (308.0.0-0) ...
Setting up python3-crcmod (1.7+dfsg-1+b1) ...
Setting up google-cloud-sdk (308.0.0-0) ...
Processing triggers for man-db (2.8.5-2) ...

$ gcloud --version
Google Cloud SDK 308.0.0
alpha 2020.08.28
beta 2020.08.28
bq 2.0.60
core 2020.08.28
gsutil 4.53
kubectl 1.15.11

VSCode

VSCode は残念ながら公式には ARM に対応していないのでコミュニティビルド版を使わなければいけない

Visual Studio Code for Chromebooks and Raspberry Pi
image.png

このページの the Releases page のリンクから GitHub に飛べる

現時点 (2020/09/02) では、30-Mar-20 が最新のリリースだが、20-Jan-20 の方を Linux のフォルダにダウンロード

最初、30-Mar-20 の方をインストールしてみたがなぜか VSCode のプラグインが入れられなかった
TypeScript のエラーっぽかったから諦めた

image.png

ダウンロードするのはこれの次のページの code-oss_1.42.0-1579483079_arm64.deb

あとはダウンロードしてきた .deb ファイルをダブルクリックして実行すればインストールが完了


$ code-oss --version
1.42.0
e107e5c5bf3e22dc63884aa11a410d33f96daad2
arm64

Golang

リリースページで ARM 用のダウンロードリンクを取得

Downloads - The Go Programming Language

image.png

今回はこの中から、ArchARMv8go1.15.1.linux-arm64.tar.gz を使う


$  wget https://golang.org/dl/go1.15.1.linux-arm64.tar.gz
--2020-09-02 22:17:04--  https://golang.org/dl/go1.15.1.linux-arm64.tar.gz
Resolving golang.org (golang.org)... 172.217.161.241, 2404:6800:400a:806::2011
Connecting to golang.org (golang.org)|172.217.161.241|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://dl.google.com/go/go1.15.1.linux-arm64.tar.gz [following]
--2020-09-02 22:17:06--  https://dl.google.com/go/go1.15.1.linux-arm64.tar.gz
Resolving dl.google.com (dl.google.com)... 172.217.26.110, 2404:6800:400a:807::200e
Connecting to dl.google.com (dl.google.com)|172.217.26.110|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 97722202 (93M) [application/octet-stream]
Saving to: ‘go1.15.1.linux-arm64.tar.gz’

go1.15.1.linux-arm64.tar.gz           100%[========================================================================>]  93.19M  3.26MB/s    in 24s     

2020-09-02 22:17:30 (3.93 MB/s) - ‘go1.15.1.linux-arm64.tar.gz’ saved [97722202/97722202]

$ sudo tar -C /usr/local/ -zxf go1.15.1.linux-arm64.tar.gz 

$ /usr/local/go/bin/go version
go version go1.15.1 linux/arm64

PATH が通っていなかったため ~/.bashrc に追記しシェルを再起動


$ cat .bashrc | grep PATH
export PATH=$PATH:/usr/local/go/bin

$ exec $SHELL -l 

$ go version
go version go1.15.1 linux/arm64
2
3
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
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?