Mozilla のAPT リポジトリでFirefox を利用

先日開催された「鹿児島Linux勉強会 2024.02(オンライン開催)」でYamano さんの発表で知ったのですが,Mozilla がDebian ベールのディストリビューション向けにAPT リポジトリが提供されているそうです.

これを試してみました.

Mozilla は Firefox 122 から apt リポジトリでの提供を開始したので、これを用いることにします。 (昨年 11 月ごろから Nightly は提供していたらしい)

続きを読む

Ubuntu 19.10 の initramfs-tools から dm-crypt 領域が見つからずエラーとなる

Ubuntu 19.10 amd64 環境でapt upgrade でエラーになります.
新しいKernel が降りてきてinitramfs のところでdm-crypy 領域が見つからない感じのようです.

initramfs-tools (0.133ubuntu9) のトリガを処理しています ...
update-initramfs: Generating /boot/initrd.img-5.2.0-8-generic
cryptsetup: ERROR: Couldn't resolve device
  /dev/disk/by-uuid/805938be-2c29-4a53-9ed2-36fb233d76ea
cryptsetup: ERROR: Couldn't resolve device
  UUID=31145c5b-93fc-4fe0-9e46-3a68bfcadeae
W: initramfs-tools configuration sets RESUME=UUID=31145c5b-93fc-4fe0-9e46-3a68bfcadeae
W: but no matching swap device is available.
処理中にエラーが発生しました:

エラーメッセージで検索すると以下のページを発見.

The problem is that cryptsetup is not supported in the /etc/initramfs-tools/initramfs.conf configuration anymore.

The new location for loading dm-crypt during boot is /etc/cryptsetup-initramfs/conf-hook

CRYPTSETUP=y

you’ll see it in the conf-hook file commented out, just set it as above and it will work again.

If you build a system with encryption, I believe this gets changed at some point, but the live builds are systems that are not built like this, and there isn’t a lot to go on to direct you to make this change.

When you set that and re-make your iso image, you’ll be able to do encrypted persistence again. Worked for me on latest Kali January 2019. :-)

なるほど,この環境はいつも development branch にしているのでこの問題に当たったようですね.

/etc/cryptsetup-initramfs/conf-hookCRYPTSETUP=y と編集して,

$ sudo vi /etc/cryptsetup-initramfs/conf-hook
$ sudo git diff HEAD /etc/cryptsetup-initramfs/conf-hook
diff --git a/cryptsetup-initramfs/conf-hook b/cryptsetup-initramfs/conf-hook
index 8a6a474..fdd7920 100644
--- a/cryptsetup-initramfs/conf-hook
+++ b/cryptsetup-initramfs/conf-hook
@@ -15,7 +15,7 @@
 # cryptsetup initramfs integration.
 #

-#CRYPTSETUP=
+CRYPTSETUP=y

 #
 # KEYFILE_PATTERN: ...

apt でfix-broken を掛けると正常にinitramfs が通り,再起動して新しいkernal で起動しました :)

$ sudo apt install -f
環境
$ dpkg-query -W cryptsetup* initramfs-tools*
cryptsetup      2:2.1.0-5ubuntu2
cryptsetup-bin  2:2.1.0-5ubuntu2
cryptsetup-initramfs    2:2.1.0-5ubuntu2
cryptsetup-run  2:2.1.0-5ubuntu2
initramfs-tools 0.133ubuntu9
initramfs-tools-bin     0.133ubuntu9
initramfs-tools-core    0.133ubuntu9
$ lsb_release -dr
Description:    Ubuntu Eoan Ermine (development branch)
Release:        19.10
$ uname -m
x86_64

Debian 10 Buster testing をリリース後に apt update するとエラーになる

2019-07-06 に Debian Buster 10 がリリースされました.

Debian 10 Buster testing 環境でリリース後に apt update をするとエラーになってしまいます.

$ sudo apt update
Get:1 http://security.debian.org/debian-security buster/updates InRelease [39.1 kB]
Get:2 http://deb.debian.org/debian buster InRelease [118 kB]
N: Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Version' value from '' to '10'
E: Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Suite' value from 'testing' to 'stable'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
Do you want to accept these changes and continue updating from this repository? [y/N]
N: Repository 'http://deb.debian.org/debian buster InRelease' changed its 'Version' value from '' to '10.0'
E: Repository 'http://deb.debian.org/debian buster InRelease' changed its 'Suite' value from 'testing' to 'stable'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
Do you want to accept these changes and continue updating from this repository? [y/N]
Reading package lists... Done
E: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease
E: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease
E: Some index files failed to download. They have been ignored, or old ones used instead.

--allow-releaseinfo-change を指定してAPT にリリースを情報を確認したことを教えます.

$ sudo apt --allow-releaseinfo-change update

次からはオプション無しで実行してもエラーが出なくなります.

$ sudo apt update
Hit:1 http://deb.debian.org/debian buster InRelease
Hit:2 http://security.debian.org/debian-security buster/updates InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.

ちなみに stable でなく testing 環境を使い続けたい場合は /etc/apt/sources.list を現在の Debian testing の bullseye に修正すればいいはず.

環境
$ dpkg-query -W apt
apt     1.8.2
$ hostnamectl | egrep 'Operating System|Architecture'
  Operating System: Debian GNU/Linux 10 (buster)
      Architecture: x86-64

apt/apt-get のエイプリルフール牛さん

昨夜なんとなく apt コマンドのイースターエッグの apt moo を実行してみました.するといつもとは違った牛が!

20190402 00 04 09 23354

Debian sid 環境だったのでもしかしてキャラクター変更されたのだろうかと思ったのですがしばらくしてから再度実行するといつもの牛.

20190402 20 04 14 16775

時計を見ると日付が04/01から04/02に変わったところでした.
04/01に出現したってことはエイプリルフールな牛かな?と faketime command を利用して1日前にして実行すると出てきました.

$ faketime -f '-1d' apt moo
               _     _
              (_\___( \,
                )___   _  Have you smashed some milk today?
               /( (_)-(_)    /
    ,---------'         \_
  //(  ',__,'      \  (' ')
 //  )              '----'
 '' ; \     .--.  ,/
    | )',_,'----( ;
    ||| '''     '||

若しくは04/01を指定

$ faketime '20190401' apt moo
               _     _
              (_\___( \,
                )___   _  Have you smashed some milk today?
               /( (_)-(_)    /
    ,---------'         \_
  //(  ',__,'      \  (' ')
 //  )              '----'
 '' ; \     .--.  ,/
    | )',_,'----( ;
    ||| '''     '||

多分この辺ですね

$ grep -A21 bool\ DoMooApril ./apt-private/private-moo.cc
static bool DoMooApril()                                                /*{{{*/
{
   // by Christopher Allan Webber and proposed by Paul Tagliamonte
   // in a "Community outreach": https://lists.debian.org/debian-devel/2013/04/msg00045.html
   if (_config->FindI("quiet") >= 2)
   {
      std::cerr << "Have you smashed some milk today?" << std::endl;
      return true;
   }
   c1out <<
      "               _     _\n"
      "              (_\\___( \\,\n"
      "                )___   _  Have you smashed some milk today?\n"
      "               /( (_)-(_)    /\n"
      "    ,---------'         \\_\n"
      "  //(  ',__,'      \\  (' ')\n"
      " //  )              '----'\n"
      " '' ; \\     .--.  ,/\n"
      "    | )',_,'----( ;\n"
      "    ||| '''     '||\n";
   return true;
}

1.4 で入ったぽい?

$ zgrep -A2 \(1.4\) /usr/share/doc/apt/changelog.gz
apt (1.4) unstable; urgency=medium

  * The April Fools' Release

ちなみに moo moo でカラフルな牛が出てこないときは,APT::Moo::Color オプションが使えるようです.(エイプリルフール牛は単色のみみたい)

20190402 20 04 40 17194

永続化する場合や色をカスタマイズしたい場合は /usr/share/doc/apt/examples/configure-index.gz を参考に /etc/apt/apt.conf に設定すればok.

$ zgrep moo::color /usr/share/doc/apt/examples/configure-index.gz
apt::moo::color "<BOOL>";
$ echo 'apt::moo::color "true";' | sudo tee -a /etc/apt/apt.conf
apt::moo::color "true";
$ dpkg-query -W apt faketime
apt     1.8.0
faketime        0.9.7-3
$ lsb_release -dr
Description:    Debian GNU/Linux buster/sid
Release:        unstable
$ uname -m
x86_64

Googleの社名変更で apt update エラー

パッケージ情報更新のために apt update 中にエラーが発生しました.Googleのアプリケーション(Google Chrome等)を導入ししたときに入るGoogleのリポジトリで Google, Inc.Google LLC に変わったためのようです.

E: Repository 'http://dl.google.com/linux/chrome/deb stable Release' changed its 'Origin' value from 'Google, Inc.' to 'Google LLC'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
Do you want to accept these changes and continue updating from this repository? [y/N]

Google LCCには去年変わっていてこのリポジトリにもやっと修正が入ったということのようです.(Androidアプリなどはもっと早かったですね)

ここで y で受け入れると次からこのエラーは現れません.

ヒット:4 http://dl.google.com/linux/chrome/deb stable Release
環境1
$ dpkg-query -W apt
apt     1.7.0
$ lsb_release -d
Description:    Debian GNU/Linux unstable (sid)
$ uname -m
x86_64
環境2
$ dpkg-query -W apt
apt     1.7.0
$ lsb_release -d
Description:    Parrot 4.3
$ uname -m
x86_64

Raspberry PiのFreedomBoxで/var/lib/dpkg/statusが壊れたのを復旧

Raspberry PiでFreedomBoxを試しているのですが,ストレージがmicroSDのせいか修正していたパッケージの依存関係か何かがおかしくなったせいか/var/lib/dpkg/statusが壊れてしまいました.

$ sudo apt update
Hit:1 http://cdn-fastly.deb.debian.org/debian testing InRelease
Reading package lists... Error!
E: Unable to parse package file /var/lib/dpkg/status (1)
W: You may want to run apt-get update to correct these problems
E: The package cache file is corrupted
E: パッケージファイル /var/lib/dpkg/status を解釈することができません (1)
W: これらの問題を解決するためには apt-get update を実行する必要があるかもしれません
E: パッケージキャッシュファイルが壊れています

apt-get updateで治るのかなと思って叩いてみましたが駄目でした.

Debian リファレンス第2章 Debian パッケージ管理によると,

2.6.5. パッケージセレクションの復元

もし何らかの理由で “/var/lib/dpkg/status” の内容が腐った場合には、Debian システムはパッケージ選択データーが失われ大きな打撃を被ります。古い “/var/lib/dpkg/status” ファイルは、”/var/lib/dpkg/status-old” や “/var/backups/dpkg.status.*” としてあるので探します。

“/var/backups/” は多くの重要な情報を保持しているので、これを別のパーティション上に置くのも良い考えです。

とのことなので,/var/lib/dpkg/status-oldから復旧をと思いましたがこれも既に壊れているバージョン./var/backups/dpkg.status.0はまだ壊れていなかったのでこれで上書きして復旧したようです.

$ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status