初投稿です。Android端末にTermuxを入れて遊んでいるのですが,最近pkg updateやpkg installを実行すると403 Forbiddenとエラーが表示され,パッケージのアップデートやインストールができなくなっていることに気づきました。調べてみたところ解決できたので記事にしてみることにしました。
問題
Termuxでpkg updateを実行すると下記のようにエラーが発生する。
$ pkg update
Checking availability of current mirror: ok
Hit:1 https://grimler.se/termux-packages-24 stable InRelease
Ign:2 https://dl.bintray.com/grimler/game-packages-24 games InRelease
Ign:3 https://dl.bintray.com/grimler/science-packages-24 science InRelease
Err:4 https://dl.bintray.com/grimler/game-packages-24 games Release
403 Forbidden
Err:5 https://dl.bintray.com/grimler/science-packages-24 science Release
403 Forbidden
Reading package lists... Done
E: The repository 'https://dl.bintray.com/grimler/game-packages-24 games Release' does not have a Release file.
N: Metadata integrity can't be verified, repository is disabled now.
N: Possible cause: repository is under maintenance or down (wrong sources.list URL?).
E: The repository 'https://dl.bintray.com/grimler/science-packages-24 science Release' does not have a Release file.
N: Metadata integrity can't be verified, repository is disabled now.
N: Possible cause: repository is under maintenance or down (wrong sources.list URL?).
なお,pkg install ○○などでも同様でした。
原因
色々と調べていると,以下の記事を発見しました。
どうやら,5月1日から今までのリポジトリが使えなくなってしまったのが原因のようです。
解決方法
上記のサイトに書かれているとおりです。
①termux-change-repoを実行する。
②Main repository,Game repository,Science repositoryをすべて選択する。
③Mirrors by Grimlerを選択する。
これでpkgが使えるようになりました。
補足
これについて調べているときに知ったのですが,Google Playで配布されているTermuxは技術的背景の問題で2020年9月29日を最後に更新されていないようです(詳細は以下のサイトに書かれています)。
どうやら,以下のF-Droidというサイトで配布されているのが最新版のようです。
この記事を執筆した時点での最新版は0.112で,2021年4月26日に更新されたものでした。
最新版をインストールしてみたところ,pkgコマンドは最初から問題なく動いたので,上記の問題が発生するのはGoogle Playで配布されている古いバージョンのみのようです。