如何让squashfs 和XZ 工作?

如何让squashfs 和XZ 工作?

我正在努力快速掌握 Linux Mint,但我遇到了太多问题。

我做的第一件事是安装软件包 ( apt install snap),然后意识到它被阻止了。所以我按照说明进行操作Snapcraft 网站,并删除/etc/apt/preferences.d/nosnap.pref。然后我重新安装了它(apt purge snap; apt install snap),重新启动并运行snap install hello-world。它下载了核心快照,当它尝试安装它时,它给了我以下错误消息:

error: cannot perform the following tasks:
- Mount snap "core" (10126) (cannot run unsquashfs: 
-----
Filesystem uses xz compression, this is unsupported by this version
Decompressors available:
    gzip
-----)

所以我去了squashfs LZMA 网站,下载 tarball 并解压。
当我运行时make,我收到以下错误:

cc -O2  -I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"gzip\" -Wall -DGZIP_SUPPORT -DXZ_SUPPORT -DXATTR_SUPPORT -DXATTR_DEFAULT   -c -o mksquashfs.o mksquashfs.c
mksquashfs.c: In function 'create_inode':
mksquashfs.c:987:24: error: called object 'major' is not a function or function pointer
  987 |   unsigned int major = major(buf->st_rdev);
      |                        ^~~~~
mksquashfs.c:987:16: note: declared here
  987 |   unsigned int major = major(buf->st_rdev);
      |                ^~~~~
mksquashfs.c:988:24: error: called object 'minor' is not a function or function pointer
  988 |   unsigned int minor = minor(buf->st_rdev);
      |                        ^~~~~
mksquashfs.c:988:16: note: declared here
  988 |   unsigned int minor = minor(buf->st_rdev);
      |                ^~~~~
mksquashfs.c:1011:24: error: called object 'major' is not a function or function pointer
 1011 |   unsigned int major = major(buf->st_rdev);
      |                        ^~~~~
mksquashfs.c:1011:16: note: declared here
 1011 |   unsigned int major = major(buf->st_rdev);
      |                ^~~~~
mksquashfs.c:1012:24: error: called object 'minor' is not a function or function pointer
 1012 |   unsigned int minor = minor(buf->st_rdev);
      |                        ^~~~~
mksquashfs.c:1012:16: note: declared here
 1012 |   unsigned int minor = minor(buf->st_rdev);
      |                ^~~~~
mksquashfs.c: In function 'dir_scan2':
mksquashfs.c:3527:17: warning: implicit declaration of function 'makedev' [-Wimplicit-function-declaration]
 3527 |   buf.st_rdev = makedev(pseudo_ent->dev->major,
      |                 ^~~~~~~
make: *** [<builtin>: mksquashfs.o] Error 1

我对 C 不太了解,但如果我能找到 .deb 包或其他东西,那就太好了。我尝试重新安装squashfs-tools,然后快照,然后重新启动,但这没有任何作用。

有人可以给我一些关于这个的指示吗?

PS 如果有更好的网站,请告诉我。

答案1

sudo apt install liblzma-dev zlib1g-dev
git clone https://github.com/plougher/squashfs-tools.git
cd squashfs-tools
git checkout c570c6188811088b12ffdd9665487a2960c997a0
cd squashfs-tools
sed -i 's/#XZ_SUPPORT/XZ_SUPPORT/' Makefile
make -j$(nproc)
make install

相关内容