Armadilloフォーラム

WSL2 に開発環境を作りたい

furuya

2024年5月9日 11時08分

wsl で 開発環境の構築を進めていますが apt-get install x1-essential で失敗します。
対応方法をお教えください。

sudo apt-get install x1-essential
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
x1-essential : Depends: python but it is not installable
E: Unable to correct problems, you have held broken packages.
--
前提
次のURLを参考に進めています
https://armadillo.atmark-techno.com/blog/8700/3542

下のコマンドが、失敗したので 
atmark@PC-0050:~$ sudo apt-key adv --keyserver pgp.nic.ad.jp --recv-keys 3874DA771B351757
フォーラムの情報を参考に
https://download.atmark-techno.com/debian/atmark-debian.gpg をダウンロードし
cp atmark-debian.gpg /etc/apt/trusted.gpg.d  /etc/apt/trusted.gpg.d にコピーしました

大前提
当方 Windowsメインで開発していることもあり、Windows とのファイルのやり取り等を簡単に行いたいので
WSL2での開発環境構築を試みています

コメント

at_makoto.sato

2024年5月9日 11時36分

佐藤です。

> 前提
> 次のURLを参考に進めています
> https://armadillo.atmark-techno.com/blog/8700/3542
上記ブログに、以下の説明がありますが、
---
atmark-techno.listには、以下の内容を記述して下さい。

deb http://download.atmark-techno.com/debian/ stretch main contrib non-free

---
この部分を

deb https://download.atmark-techno.com/debian/ bookworm main contrib non-free-firmware
deb-src https://download.atmark-techno.com/debian/ bookworm main contrib

と読み替えて試してみてください。

furuya

2024年5月9日 13時02分

早々の回答ありがとうございます。
試してみましたがエラーメッセージに変わりましたが、インストール失敗します。
元ブログの 3,5、6相当をやり直してみました。
sudo apt-get upgrade で 次のようになっているのが気になります。
 Ign:5 https://download.atmark-techno.com/debian bookworm InRelease 

ここからログ

admin@Eagle2023:~$ cat /etc/apt/sources.list.d/atmark-techno.list
deb https://download.atmark-techno.com/debian/ bookworm main contrib non-free-firmware
deb-src https://download.atmark-techno.com/debian/ bookworm main contrib
---
admin@Eagle2023:~$ sudo apt-get update
Hit:1 http://ftp.debian.org/debian bookworm-backports InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease
Hit:3 http://security.debian.org/debian-security bookworm-security InRelease
Hit:4 http://deb.debian.org/debian bookworm-updates InRelease
Ign:5 https://download.atmark-techno.com/debian bookworm InRelease
Hit:6 https://download.atmark-techno.com/debian bookworm Release
Reading package lists... Done
---
admin@Eagle2023:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
----
admin@Eagle2023:~$ sudo apt-get install x1-essential
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
x1-essential : Depends: firmware-atheros but it is not installable
Depends: firmware-misc-nonfree but it is not installable
E: Unable to correct problems, you have held broken packages.

at_makoto.sato

2024年5月9日 14時26分

佐藤です。

/etc/apt/sources.list ファイルの内容はどうなっているでしょうか。

furuya

2024年5月9日 15時09分

/etc/apt/source.list の内容は次の通りです
cat /etc/apt/sources.list
deb http://deb.debian.org/debian bookworm main
deb http://deb.debian.org/debian bookworm-updates main
deb http://security.debian.org/debian-security bookworm-security main

この中身は、一度WSLを 消して wsl --install -d debian からやり直したものです。
そのためか、前回とは結果が異なります。

また、素人考えでわからないのですが、
pdf の 5. Armadillo用ソースリストが正常に作成できたか確認します
で次のエラーが出ているのですが、これが原因なのでしょうか?
Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 54.64.102.35 443]
Reading package lists... Done

ファイル ファイルの説明
WSL2導入手順.pdf

at_makoto.sato

2024年5月9日 15時36分

佐藤です。

> また、素人考えでわからないのですが、
> pdf の 5. Armadillo用ソースリストが正常に作成できたか確認します
> で次のエラーが出ているのですが、これが原因なのでしょうか?
> Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 54.64.102.35 443]
> Reading package lists... Done
ダウンロードしてきた atmark-debian.gpg は正しくコピーできていますでしょうか。
以下のコマンドを実行して同じ値になってますでしょうか。

$ md5sum atmark-debian.gpg 
73b0e81f089c19468c1387fcbfa59312  atmark-debian.gpg

また、/etc/apt/source.list の
deb http://deb.debian.org/debian bookworm main
deb http://deb.debian.org/debian bookworm-updates main
deb http://security.debian.org/debian-security bookworm-security main
をそれぞれ
deb http://deb.debian.org/debian bookworm main non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main non-free-firmware
に書き換えてみてください。

at_makoto.sato

2024年5月9日 15時48分

佐藤です。

立て続けにすいません。
> > また、素人考えでわからないのですが、
> > pdf の 5. Armadillo用ソースリストが正常に作成できたか確認します
> > で次のエラーが出ているのですが、これが原因なのでしょうか?
> > Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 54.64.102.35 443]
> > Reading package lists... Done
以下を実行してみてから再度試してみてください。

 $ sudo apt install ca-certificates

furuya

2024年5月9日 16時10分

md5sum の結果は次の通りです。完全に一致しているように見えます
※ コピーしただけで コマンド等は発行しておりません

admin@Eagle2023:~$ md5sum /etc/apt/trusted.gpg.d/atmark-debian.gpg
73b0e81f089c19468c1387fcbfa59312  /etc/apt/trusted.gpg.d/atmark-debian.gpg

#前回の返事で 4行目をコピーし忘れていたので、4行目も  non-free-firmware の追加したものと、してないものの両方で確認しました。

admin@Eagle2023:~$ cat /etc/apt/sources.list
deb http://deb.debian.org/debian bookworm main non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main non-free-firmware
deb http://ftp.debian.org/debian bookworm-backports main
 
作業後のログ
admin@Eagle2023:~$ sudo apt-get update
Hit:1 http://ftp.debian.org/debian bookworm-backports InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease
Hit:3 http://security.debian.org/debian-security bookworm-security InRelease
Hit:4 http://deb.debian.org/debian bookworm-updates InRelease
Ign:5 https://download.atmark-techno.com/debian bookworm InRelease
Ign:5 https://download.atmark-techno.com/debian bookworm InRelease
Ign:5 https://download.atmark-techno.com/debian bookworm InRelease
Err:5 https://download.atmark-techno.com/debian bookworm InRelease
  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 54.64.102.35 443]
Reading package lists... Done
W: https://download.atmark-techno.com/debian/dists/bookworm/InRelease: No system certificates available. Try installing ca-certificates.
W: https://download.atmark-techno.com/debian/dists/bookworm/InRelease: No system certificates available. Try installing ca-certificates.
W: https://download.atmark-techno.com/debian/dists/bookworm/InRelease: No system certificates available. Try installing ca-certificates.
W: https://download.atmark-techno.com/debian/dists/bookworm/InRelease: No system certificates available. Try installing ca-certificates.
W: Failed to fetch https://download.atmark-techno.com/debian/dists/bookworm/InRelease  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 54.64.102.35 443]
W: Some index files failed to download. They have been ignored, or old ones used instead.
admin@Eagle2023:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
admin@Eagle2023:~$ sudo apt-get install x1-essential
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package x1-essential

furuya

2024年5月9日 16時16分

sudo apt install ca-certificates
を試すと、
全て正しくエラーなくインストールされたように見えます。
ありがとうございました。

Windows メインの人間も多いので、WSL2での開発環境整備についてもFAQとしていただけると嬉しいです。

furuya

2024年5月9日 16時26分

一応 サンプルのコンパイルができるとこまで確認しました。
手元に G3Lが無いので、実機テストはまた後でします。
重ね重ねありがとうございます。

admin@Eagle2023:/mnt/c/jsv2/arm$ cat test.c
// test.c
#include <stdio.h>
 
int main()
{
        puts("hello");
        return 0;
}
admin@Eagle2023:/mnt/c/jsv2/arm$ arm-linux-gnueabihf-gcc test.c -o test
admin@Eagle2023:/mnt/c/jsv2/arm$ file test
test: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=cfe4ebdb1c22b34182cdceab50ac495d125c40f8, for GNU/Linux 3.2.0, not stripped

at_makoto.sato

2024年5月9日 16時34分

佐藤です。

ブログの情報が古く申し訳ありませんでした。
こちら更新いたします。

また、開発環境としてはVMWareのイメージとしてATDEを提供しております。
https://armadillo.atmark-techno.com/resources/software/atde/atde-v10
こちらの使用もご検討ください。
ホストマシン(Windows)とのファイル共有もできるかと思います。
https://armadillo.atmark-techno.com/blog/615/10708

furuya

2024年5月9日 17時01分

VMWare で使えるのは知っているのですが。
VMWare は 仕事で使うには有料。会社の購買がめんどくさい (_ _;;;)
 複数人の開発になると、そのたびに 購入する必要もあるし....
Hyper-V との共存ができない or 難しい
 他のHyper-Vで作ったファイルもあるので...

WSLで環境が作れるとやはりうれしいです。