0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

TypstやMarpインストールのためにWSL2でSnapdを動かす

Posted at

概要

MarpやTypstをUbuntu on WSL2にインストールするためsnapdを使いたくなったが、どうやらsnapdはsystemdが動いていないとだめらしい。

具体的には以下のようなエラーが出た。

error: cannot communicate with server: Post http://localhost/v2/snaps/typst: dial unix /run/snapd.socket: connect: no such file or directory

いろいろ記事があるが、2024年現在ではconfigを書けば簡単にsystemdを起動できる

手順は以下の通り。

  1. wslのupdate
  2. configの記述
  3. wslの再起動

WSLのupdate

WindowsのPowershell等で

wsl --update

とする。

Configの記述

WSL内のUbuntuに入り、/etc/wsl.confというファイルを作成し、その中で

[boot]
systemd=true

と記述し、保存する。

WSLの再起動

WindowsのPowershell等でWSL内のUbuntuの再起動を行う。

wsl --shutdown

とし、再びUbuntuにアクセスすれば、snapコマンドから目的のパッケージがインストールできるはずである。

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?