KStars Flatpak を追う

Flatpak版 KStarsを使うと、自動に更新されたらしい。
その為に、安定して動いていた、コミットが更新されたらしく、不具合を追うようになりました。

ここには、その作業を記載しています。

KStars / Ekos , Flatpak版、こちらの環境では、Local Astrometryが使えていません。
プレートソルブにて特定の動作で、KStars / Ekos , Flatpak版がダウンしています。
2026年10月21日現在、Local Astrometry動作とプレートソルブ動作不具合は確認していません。

Flatpak の”今”を調べる

現在のコミットを表示

$ flatpak info --user org.kde.kstars

KStars - Desktop Planetarium

          ID: org.kde.kstars
         Ref: app/org.kde.kstars/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: 3.8.5
     License: GPL-2.0+
      Origin: flathub
  Collection: org.flathub.Stable
Installation: user
   Installed: 957.5 MB
     Runtime: org.kde.Platform/x86_64/6.10
         Sdk: org.kde.Sdk/x86_64/6.10

      Commit: 110b41247bf4b838e944905495f2537ad1b347cc528cdf32316875ee5e0db136
      Parent: 5f8c05ec2b8c95a0a1578239c1ef88e2ca15607033426b0b73ec717ffca1501a
     Subject: Merge pull request #160 from knro/fix-focus-settle-crash (a919fa71c20c)
        Date: 2026-10-03 05:53:00 +0000

KStars の更新をブロックしているか確認します

$ flatpak mask --user
Masked patterns:
  org.kde.kstars

KStars に更新があるか確認します

$ flatpak remote-info --log flathub org.kde.kstars
Remote ‘flathub’ found in multiple installations:

   1) system
   2) user

Which do you want to use (0 to abort)? [0-2]: 2

KStars - Desktop Planetarium

        ID: org.kde.kstars
       Ref: app/org.kde.kstars/x86_64/stable
      Arch: x86_64
    Branch: stable
   Version: 3.8.5
   License: GPL-2.0+
Collection: org.flathub.Stable
  Download: 480.1 MB
 Installed: 957.5 MB
   Runtime: org.kde.Platform/x86_64/6.10
       Sdk: org.kde.Sdk/x86_64/6.10

    Commit: e44f942857288863d34a9b37efdea4c35cef7c3d9c25738a28344d27449fbdf4
    Parent: 110b41247bf4b838e944905495f2537ad1b347cc528cdf32316875ee5e0db136
   Subject: Merge pull request #161 from knro/update-3.8.5-patch (e464afcc596a)
      Date: 2026-10-10 11:13:13 +0000
   History: 

    Commit: 110b41247bf4b838e944905495f2537ad1b347cc528cdf32316875ee5e0db136
   Subject: Merge pull request #160 from knro/fix-focus-settle-crash (a919fa71c20c)
      Date: 2026-10-03 05:53:00 +0000

    Commit: 5f8c05ec2b8c95a0a1578239c1ef88e2ca15607033426b0b73ec717ffca1501a
   Subject: Merge pull request #157 from s-pouya-sh/patch-18 (a8ca8995e0f7)
      Date: 2026-08-16 11:09:54 +0000

    Commit: 98a725b70de65599ea7f4e479efe6d891506d4fa9e7df620a9ed54e818d72584
   Subject: Merge pull request #155 from s-pouya-sh/patch-17 (a3981b62f214)
      Date: 2026-08-09 16:46:49 +0000

    Commit: 435860949507c59cdc7adb389e014b6c10a23a8d5add5b15fdd658d2bc66d1c0
   Subject: Merge pull request #154 from s-pouya-sh/patch-17 (7ea6cc80236d)
      Date: 2026-08-09 14:15:48 +0000

この現時点でのコミットは、

Commit: e44f942857288863d34a9b37efdea4c35cef7c3d9c25738a28344d27449fbdf4
   Date: 2026-10-10 11:13:13 +0000

その親コミットは次のとおりです。

Commit: 110b41247bf4b838e944905495f2537ad1b347cc528cdf32316875ee5e0db136
   Date: 2026-10-03 05:53:00 +0000

Flatpak の更新履歴を確認

$ flatpak history --user
Time             Change        Application                           Branch      Installation Remote
10月 12 16:23:35 pull          org.kde.kstars                        stable      user         flathub
10月 12 16:23:36 deploy update org.kde.kstars                        stable      user         flathub
10月 14 18:34:19 pull          org.freedesktop.Platform.GL.default   25.08       user         flathub
10月 14 18:34:20 deploy update org.freedesktop.Platform.GL.default   25.08       user         flathub
10月 14 18:34:22 pull          org.freedesktop.Platform.GL.default   25.08-extra user         flathub
10月 14 18:34:22 deploy update org.freedesktop.Platform.GL.default   25.08-extra user         flathub
10月 14 18:34:24 pull          org.freedesktop.Platform.VAAPI.Intel  25.08       user         flathub
10月 14 18:34:24 deploy update org.freedesktop.Platform.VAAPI.Intel  25.08       user         flathub
10月 14 18:34:24 pull          org.freedesktop.Platform.codecs-extra 25.08-extra user         flathub
10月 14 18:34:24 deploy update org.freedesktop.Platform.codecs-extra 25.08-extra user         flathub
10月 12 16:23:35 pull          org.kde.kstars
10月 12 16:23:36 deploy update org.kde.kstars

2026年10月12日に KStars の更新が行われたことが分かります。

KStars の自動更新を止める

$ flatpak mask --user org.kde.kstars

確認します。

$ flatpak mask --user
Masked patterns:
  org.kde.kstars

KStars の更新をブロックしているか確認

自動更新の仕組みをさらに調べる

ユーザー単位のタイマー

$ systemctl --user list-timers --all | grep -Ei 'flatpak|update'
Sun 2026-10-18 18:00:00 JST 3min 57s -                                      - snap.firmware-updater.firmware-notifier.timer snap.firmware-updater.firmware-notifier.service

システム全体のタイマー

$ systemctl list-timers --all | grep -Ei 'flatpak|update'
Mon 2026-10-19 00:50:03 JST       6h Sun 2026-10-18 01:25:22 JST            - plocate-updatedb.timer         plocate-updatedb.service
Mon 2026-10-19 16:10:41 JST      22h Sun 2026-10-18 16:10:41 JST 1h 46min ago update-notifier-download.timer update-notifier-download.service
Sun 2026-10-25 01:27:18 JST   6 days Thu 2026-10-15 09:41:01 JST            - update-notifier-motd.timer     update-notifier-motd.service

systemd のタイマー一覧には、Flatpak の自動更新を直接実行するタイマーは、なさそうです。

GNOME Software の自動更新設定を確認します。

$ gsettings list-recursively org.gnome.software | grep -Ei 'download-updates|download-updates-notify|install-updates|update'
org.gnome.software allow-updates true
org.gnome.software download-updates true
org.gnome.software download-updates-notify true
org.gnome.software packagekit-historical-updates-timestamp uint64 0
org.gnome.software update-notification-timestamp int64 0

GNOME Software では、更新に関する設定が有効になっています。
この前に、flatpak mask –user org.kde.kstars を行ったので、Flatpak 更新では KStars が通常の更新対象から除外されます。

直前のバージョンに戻す。ダウングレード

今回は、10月 12 16:23:36 deploy update org.kde.kstars
この時点で不具合が生じたので、その直前の状態に戻します。

確認した履歴では、現在のコミットの親が次のコミットです。

現在:e44f942857288863d34a9b37efdea4c35cef7c3d9c25738a28344d27449fbdf4
直前:110b41247bf4b838e944905495f2537ad1b347cc528cdf32316875ee5e0db136
$ flatpak update --user --commit=110b41247bf4b838e944905495f2537ad1b347cc528cdf32316875ee5e0db136 org.kde.kstars
Looking for updates…

Nothing to do.

指定したコミットへの切り替えが実行されなかったようです。先に設定した flatpak maskを一時外します。

$ flatpak mask --user --remove org.kde.kstars
$ flatpak update --user --commit=110b41247bf4b838e944905495f2537ad1b347cc528cdf32316875ee5e0db136 org.kde.kstars
Looking for updates…


        ID                     Branch         Op         Remote         Download
 1.     org.kde.kstars         stable         u          flathub        < 480.1 MB

Proceed with these changes to the user installation? [Y/n]:Y

        ID                     Branch         Op         Remote         Download
 1. [✓] org.kde.kstars         stable         u          flathub        18.9 MB / 480.1 MB

Updates complete.

Commit を確認します。

$ flatpak info --user org.kde.kstars

KStars - Desktop Planetarium

          ID: org.kde.kstars
         Ref: app/org.kde.kstars/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: 3.8.5
     License: GPL-2.0+
      Origin: flathub
  Collection: org.flathub.Stable
Installation: user
   Installed: 957.5 MB
     Runtime: org.kde.Platform/x86_64/6.10
         Sdk: org.kde.Sdk/x86_64/6.10

      Commit: 110b41247bf4b838e944905495f2537ad1b347cc528cdf32316875ee5e0db136
      Parent: 5f8c05ec2b8c95a0a1578239c1ef88e2ca15607033426b0b73ec717ffca1501a
     Subject: Merge pull request #160 from knro/fix-focus-settle-crash (a919fa71c20c)
        Date: 2026-10-03 05:53:00 +0000

更新ブロックを再設定します。

$ flatpak mask --user org.kde.kstars
$ flatpak mask --user
Masked patterns:
  org.kde.kstars

KStarsを起動させます。

$ flatpak run org.kde.kstars

さらに、前のコミットに戻すには

更新ブロックを一時解除します。

$ flatpak mask --user --remove org.kde.kstars

さらに前のコミットにもどします。

$ flatpak update --user --commit=5f8c05ec2b8c95a0a1578239c1ef88e2ca15607033426b0b73ec717ffca1501a org.kde.kstars

コミットを確認します。

$ flatpak info --user org.kde.kstars

更新ブロックを再設定します。

$ flatpak mask --user org.kde.kstars

KStars を起動して動作確認します。

$ flatpak run org.kde.kstars

KStars ログを録る

エラーをログに記録します。

  • Ekos画面 → Setup → Logs… →
    • Logging: Verbosity: Verbose
    • 出力:File
    • Ekos: Alignment
  • Flatpak 版 KStars を端末から起動し、標準出力・標準エラーに出力された情報も記録させます。
  • KStars を終了します。
  • コマンドでKStarsを起動し、ログを指定します。
$ flatpak run org.kde.kstars 2>&1 | tee ~/kstars-debug.log
  • KStars: Ekos → Align
  • Local Astrometry を選択し、プレートソルブを実行します。
  • エラーが発生したら KStars を終了します。

ログを確認します。

grep -inE 'astrometry|solve-field|index|error|failed|solver'
~/kstars-debug.log | tail -n 100

Astrometry.net を使う

後に記述した様に、KStars のユーザー単位に Flatpak 権限を変更させても、動作しませんでした。

flatpak override --user \
  --talk-name=org.freedesktop.Flatpak \

flatpak override :アプリの Flatpak 権限設定を変更する
–user :現在のユーザーにだけ適用する
–talk-name=org.freedesktop.Flatpak :org.freedesktop.Flatpak という D-Bus サービスとの通信を許可する
org.kde.kstars :設定変更の対象を KStars に限定する

ラッパースクリプト経由でFlatpak版KStars/Ekosから、プレートソルブを行わせます。

インストール、設定

sudo apt update
sudo apt install astrometry.net
sudo cp /etc/astrometry.cfg /etc/astrometry.cfg.bak

パスを追加

sudo emacs -nw /etc/astrometry.cfg

USERNAMEは、実際のユーザーアカウント名

### 次の行に追加
### add_path /usr/share/astrometry
add_path /home/USERNAME/.var/app/org.kde.kstars/data/kstars/astrometry

変更箇所を確認します。

$ grep -E '^[[:space:]]*(add_path|autoindex|index)' /etc/astrometry.cfg

flatpak-spawnを使う

Flatpakからホスト側の solve-field を呼び出すラッパースクリプトを用います。

flatpak-spawn は、Flatpakアプリのサンドボックス内から、Ubuntu側のプログラムを実行するためのコマンドです。

Flatpakの設定を確認します。
何も表示されない状態なら、ユーザー単位のオーバーライドは解除されています。

flatpak override --user --show org.kde.kstars

flatpak-spawn が使えるか確認します。

flatpak run --command=sh org.kde.kstars -c 'command -v flatpak-spawn'
/usr/bin/flatpak-spawn

Flatpak版 KStars にホストコマンドの実行権限を与えます。
KStarsに org.freedesktop.Flatpak のD-Busインターフェースへのアクセスを許可します。

flatpak override --user \
  --talk-name=org.freedesktop.Flatpak \
  org.kde.kstars

Ubuntuのソルバーが動作することを確認します。

/usr/bin/solve-field --version

ラッパースクリプトを作成します。

mkdir -p ~/.var/app/org.kde.kstars/data/wrapper
cat > ~/.var/app/org.kde.kstars/data/wrapper/solve-field <<'EOF'
#!/bin/sh
exec flatpak-spawn --host /usr/bin/solve-field "$@"
EOF
cat > ~/.var/app/org.kde.kstars/data/wrapper/solve-field <<'EOF'
#!/bin/sh

LOG="/var/data/wrapper/solve-field.log"

{
    echo
    echo "===== $(date) ====="
    printf 'ARG: <%s>\n' "$@"
} >> "$LOG"

exec /usr/bin/flatpak-spawn --host /usr/bin/solve-field "$@"
EOF

ラッパースクリプトに実行権限を付けます。

chmod +x ~/.var/app/org.kde.kstars/data/wrapper/solve-field

ラッパーの動作を確認します。ホスト側のAstrometry.netを呼び出せるかも確認します。

flatpak run --command=sh org.kde.kstars -c \
'"$HOME/.var/app/org.kde.kstars/data/wrapper/solve-field" --version'

また、
Flatpak環境では、アプリ専用のデータディレクトリは通常 /var/data に対応しています。

flatpak run --command=sh org.kde.kstars -c \
    '/var/data/wrapper/solve-field --version'

FlatpakとUbuntuの一時ファイルの受け渡しを修正

Ekosを設定

Alignモジュールに次があります。

solver binary: /app/bin/solve-field
wcsinfo: /app/bin/wcsinfo
config: /app/etc/astrometry.cfg

もしくは

solver binary: /usr/bin/solve-field
wcsinfo: /usr/bin/wcsinfo
config: /etc/astrometry.cfg

Ekosを設定します。/usr/bin/solve-field を変更します。
指定できる場合は、パスを用います。もしくはUSERNAMEは実際のユーザー名にします。

solver binary: /var/data/wrapper/solve-field

solver binary: /home/USERNAME/.var/app/org.kde.kstars/data/wrapper/solve-field

INDI control panel

/usr/bin/solve-field
↓
/var/data/wrapper/solve-field

サンドボックス(隔離空間)からシステムファイルへのアクセスについて

サンドボックス(隔離空間)からシステムファイルへのアクセスを可能にします。
Flatpak版 KStars にフォルダのアクセス権限を与えます。

flatpak override --user --filesystem=/usr/bin/solve-field org.kde.kstars
flatpak override --user --filesystem=/usr/share/astrometry org.kde.kstars
flatpak override --user --filesystem=/var/lib/astrometry org.kde.kstars

アクセス権限を削除
flatpak override --user --nofilesystem=/usr/bin/solve-field org.kde.kstars
flatpak override --user --nofilesystem=host org.kde.kstars
既存の /etc 全体へのアクセス権限
flatpak override --user --filesystem=/etc:ro org.kde.kstars
既存の /etc 全体へのアクセス権限を削除(リセット)
flatpak override --user --nofilesystem=/etc org.kde.kstars

KStarsのユーザーオーバーライドをリセットする
flatpak override --user --reset org.kde.kstars

シミュレーターで動作確認

先ずシミュレーターで動作確認します。
(IMX533では、Low (最小): 18.305deg、High (最大): 22.882 deg)

Astrometry.net を使ってプレートソルブ

動作テストします。

$ solve-field \
    --config /etc/astrometry.cfg \
    --overwrite \
    test.fits
Found an existing WCS header, will try to verify it.
Extracting sources...
simplexy: found 489 sources.
Solving...
途中省略
  log-odds ratio 367.262 (3.15998e+159), 59 match, 0 conflict, 409 distractors, 64 index.
  RA,Dec = (25.7612,13.6752), pixel scale 0.777888 arcsec/pix.
  Hit/miss:   Hit/miss: --+-+---+--+---+-+---+++--+-++---+----+---+------+-----+----------+-++--+----------+------+-+++-----
Field 1: solved with index index-5206-18.fits.
Field 1 solved: writing to file /home/USERNAME/Astronomy-images/2026_10-17/Light/NGC_660/NGC_660_Light_HEUIB-II_180_secs_2026-10-18T04-14-57_080.solved to indicate this.
Field: /home/USERNAME/Astronomy-images/2026_10-17/Light/NGC_660/NGC_660_Light_HEUIB-II_180_secs_2026-10-18T04-14-57_080.fits
Field center: (RA,Dec) = (25.760992, 13.675102) deg.
Field center: (RA H:M:S, Dec D:M:S) = (01:43:02.638, +13:40:30.368).
Field size: 38.9551 x 38.9448 arcminutes
Field rotation angle: up is 179.813 degrees E of N
Field parity: neg
Creating new FITS file "/home/USERNAME/Astronomy-images/2026_10-17/Light/NGC_660/NGC_660_Light_HEUIB-II_180_secs_2026-10-18T04-14-57_080.new"...
Creating index object overlay plot...
Creating annotation plot...
Your field contains:
  IC 148
  NGC 660

画像から489個の星を検出しています。
index-5206-18.fits を使ってプレートソルブに成功しています。
 16′ – 22′, Tycho2/Gaia Catalogを使っています。
赤経・赤緯と画像の視野を計算できています。

Tycho2/Gaia Catalog を用いて、
simplexy: found 489 sources: 489個の星などの光源を検出
Field 1: solved with index index-5206-18.fits: インデックスを使った位置解析
RA,Dec = (25.7612,13.6752): 天球上の座標を計算
Field size: 38.9551 x 38.9448 arcminutes: 画像の視野を計算
Field parity: neg: 画像の座標変換における反転方向を示す情報
Your field contains: IC 148, NGC 660 と表示、画像内の天体を特定

KStarsから、/usr/bin/solve-field が見られるかを確認

$ flatpak run --command=sh org.kde.kstars -c '
echo "=== solve-field ==="
command -v solve-field
echo "=== executable ==="
ls -l /usr/bin/solve-field
'
=== solve-field ===
=== executable ===
ls: '/usr/bin/solve-field' にアクセスできません: そのようなファイルやディレクトリはありません

/usr/bin/solve-field を KStarsからは見えていない。

さらに確認します。

$ flatpak run --command=sh org.kde.kstars -c '
echo "=== flatpak-spawn ==="
command -v flatpak-spawn
echo "=== host solve-field ==="
flatpak-spawn --host /usr/bin/solve-field --version
'
=== flatpak-spawn ===
/usr/bin/flatpak-spawn
=== host solve-field ===
Portal call failed: org.freedesktop.DBus.Error.ServiceUnknown
Hint: --host only works when the Flatpak is allowed to talk to org.freedesktop.Flatpak

Flatpak 内から設定ファイルとインデックスディレクトリが見えるかを確認します

$ flatpak run --command=sh org.kde.kstars -c '
echo "=== astrometry.cfg ==="
ls -l /etc/astrometry.cfg
echo "=== index directory ==="
ls -ld "$HOME/.var/app/org.kde.kstars/data/kstars/astrometry"
'
=== astrometry.cfg ===
ls: '/etc/astrometry.cfg' にアクセスできません: そのようなファイルやディレクトリはありません
=== index directory ===
drwxr-xr-x 2 USERNAME USERNAME 4096 10月 19 03:41 /home/USERNAME/.var/app/org.kde.kstars/data/kstars/astrometry

KStars に solve-fieldに対して実行権限をつけます

KStarsを終了させ、次を行います。

KStars のユーザー単位に Flatpak 権限を変更します。

この権限を与えると、KStars からホスト側の任意のコマンドを実行できる可能性があります。Flatpak の隔離を弱める変更になります。

コマンド内容は、以下です。

flatpak override :アプリの Flatpak 権限設定を変更する
–user :現在のユーザーにだけ適用する
–talk-name=org.freedesktop.Flatpak :org.freedesktop.Flatpak という D-Bus サービスとの通信を許可する
org.kde.kstars :設定変更の対象を KStars に限定する

flatpak override --user \
  --talk-name=org.freedesktop.Flatpak \
  org.kde.kstars

solve-fieldを呼び出せるか確認します。

flatpak run --command=sh org.kde.kstars -c '
echo "=== host solve-field ==="
flatpak-spawn --host /usr/bin/solve-field --version
'

flatpak run :Flatpak アプリを実行する
–command=sh :KStars 本体ではなく、Flatpak 内のシェル sh を起動する
org.kde.kstars :対象の Flatpak アプリを指定する
-c ‘…’ :引用符内のコマンドをシェルで実行する
echo “=== host solve-field ===” :テスト内容を画面に表示する
flatpak-spawn –host :Flatpak の外側にある Ubuntu ホスト環境でコマンドを実行する
/usr/bin/solve-field :実行するプログラムを指定する
–version :バージョンを表示するだけで終了する

=== host solve-field ===
0.93

Flatpak 版 KStars の内部で flatpak-spawn の使い方を表示させます。

$ flatpak run --command=sh org.kde.kstars -c 'flatpak-spawn --help'
用法:
  flatpak-spawn [オプション…] COMMAND [ARGUMENT…]

Run a command in a sandbox

ヘルプのオプション:
  -h, --help                            ヘルプのオプションを表示する

アプリケーションのオプション:
  -v, --verbose                         Enable debug output
  --forward-fd=FD                       Forward file descriptor
  --clear-env                           Run with clean environment
  --watch-bus                           Make the spawned command exit if we do
  --expose-pids                         Expose sandbox pid in calling sandbox
  --share-pids                          Use same pid namespace as calling sandbox
  --env=VAR=VALUE                       Set environment variable
  --unset-env=VAR=VALUE                 Unset environment variable
  --env-fd=FD                           Read environment variables in env -0 format from FD
  --latest-version                      Run latest version
  --sandbox                             Run sandboxed
  --no-network                          Run without network access
  --sandbox-expose=NAME                 Expose access to named file
  --sandbox-expose-ro=NAME              Expose readonly access to named file
  --sandbox-expose-path=PATH            Expose access to path
  --sandbox-expose-path-ro=PATH         Expose readonly access to path
  --sandbox-expose-path-try=PATH        Expose access to path if it exists
  --sandbox-expose-path-ro-try=PATH     Expose readonly access to path if it exists
  --sandbox-flag=FLAG                   Enable sandbox flag
  --sandbox-a11y-own-name=DBUS_NAME     Allow owning the name on the a11y bus
  --host                                Start the command on the host
  --directory=DIR                       Working directory in which to run the command
  --app-path=DIR|""                     Replace runtime's /app with DIR or empty
  --usr-path=DIR                        Replace runtime's /usr with DIR

solve-field, astrometry.cfg が、KStarsから見られない。。。

Flatpak 版 KStars がホスト側の astrometry.net を直接利用できていないようです。

$ flatpak run --command=sh org.kde.kstars -c '
ls -l /usr/bin/solve-field 2>&1
ls -l /etc/astrometry.cfg 2>&1
'
ls: '/usr/bin/solve-field' にアクセスできません: そのようなファイルやディレクトリはありません
ls: '/etc/astrometry.cfg' にアクセスできません: そのようなファイルやディレクトリはありません

Flatpak 版 KStars のアクセス権を確認します。

$ flatpak info --show-permissions org.kde.kstars
[Context]
shared=network;ipc;
sockets=wayland;pulseaudio;fallback-x11;
devices=all;
features=devel;
filesystems=xdg-documents;xdg-pictures;xdg-videos;xdg-config/kdeglobals:ro;~/.cache/sentry;~/.indi;host;

[Session Bus Policy]
com.canonical.AppMenu.Registrar=talk
org.kde.kconfig.notify=talk
org.kde.KGlobalSettings=talk
org.freedesktop.Flatpak=talk
org.freedesktop.secrets=talk
org.kde.kwalletd6=talk

[Environment]
GSCDAT=/app/share/GSC

filesystems=…;host;
host が指定されているため、Flatpak 版 KStars にはホスト側のファイルシステムへのアクセス許可が設定されていることが確認できます。

/run/host 経由でホスト側のファイルを調べます。
/run/host/usr/bin/ を用います。

/run/host/usr/bin/ は、Flatpak アプリから Ubuntu 本体の /usr/bin/ を参照するためのパスです。

$ flatpak run --command=sh org.kde.kstars -c '
ls -l /run/host/usr/bin/solve-field 2>&1
ls -l /run/host/etc/astrometry.cfg 2>&1
'
-rwxr-xr-x 1 nfsnobody nfsnobody 96584  4月  9  2024 /run/host/usr/bin/solve-field
-rw-r--r-- 1 nfsnobody nfsnobody 2589 10月 19 02:52 /run/host/etc/astrometry.cfg
$ flatpak run --command=sh org.kde.kstars -c \
'/run/host/usr/bin/solve-field --version'
/run/host/usr/bin/solve-field: error while loading shared libraries: libastrometry.so.0: cannot open shared object file: No such file or directory

$ /usr/bin/solve-field --version
0.93

solve-field 自体は見つかったものの、起動に必要な共有ライブラリ libastrometry.so.0 を Flatpak の実行環境から読み込めなかったことを示しています。
実行環境が読み込めないのが、不具合の原因か?

ライブラリ情報は?

$ ldconfig -p | grep libastrometry
	libastrometry.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libastrometry.so.0

Flatpak 内から同じライブラリが見えるか、調べます。

$ flatpak run --command=sh org.kde.kstars -c '
ls -l /run/host/lib/x86_64-linux-gnu/libastrometry.so.0 2>&1
ls -l /run/host/usr/lib/x86_64-linux-gnu/libastrometry.so.0 2>&1
'
-rw-r--r-- 1 nfsnobody nfsnobody 2143432  4月  9  2024 /run/host/lib/x86_64-linux-gnu/libastrometry.so.0
-rw-r--r-- 1 nfsnobody nfsnobody 2143432  4月  9  2024 /run/host/usr/lib/x86_64-linux-gnu/libastrometry.so.0

Flatpak 内からそのライブラリを読み込めるか、確認します。

$ ldd /usr/bin/solve-field | grep -E 'astrometry'
	libastrometry.so.0 => /lib/x86_64-linux-gnu/libastrometry.so.0 (0x0000708a13000000)

Flatpak 内でホスト側の共有ライブラリを読み込めるか、確認します。

$ flatpak run --command=sh org.kde.kstars -c '
LD_LIBRARY_PATH=/run/host/lib/x86_64-linux-gnu:/run/host/usr/lib/x86_64-linux-gnu \
/run/host/usr/bin/solve-field --version
'
/run/host/usr/bin/solve-field: symbol lookup error: /run/host/lib/x86_64-linux-gnu/libc.so.6: undefined symbol: __nptl_change_stack_perm, version GLIBC_PRIVATE

Ubuntu 側の solve-field を Flatpak 内から直接実行する方法は、ライブラリの互換性の問題により、そのままでは使えないようです。

Use Position と Use Scale を、Ekos の Scale & Position から外してプレートソルブを行います。

望遠鏡の座標や推定画角の誤差がソルブを妨げていないか確認します。
KStarsのログ

2026-10-19T15:36:50 Solver aborted.
2026-10-19T15:36:50 Slewing failed.
2026-10-19T15:36:50 Slewing to target coordinates: RA (01h 44m 31s) DEC ( 13° 48' 48").
2026-10-19T15:36:50 Slewing failed.
2026-10-19T15:36:50 Slewing to target coordinates: RA (01h 44m 31s) DEC ( 13° 48' 48").
2026-10-19T15:36:50 Slewing failed.
2026-10-19T15:36:45 Slewing to target coordinates: RA (01h 44m 31s) DEC ( 13° 48' 48").
2026-10-19T15:36:45 Solution coordinates: RA (01h 44m 31s) DEC ( 13° 48' 48") Telescope Coordinates: RA (22h 15m 56s) DEC ( 14° 50' 19") Target Coordinates: RA (23h 56m 00s) DEC ( 180° 00' 00")
2026-10-19T15:36:45 WCS information updated. Images captured from this point forward shall have valid WCS.
2026-10-19T15:36:45 Solver RA (25.76083) DEC (13.67526) Orientation (179.84074) Pixel Scale (0.77730) Parity (neg) PA (-0.15926)
2026-10-19T15:36:45 Solver completed after 1.03 seconds.
2026-10-19T15:36:44 Loaded image was taken on pierside EAST
2026-10-19T15:29:12 World Coordinate System (WCS) is enabled.

Flatpak 内で使えるソルバーを調べます。

$ flatpak run --command=sh org.kde.kstars -c '
echo "=== /app/bin ==="
ls -l /app/bin/solve-field 2>&1

echo "=== Flatpak内のPATH ==="
echo "$PATH"

echo "=== solve-fieldを検索 ==="
find /app -type f -name solve-field 2>/dev/null
'
=== /app/bin ===
ls: '/app/bin/solve-field' にアクセスできません: そのようなファイルやディレクトリはありません
=== Flatpak内のPATH ===
/app/bin:/usr/bin
=== solve-fieldを検索 ===

Flatpak 内の /app/bin/solve-field:存在しない
Flatpak 内の PATH:/app/bin:/usr/bin
/app 内を検索しても solve-field は見つからない
Ubuntu 本体には /usr/bin/solve-field が存在する
ホスト側の solve-field を Flatpak 内から直接実行すると、GLIBC の互換性エラーが発生する

Flatpak 版 KStars の環境には、外部の Astrometry.net 実行ファイルが同梱されていません。

Flatpak 内から wcsinfo を実行します。

$ flatpak run --command=sh org.kde.kstars -c '
/run/host/usr/bin/wcsinfo 2>&1 | head -20
'
/run/host/usr/bin/wcsinfo: error while loading shared libraries: libgsl.so.27: cannot open shared object file: No such file or directory

プレートソルブ / 不具合を追う

KStars バージョン 3.8.5 Stable

プレートソルブ途中で、クラッシュが多発するようになった。

$ ls -lht /var/crash/
合計 40K
-rw-r--r-- 1 root whoopsie   0 10月 18 22:31 _usr_share_apport_apport.0.upload
-rw-r----- 1 root whoopsie 39K 10月 18 22:31 _usr_share_apport_apport.0.crash
$ coredumpctl list
TIME                         PID  UID  GID SIG     COREFILE EXE               SIZE
Sun 2026-10-18 22:30:57 JST 3958 1000 1000 SIGSEGV present  /app/bin/kstars 223.6M
$ coredumpctl info kstars
           PID: 3958 (kstars)
           UID: 1000 (USERNAME)
           GID: 1000 (USERNAME)
        Signal: 11 (SEGV)
     Timestamp: Sun 2026-10-18 22:30:49 JST (9min ago)
  Command Line: kstars
    Executable: /app/bin/kstars
 Control Group: /user.slice/user-1000.slice/user@1000.service/app.slice/app-flatpak-org.kde.kstars-3947.scope
          Unit: user@1000.service
     User Unit: app-flatpak-org.kde.kstars-3947.scope
         Slice: user-1000.slice
     Owner UID: 1000 (USERNAME)
       Boot ID: fc59a2c2dc594283b13a5c649180493c
    Machine ID: 74e8e02918d240c7a288b206ca440774
      Hostname: ah53s
       Storage: /var/lib/systemd/coredump/core.kstars.1000.fc59a2c2dc594283b13a5c649180493c.3958.1792330249000000.zst (present)
  Size on Disk: 223.6M
       Message: Process 3958 (kstars) of user 1000 dumped core.
                
                Stack trace of thread 83:
                #0  0x000073f8c82f2a80 n/a (/app/lib/libstellarsolver6.so.2.8 + 0xcca80)
                #1  0x000073f8c82a4a8e n/a (/app/lib/libstellarsolver6.so.2.8 + 0x7ea8e)
                #2  0x000073f8c829a527 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x74527)
                #3  0x000073f8c829a063 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x74063)
                #4  0x000073f8c829aa87 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x74a87)
                #5  0x000073f8c829adf2 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x74df2)
                #6  0x000073f8c829af19 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x74f19)
                #7  0x000073f8c829c278 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x76278)
                #8  0x000073f8c8297042 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x71042)
                #9  0x000073f8c82986b7 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x726b7)
                #10 0x000073f8c829684a n/a (/app/lib/libstellarsolver6.so.2.8 + 0x7084a)
                #11 0x000073f8c8253be8 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x2dbe8)
                #12 0x000073f8c8258218 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x32218)
                #13 0x000073f8c658c3d4 n/a (/usr/lib/x86_64-linux-gnu/libQt6Core.so.6.10.3 + 0x38c3d4)
                #14 0x000073f8c409b56a n/a (/usr/lib/x86_64-linux-gnu/libc.so.6 + 0x9a56a)
                #15 0x000073f8c411ee94 n/a (/usr/lib/x86_64-linux-gnu/libc.so.6 + 0x11de94)
                ELF object binary architecture: AMD x86-64
$ coredumpctl debug 3958
           PID: 3958 (kstars)
           UID: 1000 (USERNAME)
           GID: 1000 (USERNAME)
        Signal: 11 (SEGV)
     Timestamp: Sun 2026-10-18 22:30:49 JST (9min ago)
  Command Line: kstars
    Executable: /app/bin/kstars
 Control Group: /user.slice/user-1000.slice/user@1000.service/app.slice/app-flatpak-org.kde.kstars-3947.scope
          Unit: user@1000.service
     User Unit: app-flatpak-org.kde.kstars-3947.scope
         Slice: user-1000.slice
     Owner UID: 1000 (USERNAME)
       Boot ID: fc59a2c2dc594283b13a5c649180493c
    Machine ID: 74e8e02918d240c7a288b206ca440774
      Hostname: ah53s
       Storage: /var/lib/systemd/coredump/core.kstars.1000.fc59a2c2dc594283b13a5c649180493c.3958.1792330249000000.zst (present)
  Size on Disk: 223.6M
       Message: Process 3958 (kstars) of user 1000 dumped core.
                
                Stack trace of thread 83:
                #0  0x000073f8c82f2a80 n/a (/app/lib/libstellarsolver6.so.2.8 + 0xcca80)
                #1  0x000073f8c82a4a8e n/a (/app/lib/libstellarsolver6.so.2.8 + 0x7ea8e)
                #2  0x000073f8c829a527 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x74527)
                #3  0x000073f8c829a063 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x74063)
                #4  0x000073f8c829aa87 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x74a87)
                #5  0x000073f8c829adf2 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x74df2)
                #6  0x000073f8c829af19 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x74f19)
                #7  0x000073f8c829c278 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x76278)
                #8  0x000073f8c8297042 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x71042)
                #9  0x000073f8c82986b7 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x726b7)
                #10 0x000073f8c829684a n/a (/app/lib/libstellarsolver6.so.2.8 + 0x7084a)
                #11 0x000073f8c8253be8 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x2dbe8)
                #12 0x000073f8c8258218 n/a (/app/lib/libstellarsolver6.so.2.8 + 0x32218)
                #13 0x000073f8c658c3d4 n/a (/usr/lib/x86_64-linux-gnu/libQt6Core.so.6.10.3 + 0x38c3d4)
                #14 0x000073f8c409b56a n/a (/usr/lib/x86_64-linux-gnu/libc.so.6 + 0x9a56a)
                #15 0x000073f8c411ee94 n/a (/usr/lib/x86_64-linux-gnu/libc.so.6 + 0x11de94)
                ELF object binary architecture: AMD x86-64

GNU gdb (Ubuntu 15.1-1ubuntu1~24.04.1) 15.1
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
/app/bin/kstars: そのようなファイルやディレクトリはありません.

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.ubuntu.com>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
Downloading executable for /app/bin/kstars
Download failed: タイマが破棄されました.  Continuing without executable for /app/bin/kstars.                                      

warning: Can't open file /app/bin/kstars during file-backed mapping note processing

warning: Can't open file /memfd:wayland-shm (deleted) during file-backed mapping note processing
--Type <RET> for more, q to quit, c to continue without paging--q
Quit
(gdb) set pagination off
(gdb) thread apply all bt
(gdb) q

Signal: 11 (SEGV)
KStars のプロセスが SIGSEGV(セグメンテーション違反) というシグナルを受けて終了した。

Stack trace of thread 83:
#0 から #12 まで、すべて libstellarsolver6.so.2.8 内のアドレスを指しています。

ASTAPを使う

KStarsのプレートソルブには次の設定があります。

Source Extraction Method: Internal SEP
Solving Method: Internal Solver

Internal SEP は、画像から星を検出する方法です。
Internal Solver は、検出された星の情報を使ってプレートソルブを行う方法です。

他の方法には、次があります。

StellarSolver
ASTAP
Astrometry.net

ASTAPを使ってみます。
Internal SEP と Internal Solver を用い、クラッシュが多発するようになった場合の回避策として。

KStarsを最新版に更新する

更新マスクを解除とその確認

$ flatpak mask --user --remove org.kde.kstars

$ flatpak mask --user
No masked patterns

KStarsを最新版に更新する

$ flatpak update --user org.kde.kstars
Looking for updates…

        ID                     Branch         Op         Remote         Download
 1.     org.kde.kstars         stable         u          flathub        < 480.1 MB

Proceed with these changes to the user installation? [Y/n]:Y

ID                     Branch         Op         Remote         Download
 1. [✓] org.kde.kstars         stable         u          flathub        180.2 MB / 480.1 MB

Updates complete.

Linux用のASTAP

ASTAP本体と星データベースが配布されています。
https://www.hnsky.org/astap.htm

ASTAP, Astrometric Stacking Program
ASTAP, ASTrometric Stacking Program, astrometric solver, stacking of images, photometry and FITS viewer.

今回はUbuntu 24.04のFlatpak版KStarsを使用しているため、Linux用のASTAPを選びます。

APTで利用できるASTAPの情報を確認

$ apt policy astap
astap:
  インストールされているバージョン: (なし)
  候補:               2024.01.16-1
  バージョンテーブル:
     2024.01.16-1 500
        500 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages

ASTAP をインストールします。

sudo apt update
sudo apt install astap
apt show astap

StellarSolver Options

KStars、StellarSolver Optionsにある、Solving Methodを “Local ASTAP”に指定します。

アライメントログの有効化(原因の特定)

Ekos画面上、左端の「ドライバーとスパナアイコン」、[Setup] タブ
[Setup] タブ → [Logs] で「Alignment Logging」を有効にしてください。

星図データを導入

https://www.hnsky.org/astap.htm
こちらから、D50 (debian)
d50_star_database.deb をダウンロードします。

$ sudo apt install ./d50_star_database.deb

インストールを確認します。

$ ls -lh /opt/astap
合計 911M
-rw------- 1 root root  34K  9月 29  2023 'acknowledgement of databases.txt'
-rw-r--r-- 1 root root 510K  3月 15  2023  d50_0101.1476

ASTAPを指定

KStars 設定、External & Online Programs
ASTAP: ASTAP Binary: 
/usr/bin/astap を指定します。

コメント