5
8

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.

Ubuntu 21.10にKindleをインストール

Last updated at Posted at 2021-10-27

TL;DR

sudo apt purge -y 'wine*' \
  && sudo dpkg --add-architecture i386 \
  && wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add - \
  && sudo add-apt-repository -y "deb https://dl.winehq.org/wine-builds/ubuntu/ $(lsb_release -cs) main" \
  && sudo apt update \
  && wine_version=staging \
  && sudo apt install --install-recommends -y winehq-$wine_version winetricks \
  && mono_version=$(iconv -cfutf16 /opt/wine-$wine_version/lib64/wine/x86_64-windows/appwiz.cpl 2>/dev/null | grep -Pao '(?<=wine-mono-).+(?=-x86\.msi)') \
  && gecko_version=$(iconv -cfutf16 /opt/wine-$wine_version/lib64/wine/x86_64-windows/appwiz.cpl 2>/dev/null | grep -Pao '(?<=wine-gecko-).+(?=-x86_64\.msi)') \
  && mkdir -p ~/.cache/wine \
  && wget -nc https://dl.winehq.org/wine/wine-mono/$mono_version/wine-mono-$mono_version-x86.msi https://dl.winehq.org/wine/wine-gecko/$gecko_version/wine-gecko-$gecko_version-x86{,_64}.msi -P ~/.cache/wine/ \
  && winetricks -q cjkfonts vcrun2013 \
  && mkdir -p "$HOME/.wine/drive_c/users/$USER/AppData/Local/Amazon/Kindle" \
  && wget -nc --trust-server-names http://www.amazon.co.jp/kindlepcdownload \
  && wine KindleForPC-installer-*.exe

既存のWineを削除

sudo apt purge -y 'wine*'

Wineをインストール

sudo dpkg --add-architecture i386 \
  && wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add - \
  && sudo add-apt-repository -y "deb https://dl.winehq.org/wine-builds/ubuntu/ $(lsb_release -cs) main" \
  && sudo apt update \
  && wine_version=staging \
  && sudo apt install --install-recommends -y winehq-$wine_version winetricks

wine-stable 6.0.2 build fails in Ubuntu 21.10 が解決されたらwine-stableが使えると思います。

MonoとGeckoのインストーラをダウンロード

mono_version=$(iconv -cfutf16 /opt/wine-$wine_version/lib64/wine/x86_64-windows/appwiz.cpl 2>/dev/null | grep -Pao '(?<=wine-mono-).+(?=-x86\.msi)') \
  && gecko_version=$(iconv -cfutf16 /opt/wine-$wine_version/lib64/wine/x86_64-windows/appwiz.cpl 2>/dev/null | grep -Pao '(?<=wine-gecko-).+(?=-x86_64\.msi)') \
  && mkdir -p ~/.cache/wine \
  && wget -nc https://dl.winehq.org/wine/wine-mono/$mono_version/wine-mono-$mono_version-x86.msi https://dl.winehq.org/wine/wine-gecko/$gecko_version/wine-gecko-$gecko_version-x86{,_64}.msi -P ~/.cache/wine/

インストーラをダウンロードすることで以下のダイアログを省略できます。
image.png
image.png

日本語フォントをインストール

文字化けが起きなくなります。vcrun2013でmfc120のエラーがなくなると思います。

winetricks -q cjkfonts vcrun2013

Kindleディレクトリを作成

Multiple applications and games need support for Windows Vista+ User Shell Folder layout, specifically 'Local AppData' (Amazon Kindle for PC)

mkdir -p "$HOME/.wine/drive_c/users/$USER/AppData/Local/Amazon/Kindle"

Kindleをダウンロード

wget -nc --trust-server-names http://www.amazon.co.jp/kindlepcdownload

Kindleをインストール

wine KindleForPC-installer-*.exe

エビデンス

5
8
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
5
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?