2023年3月24日 星期五

[研究]grab-site安裝、試用 (Windows 10上Ubuntu 22.04.2 LTS子系統)

[研究]grab-site安裝、試用 (Windows 10上Ubuntu 22.04.2 LTS子系統)

2023-03-24

[研究] Windows 10 上安裝 Ubuntu 22.04.2 LTS Linux 子系統https://shaurong.blogspot.com/2023/03/windows-10-ubuntu-22042-lts.html

參考

https://github.com/ArchiveTeam/grab-site#install-on-ubuntu-1804-2004-2204-debian-10-buster-debian-11-bullseye

1.On Debian, use su to become root if sudo is not configured to give you access.

sudo apt-get update

sudo apt-get install --no-install-recommends \

    wget ca-certificates git build-essential libssl-dev zlib1g-dev \

    libbz2-dev libreadline-dev libsqlite3-dev libffi-dev libxml2-dev \

    libxslt1-dev libre2-dev pkg-config

If you see Unable to locate package, run the two commands again.

2.As a non-root user:

wget https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer

chmod +x pyenv-installer

./pyenv-installer

~/.pyenv/bin/pyenv install 3.8.15

~/.pyenv/versions/3.8.15/bin/python -m venv ~/gs-venv

~/gs-venv/bin/pip install --no-binary lxml --upgrade git+https://github.com/ArchiveTeam/grab-site

--no-binary lxml is necessary for the html5-parser build.

3.Add this to your ~/.bashrc or ~/.zshrc:

PATH="$PATH:$HOME/gs-venv/bin"

and then restart your shell (e.g. by opening a new terminal tab/window).

安裝


uroot@WIN10:~$ sudo apt-get install --no-install-recommends \
>     wget ca-certificates git build-essential libssl-dev zlib1g-dev \
>     libbz2-dev libreadline-dev libsqlite3-dev libffi-dev libxml2-dev \
>     libxslt1-dev libre2-dev pkg-config
[sudo] password for uroot:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
wget is already the newest version (1.21.2-2ubuntu1).
wget set to manually installed.
ca-certificates is already the newest version (20211016ubuntu0.22.04.1).
ca-certificates set to manually installed.
The following additional packages will be installed:
  bzip2 cpp cpp-11 dpkg-dev g++ g++-11 gcc gcc-11 gcc-11-base icu-devtools libasan6 libatomic1 libc-dev-bin libc6-dev
  libcc1-0 libcrypt-dev libdpkg-perl libgcc-11-dev libgomp1 libicu-dev libisl23 libitm1 liblsan0 libmpc3
  libncurses-dev libnsl-dev libquadmath0 libre2-9 libstdc++-11-dev libtirpc-dev libtsan0 libubsan1 libxslt1.1
  linux-libc-dev lto-disabled-list make rpcsvc-proto
Suggested packages:
  bzip2-doc cpp-doc gcc-11-locales debian-keyring g++-multilib g++-11-multilib gcc-11-doc gcc-multilib manpages-dev
  autoconf automake libtool flex bison gdb gcc-doc gcc-11-multilib git-daemon-run | git-daemon-sysvinit git-doc
  git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn glibc-doc bzr icu-doc ncurses-doc readline-doc
  sqlite3-doc libssl-doc libstdc++-11-doc make-doc
Recommended packages:
  fakeroot libalgorithm-merge-perl bzip2-doc manpages-dev libc-devtools libfile-fcntllock-perl
The following NEW packages will be installed:
  build-essential bzip2 cpp cpp-11 dpkg-dev g++ g++-11 gcc gcc-11 gcc-11-base icu-devtools libasan6 libatomic1
  libbz2-dev libc-dev-bin libc6-dev libcc1-0 libcrypt-dev libdpkg-perl libffi-dev libgcc-11-dev libgomp1 libicu-dev
  libisl23 libitm1 liblsan0 libmpc3 libncurses-dev libnsl-dev libquadmath0 libre2-9 libre2-dev libreadline-dev
  libsqlite3-dev libssl-dev libstdc++-11-dev libtirpc-dev libtsan0 libubsan1 libxml2-dev libxslt1-dev libxslt1.1
  linux-libc-dev lto-disabled-list make pkg-config rpcsvc-proto zlib1g-dev
The following packages will be upgraded:
  git
1 upgraded, 48 newly installed, 0 to remove and 48 not upgraded.
Need to get 79.8 MB of archives.
After this operation, 271 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libc-dev-bin amd64 2.35-0ubuntu3.1 [20.4 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 linux-libc-dev amd64 5.15.0-67.74 [1329 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy/main amd64 libcrypt-dev amd64 1:4.4.27-1 [112 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy/main amd64 rpcsvc-proto amd64 1.4.2-0ubuntu6 [68.5 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libtirpc-dev amd64 1.3.2-2ubuntu0.1 [192 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy/main amd64 libnsl-dev amd64 1.3.0-2build2 [71.3 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libc6-dev amd64 2.35-0ubuntu3.1 [2099 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gcc-11-base amd64 11.3.0-1ubuntu1~22.04 [20.8 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy/main amd64 libisl23 amd64 0.24-2build1 [727 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy/main amd64 libmpc3 amd64 1.2.1-2build1 [46.9 kB]
Get:11 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 cpp-11 amd64 11.3.0-1ubuntu1~22.04 [9967 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy/main amd64 cpp amd64 4:11.2.0-1ubuntu1 [27.7 kB]
Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libcc1-0 amd64 12.1.0-2ubuntu1~22.04 [47.4 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libgomp1 amd64 12.1.0-2ubuntu1~22.04 [126 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libitm1 amd64 12.1.0-2ubuntu1~22.04 [30.2 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libatomic1 amd64 12.1.0-2ubuntu1~22.04 [10.4 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libasan6 amd64 11.3.0-1ubuntu1~22.04 [2284 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 liblsan0 amd64 12.1.0-2ubuntu1~22.04 [1069 kB]
Get:19 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libtsan0 amd64 11.3.0-1ubuntu1~22.04 [2262 kB]
Get:20 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libubsan1 amd64 12.1.0-2ubuntu1~22.04 [976 kB]
Get:21 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libquadmath0 amd64 12.1.0-2ubuntu1~22.04 [154 kB]
Get:22 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libgcc-11-dev amd64 11.3.0-1ubuntu1~22.04 [2517 kB]
Get:23 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gcc-11 amd64 11.3.0-1ubuntu1~22.04 [20.1 MB]
Get:24 http://archive.ubuntu.com/ubuntu jammy/main amd64 gcc amd64 4:11.2.0-1ubuntu1 [5112 B]
Get:25 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libstdc++-11-dev amd64 11.3.0-1ubuntu1~22.04 [2087 kB]
Get:26 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 g++-11 amd64 11.3.0-1ubuntu1~22.04 [11.4 MB]
Get:27 http://archive.ubuntu.com/ubuntu jammy/main amd64 g++ amd64 4:11.2.0-1ubuntu1 [1412 B]
Get:28 http://archive.ubuntu.com/ubuntu jammy/main amd64 make amd64 4.3-4.1build1 [180 kB]
Get:29 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libdpkg-perl all 1.21.1ubuntu2.1 [237 kB]
Get:30 http://archive.ubuntu.com/ubuntu jammy/main amd64 bzip2 amd64 1.0.8-5build1 [34.8 kB]
Get:31 http://archive.ubuntu.com/ubuntu jammy/main amd64 lto-disabled-list all 24 [12.5 kB]
Get:32 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 dpkg-dev all 1.21.1ubuntu2.1 [922 kB]
Get:33 http://archive.ubuntu.com/ubuntu jammy/main amd64 build-essential amd64 12.9ubuntu3 [4744 B]
Get:34 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 git amd64 1:2.34.1-1ubuntu1.8 [3141 kB]
Get:35 http://archive.ubuntu.com/ubuntu jammy/main amd64 icu-devtools amd64 70.1-2 [197 kB]
Get:36 http://archive.ubuntu.com/ubuntu jammy/main amd64 libbz2-dev amd64 1.0.8-5build1 [32.5 kB]
Get:37 http://archive.ubuntu.com/ubuntu jammy/main amd64 libicu-dev amd64 70.1-2 [11.6 MB]
Get:38 http://archive.ubuntu.com/ubuntu jammy/main amd64 libncurses-dev amd64 6.3-2 [380 kB]
Get:39 http://archive.ubuntu.com/ubuntu jammy/main amd64 libre2-9 amd64 20220201+dfsg-1 [160 kB]
Get:40 http://archive.ubuntu.com/ubuntu jammy/main amd64 libre2-dev amd64 20220201+dfsg-1 [261 kB]
Get:41 http://archive.ubuntu.com/ubuntu jammy/main amd64 libreadline-dev amd64 8.1.2-1 [166 kB]
Get:42 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libsqlite3-dev amd64 3.37.2-2ubuntu0.1 [846 kB]
Get:43 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libssl-dev amd64 3.0.2-0ubuntu1.8 [2374 kB]
Get:44 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libxml2-dev amd64 2.9.13+dfsg-1ubuntu0.2 [804 kB]
Get:45 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libxslt1.1 amd64 1.1.34-4ubuntu0.22.04.1 [164 kB]
Get:46 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libxslt1-dev amd64 1.1.34-4ubuntu0.22.04.1 [219 kB]
Get:47 http://archive.ubuntu.com/ubuntu jammy/main amd64 pkg-config amd64 0.29.2-1ubuntu3 [48.2 kB]
Get:48 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 zlib1g-dev amd64 1:1.2.11.dfsg-2ubuntu9.2 [164 kB]
Get:49 http://archive.ubuntu.com/ubuntu jammy/main amd64 libffi-dev amd64 3.4.2-4 [63.7 kB]
Fetched 79.8 MB in 4min 0s (332 kB/s)
Extracting templates from packages: 100%
Selecting previously unselected package libc-dev-bin.
(Reading database ... 24136 files and directories currently installed.)
Preparing to unpack .../00-libc-dev-bin_2.35-0ubuntu3.1_amd64.deb ...
Unpacking libc-dev-bin (2.35-0ubuntu3.1) ...
Selecting previously unselected package linux-libc-dev:amd64.
Preparing to unpack .../01-linux-libc-dev_5.15.0-67.74_amd64.deb ...
Unpacking linux-libc-dev:amd64 (5.15.0-67.74) ...
Selecting previously unselected package libcrypt-dev:amd64.
Preparing to unpack .../02-libcrypt-dev_1%3a4.4.27-1_amd64.deb ...
Unpacking libcrypt-dev:amd64 (1:4.4.27-1) ...
Selecting previously unselected package rpcsvc-proto.
Preparing to unpack .../03-rpcsvc-proto_1.4.2-0ubuntu6_amd64.deb ...
Unpacking rpcsvc-proto (1.4.2-0ubuntu6) ...
Selecting previously unselected package libtirpc-dev:amd64.
Preparing to unpack .../04-libtirpc-dev_1.3.2-2ubuntu0.1_amd64.deb ...
Unpacking libtirpc-dev:amd64 (1.3.2-2ubuntu0.1) ...
Selecting previously unselected package libnsl-dev:amd64.
Preparing to unpack .../05-libnsl-dev_1.3.0-2build2_amd64.deb ...
Unpacking libnsl-dev:amd64 (1.3.0-2build2) ...
Selecting previously unselected package libc6-dev:amd64.
Preparing to unpack .../06-libc6-dev_2.35-0ubuntu3.1_amd64.deb ...
Unpacking libc6-dev:amd64 (2.35-0ubuntu3.1) ...
Selecting previously unselected package gcc-11-base:amd64.
Preparing to unpack .../07-gcc-11-base_11.3.0-1ubuntu1~22.04_amd64.deb ...
Unpacking gcc-11-base:amd64 (11.3.0-1ubuntu1~22.04) ...
Selecting previously unselected package libisl23:amd64.
Preparing to unpack .../08-libisl23_0.24-2build1_amd64.deb ...
Unpacking libisl23:amd64 (0.24-2build1) ...
Selecting previously unselected package libmpc3:amd64.
Preparing to unpack .../09-libmpc3_1.2.1-2build1_amd64.deb ...
Unpacking libmpc3:amd64 (1.2.1-2build1) ...
Selecting previously unselected package cpp-11.
Preparing to unpack .../10-cpp-11_11.3.0-1ubuntu1~22.04_amd64.deb ...
Unpacking cpp-11 (11.3.0-1ubuntu1~22.04) ...
Selecting previously unselected package cpp.
Preparing to unpack .../11-cpp_4%3a11.2.0-1ubuntu1_amd64.deb ...
Unpacking cpp (4:11.2.0-1ubuntu1) ...
Selecting previously unselected package libcc1-0:amd64.
Preparing to unpack .../12-libcc1-0_12.1.0-2ubuntu1~22.04_amd64.deb ...
Unpacking libcc1-0:amd64 (12.1.0-2ubuntu1~22.04) ...
Selecting previously unselected package libgomp1:amd64.
Preparing to unpack .../13-libgomp1_12.1.0-2ubuntu1~22.04_amd64.deb ...
Unpacking libgomp1:amd64 (12.1.0-2ubuntu1~22.04) ...
Selecting previously unselected package libitm1:amd64.
Preparing to unpack .../14-libitm1_12.1.0-2ubuntu1~22.04_amd64.deb ...
Unpacking libitm1:amd64 (12.1.0-2ubuntu1~22.04) ...
Selecting previously unselected package libatomic1:amd64.
Preparing to unpack .../15-libatomic1_12.1.0-2ubuntu1~22.04_amd64.deb ...
Unpacking libatomic1:amd64 (12.1.0-2ubuntu1~22.04) ...
Selecting previously unselected package libasan6:amd64.
Preparing to unpack .../16-libasan6_11.3.0-1ubuntu1~22.04_amd64.deb ...
Unpacking libasan6:amd64 (11.3.0-1ubuntu1~22.04) ...
Selecting previously unselected package liblsan0:amd64.
Preparing to unpack .../17-liblsan0_12.1.0-2ubuntu1~22.04_amd64.deb ...
Unpacking liblsan0:amd64 (12.1.0-2ubuntu1~22.04) ...
Selecting previously unselected package libtsan0:amd64.
Preparing to unpack .../18-libtsan0_11.3.0-1ubuntu1~22.04_amd64.deb ...
Unpacking libtsan0:amd64 (11.3.0-1ubuntu1~22.04) ...
Selecting previously unselected package libubsan1:amd64.
Preparing to unpack .../19-libubsan1_12.1.0-2ubuntu1~22.04_amd64.deb ...
Unpacking libubsan1:amd64 (12.1.0-2ubuntu1~22.04) ...
Selecting previously unselected package libquadmath0:amd64.
Preparing to unpack .../20-libquadmath0_12.1.0-2ubuntu1~22.04_amd64.deb ...
Unpacking libquadmath0:amd64 (12.1.0-2ubuntu1~22.04) ...
Selecting previously unselected package libgcc-11-dev:amd64.
Preparing to unpack .../21-libgcc-11-dev_11.3.0-1ubuntu1~22.04_amd64.deb ...
Unpacking libgcc-11-dev:amd64 (11.3.0-1ubuntu1~22.04) ...
Selecting previously unselected package gcc-11.
Preparing to unpack .../22-gcc-11_11.3.0-1ubuntu1~22.04_amd64.deb ...
Unpacking gcc-11 (11.3.0-1ubuntu1~22.04) ...
Selecting previously unselected package gcc.
Preparing to unpack .../23-gcc_4%3a11.2.0-1ubuntu1_amd64.deb ...
Unpacking gcc (4:11.2.0-1ubuntu1) ...
Selecting previously unselected package libstdc++-11-dev:amd64.
Preparing to unpack .../24-libstdc++-11-dev_11.3.0-1ubuntu1~22.04_amd64.deb ...
Unpacking libstdc++-11-dev:amd64 (11.3.0-1ubuntu1~22.04) ...
Selecting previously unselected package g++-11.
Preparing to unpack .../25-g++-11_11.3.0-1ubuntu1~22.04_amd64.deb ...
Unpacking g++-11 (11.3.0-1ubuntu1~22.04) ...
Selecting previously unselected package g++.
Preparing to unpack .../26-g++_4%3a11.2.0-1ubuntu1_amd64.deb ...
Unpacking g++ (4:11.2.0-1ubuntu1) ...
Selecting previously unselected package make.
Preparing to unpack .../27-make_4.3-4.1build1_amd64.deb ...
Unpacking make (4.3-4.1build1) ...
Selecting previously unselected package libdpkg-perl.
Preparing to unpack .../28-libdpkg-perl_1.21.1ubuntu2.1_all.deb ...
Unpacking libdpkg-perl (1.21.1ubuntu2.1) ...
Selecting previously unselected package bzip2.
Preparing to unpack .../29-bzip2_1.0.8-5build1_amd64.deb ...
Unpacking bzip2 (1.0.8-5build1) ...
Selecting previously unselected package lto-disabled-list.
Preparing to unpack .../30-lto-disabled-list_24_all.deb ...
Unpacking lto-disabled-list (24) ...
Selecting previously unselected package dpkg-dev.
Preparing to unpack .../31-dpkg-dev_1.21.1ubuntu2.1_all.deb ...
Unpacking dpkg-dev (1.21.1ubuntu2.1) ...
Selecting previously unselected package build-essential.
Preparing to unpack .../32-build-essential_12.9ubuntu3_amd64.deb ...
Unpacking build-essential (12.9ubuntu3) ...
Preparing to unpack .../33-git_1%3a2.34.1-1ubuntu1.8_amd64.deb ...
Unpacking git (1:2.34.1-1ubuntu1.8) over (1:2.34.1-1ubuntu1.6) ...
Selecting previously unselected package icu-devtools.
Preparing to unpack .../34-icu-devtools_70.1-2_amd64.deb ...
Unpacking icu-devtools (70.1-2) ...
Selecting previously unselected package libbz2-dev:amd64.
Preparing to unpack .../35-libbz2-dev_1.0.8-5build1_amd64.deb ...
Unpacking libbz2-dev:amd64 (1.0.8-5build1) ...
Selecting previously unselected package libicu-dev:amd64.
Preparing to unpack .../36-libicu-dev_70.1-2_amd64.deb ...
Unpacking libicu-dev:amd64 (70.1-2) ...
Selecting previously unselected package libncurses-dev:amd64.
Preparing to unpack .../37-libncurses-dev_6.3-2_amd64.deb ...
Unpacking libncurses-dev:amd64 (6.3-2) ...
Selecting previously unselected package libre2-9:amd64.
Preparing to unpack .../38-libre2-9_20220201+dfsg-1_amd64.deb ...
Unpacking libre2-9:amd64 (20220201+dfsg-1) ...
Selecting previously unselected package libre2-dev:amd64.
Preparing to unpack .../39-libre2-dev_20220201+dfsg-1_amd64.deb ...
Unpacking libre2-dev:amd64 (20220201+dfsg-1) ...
Selecting previously unselected package libreadline-dev:amd64.
Preparing to unpack .../40-libreadline-dev_8.1.2-1_amd64.deb ...
Unpacking libreadline-dev:amd64 (8.1.2-1) ...
Selecting previously unselected package libsqlite3-dev:amd64.
Preparing to unpack .../41-libsqlite3-dev_3.37.2-2ubuntu0.1_amd64.deb ...
Unpacking libsqlite3-dev:amd64 (3.37.2-2ubuntu0.1) ...
Selecting previously unselected package libssl-dev:amd64.
Preparing to unpack .../42-libssl-dev_3.0.2-0ubuntu1.8_amd64.deb ...
Unpacking libssl-dev:amd64 (3.0.2-0ubuntu1.8) ...
Selecting previously unselected package libxml2-dev:amd64.
Preparing to unpack .../43-libxml2-dev_2.9.13+dfsg-1ubuntu0.2_amd64.deb ...
Unpacking libxml2-dev:amd64 (2.9.13+dfsg-1ubuntu0.2) ...
Selecting previously unselected package libxslt1.1:amd64.
Preparing to unpack .../44-libxslt1.1_1.1.34-4ubuntu0.22.04.1_amd64.deb ...
Unpacking libxslt1.1:amd64 (1.1.34-4ubuntu0.22.04.1) ...
Selecting previously unselected package libxslt1-dev:amd64.
Preparing to unpack .../45-libxslt1-dev_1.1.34-4ubuntu0.22.04.1_amd64.deb ...
Unpacking libxslt1-dev:amd64 (1.1.34-4ubuntu0.22.04.1) ...
Selecting previously unselected package pkg-config.
Preparing to unpack .../46-pkg-config_0.29.2-1ubuntu3_amd64.deb ...
Unpacking pkg-config (0.29.2-1ubuntu3) ...
Selecting previously unselected package zlib1g-dev:amd64.
Preparing to unpack .../47-zlib1g-dev_1%3a1.2.11.dfsg-2ubuntu9.2_amd64.deb ...
Unpacking zlib1g-dev:amd64 (1:1.2.11.dfsg-2ubuntu9.2) ...
Selecting previously unselected package libffi-dev:amd64.
Preparing to unpack .../48-libffi-dev_3.4.2-4_amd64.deb ...
Unpacking libffi-dev:amd64 (3.4.2-4) ...
Setting up gcc-11-base:amd64 (11.3.0-1ubuntu1~22.04) ...
Setting up libre2-9:amd64 (20220201+dfsg-1) ...
Setting up lto-disabled-list (24) ...
Setting up linux-libc-dev:amd64 (5.15.0-67.74) ...
Setting up libgomp1:amd64 (12.1.0-2ubuntu1~22.04) ...
Setting up bzip2 (1.0.8-5build1) ...
Setting up libffi-dev:amd64 (3.4.2-4) ...
Setting up libasan6:amd64 (11.3.0-1ubuntu1~22.04) ...
Setting up libtirpc-dev:amd64 (1.3.2-2ubuntu0.1) ...
Setting up rpcsvc-proto (1.4.2-0ubuntu6) ...
Setting up make (4.3-4.1build1) ...
Setting up libquadmath0:amd64 (12.1.0-2ubuntu1~22.04) ...
Setting up libssl-dev:amd64 (3.0.2-0ubuntu1.8) ...
Setting up libmpc3:amd64 (1.2.1-2build1) ...
Setting up libatomic1:amd64 (12.1.0-2ubuntu1~22.04) ...
Setting up icu-devtools (70.1-2) ...
Setting up git (1:2.34.1-1ubuntu1.8) ...
Setting up libdpkg-perl (1.21.1ubuntu2.1) ...
Setting up libubsan1:amd64 (12.1.0-2ubuntu1~22.04) ...
Setting up libnsl-dev:amd64 (1.3.0-2build2) ...
Setting up libcrypt-dev:amd64 (1:4.4.27-1) ...
Setting up libxslt1.1:amd64 (1.1.34-4ubuntu0.22.04.1) ...
Setting up libisl23:amd64 (0.24-2build1) ...
Setting up libc-dev-bin (2.35-0ubuntu3.1) ...
Setting up libre2-dev:amd64 (20220201+dfsg-1) ...
Setting up libcc1-0:amd64 (12.1.0-2ubuntu1~22.04) ...
Setting up liblsan0:amd64 (12.1.0-2ubuntu1~22.04) ...
Setting up libitm1:amd64 (12.1.0-2ubuntu1~22.04) ...
Setting up libtsan0:amd64 (11.3.0-1ubuntu1~22.04) ...
Setting up cpp-11 (11.3.0-1ubuntu1~22.04) ...
Setting up dpkg-dev (1.21.1ubuntu2.1) ...
Setting up pkg-config (0.29.2-1ubuntu3) ...
Setting up libgcc-11-dev:amd64 (11.3.0-1ubuntu1~22.04) ...
Setting up gcc-11 (11.3.0-1ubuntu1~22.04) ...
Setting up cpp (4:11.2.0-1ubuntu1) ...
Setting up libc6-dev:amd64 (2.35-0ubuntu3.1) ...
Setting up libicu-dev:amd64 (70.1-2) ...
Setting up libbz2-dev:amd64 (1.0.8-5build1) ...
Setting up libncurses-dev:amd64 (6.3-2) ...
Setting up libreadline-dev:amd64 (8.1.2-1) ...
Setting up gcc (4:11.2.0-1ubuntu1) ...
Setting up libxml2-dev:amd64 (2.9.13+dfsg-1ubuntu0.2) ...
Setting up libsqlite3-dev:amd64 (3.37.2-2ubuntu0.1) ...
Setting up libstdc++-11-dev:amd64 (11.3.0-1ubuntu1~22.04) ...
Setting up zlib1g-dev:amd64 (1:1.2.11.dfsg-2ubuntu9.2) ...
Setting up libxslt1-dev:amd64 (1.1.34-4ubuntu0.22.04.1) ...
Setting up g++-11 (11.3.0-1ubuntu1~22.04) ...
Setting up g++ (4:11.2.0-1ubuntu1) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up build-essential (12.9ubuntu3) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for install-info (6.8-4build1) ...
uroot@WIN10:~$

繼續安裝,其中 Install Python-3.8.15 過程非常久

2.As a non-root user:

wget https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer

chmod +x pyenv-installer

./pyenv-installer

~/.pyenv/bin/pyenv install 3.8.15

~/.pyenv/versions/3.8.15/bin/python -m venv ~/gs-venv

~/gs-venv/bin/pip install --no-binary lxml --upgrade git+https://github.com/ArchiveTeam/grab-site

--no-binary lxml is necessary for the html5-parser build.



uroot@WIN10:~$ wget https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer
--2023-03-24 16:13:26--  https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.108.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2762 (2.7K) [text/plain]
Saving to: ‘pyenv-installer’

pyenv-installer               100%[=================================================>]   2.70K  --.-KB/s    in 0s

2023-03-24 16:13:27 (15.3 MB/s) - ‘pyenv-installer’ saved [2762/2762]

uroot@WIN10:~$ chmod +x pyenv-installer
uroot@WIN10:~$ ./pyenv-installer
Cloning into '/home/uroot/.pyenv'...
remote: Enumerating objects: 1113, done.
remote: Counting objects: 100% (1113/1113), done.
remote: Compressing objects: 100% (671/671), done.
remote: Total 1113 (delta 631), reused 596 (delta 312), pack-reused 0
Receiving objects: 100% (1113/1113), 560.86 KiB | 367.00 KiB/s, done.
Resolving deltas: 100% (631/631), done.
Updating files: 100% (1069/1069), done.
Cloning into '/home/uroot/.pyenv/plugins/pyenv-doctor'...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 11 (delta 1), reused 5 (delta 0), pack-reused 0
Receiving objects: 100% (11/11), 38.72 KiB | 156.00 KiB/s, done.
Resolving deltas: 100% (1/1), done.
Cloning into '/home/uroot/.pyenv/plugins/pyenv-installer'...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 16 (delta 2), reused 7 (delta 0), pack-reused 0
Receiving objects: 100% (16/16), 6.16 KiB | 2.05 MiB/s, done.
Resolving deltas: 100% (2/2), done.
Cloning into '/home/uroot/.pyenv/plugins/pyenv-update'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (6/6), done.
Receiving objects: 100% (10/10), done.
remote: Total 10 (delta 1), reused 6 (delta 0), pack-reused 0
Resolving deltas: 100% (1/1), done.
Cloning into '/home/uroot/.pyenv/plugins/pyenv-virtualenv'...
remote: Enumerating objects: 63, done.
remote: Counting objects: 100% (63/63), done.
remote: Compressing objects: 100% (56/56), done.
remote: Total 63 (delta 11), reused 24 (delta 0), pack-reused 0
Receiving objects: 100% (63/63), 40.07 KiB | 119.00 KiB/s, done.
Resolving deltas: 100% (11/11), done.

WARNING: seems you still have not added 'pyenv' to the load path.

# Load pyenv automatically by appending
# the following to
~/.bash_profile if it exists, otherwise ~/.profile (for login shells)
and ~/.bashrc (for interactive shells) :

export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

# Restart your shell for the changes to take effect.

# Load pyenv-virtualenv automatically by adding
# the following to ~/.bashrc:

eval "$(pyenv virtualenv-init -)"

uroot@WIN10:~$ ~/.pyenv/bin/pyenv install 3.8.15
Downloading Python-3.8.15.tar.xz...
-> https://www.python.org/ftp/python/3.8.15/Python-3.8.15.tar.xz
Installing Python-3.8.15...


Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/uroot/.pyenv/versions/3.8.15/lib/python3.8/lzma.py", line 27, in <module>
    from _lzma import *
ModuleNotFoundError: No module named '_lzma'
WARNING: The Python lzma extension was not compiled. Missing the lzma lib?
Installed Python-3.8.15 to /home/uroot/.pyenv/versions/3.8.15
uroot@WIN10:~$ ~/.pyenv/versions/3.8.15/bin/python -m venv ~/gs-venv
uroot@WIN10:~$ ~/gs-venv/bin/pip install --no-binary lxml --upgrade git+https://github.com/ArchiveTeam/grab-site
Collecting git+https://github.com/ArchiveTeam/grab-site
  Cloning https://github.com/ArchiveTeam/grab-site to /tmp/pip-req-build-_66752om
  Running command git clone --filter=blob:none --quiet https://github.com/ArchiveTeam/grab-site /tmp/pip-req-build-_66752om
  Resolved https://github.com/ArchiveTeam/grab-site to commit 80919db0acd6a68d351561711ac8e7429fd5facb
  Preparing metadata (setup.py) ... done
Collecting wpull@ https://github.com/ArchiveTeam/ludios_wpull/tarball/master#egg=wpull-3.0.9
  Downloading https://github.com/ArchiveTeam/ludios_wpull/tarball/master
     \ 659.0 kB 40.5 kB/s 0:00:16
  Preparing metadata (setup.py) ... done
Collecting click>=6.3
  Downloading click-8.1.3-py3-none-any.whl (96 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 KB 598.2 kB/s eta 0:00:00
Collecting manhole>=1.0.0
  Downloading manhole-1.8.0-py2.py3-none-any.whl (16 kB)
Collecting lmdb>=0.89
  Downloading lmdb-1.4.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (306 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 306.1/306.1 KB 204.5 kB/s eta 0:00:00
Collecting autobahn>=0.12.1
  Downloading autobahn-23.1.2.tar.gz (480 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 480.7/480.7 KB 234.8 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting fb-re2>=1.0.6
  Downloading fb-re2-1.0.7.tar.gz (9.4 kB)
  Preparing metadata (setup.py) ... done
Collecting websockets>=6.0
  Downloading websockets-10.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (106 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 107.0/107.0 KB 192.4 kB/s eta 0:00:00
Collecting cchardet>=1.0.0
  Downloading cchardet-2.1.7-cp38-cp38-manylinux2010_x86_64.whl (265 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 266.0/266.0 KB 242.7 kB/s eta 0:00:00
Collecting txaio>=21.2.1
  Downloading txaio-23.1.1-py2.py3-none-any.whl (30 kB)
Collecting cryptography>=3.4.6
  Downloading cryptography-40.0.0-cp36-abi3-manylinux_2_28_x86_64.whl (3.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.7/3.7 MB 151.0 kB/s eta 0:00:00
Collecting hyperlink>=21.0.0
  Downloading hyperlink-21.0.0-py2.py3-none-any.whl (74 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 74.6/74.6 KB 130.8 kB/s eta 0:00:00
Requirement already satisfied: setuptools in ./gs-venv/lib/python3.8/site-packages (from autobahn>=0.12.1->grab-site==2.2.7) (56.0.0)
Collecting chardet
  Downloading chardet-5.1.0-py3-none-any.whl (199 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 199.1/199.1 KB 110.9 kB/s eta 0:00:00
Collecting dnspython
  Downloading dnspython-2.3.0-py3-none-any.whl (283 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 283.7/283.7 KB 122.2 kB/s eta 0:00:00
Collecting html5-parser
  Downloading html5-parser-0.4.10.tar.gz (272 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 272.8/272.8 KB 148.7 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting lxml
  Downloading lxml-4.9.2.tar.gz (3.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.7/3.7 MB 111.2 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting namedlist
  Downloading namedlist-1.8-py2.py3-none-any.whl (15 kB)
Collecting sqlalchemy==1.3.24
  Downloading SQLAlchemy-1.3.24-cp38-cp38-manylinux2010_x86_64.whl (1.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 128.1 kB/s eta 0:00:00
Collecting tornado==4.5.3
  Downloading tornado-4.5.3.tar.gz (484 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 484.2/484.2 KB 59.0 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting yapsy
  Downloading Yapsy-1.12.2.tar.gz (83 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 84.0/84.0 KB 62.2 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting cffi>=1.12
  Downloading cffi-1.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (442 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 442.7/442.7 KB 118.7 kB/s eta 0:00:00
Collecting idna>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 KB 182.1 kB/s eta 0:00:00
Collecting pycparser
  Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 KB 125.4 kB/s eta 0:00:00
Using legacy 'setup.py install' for grab-site, since package 'wheel' is not installed.
Using legacy 'setup.py install' for autobahn, since package 'wheel' is not installed.
Using legacy 'setup.py install' for fb-re2, since package 'wheel' is not installed.
Using legacy 'setup.py install' for wpull, since package 'wheel' is not installed.
Using legacy 'setup.py install' for tornado, since package 'wheel' is not installed.
Using legacy 'setup.py install' for html5-parser, since package 'wheel' is not installed.
Skipping wheel build for lxml, due to binaries being disabled for it.
Using legacy 'setup.py install' for yapsy, since package 'wheel' is not installed.
Installing collected packages: yapsy, tornado, namedlist, lmdb, fb-re2, cchardet, websockets, txaio, sqlalchemy, pycparser, manhole, lxml, idna, dnspython, click, chardet, hyperlink, html5-parser, cffi, wpull, cryptography, autobahn, grab-site
  Running setup.py install for yapsy ... done
  Running setup.py install for tornado ... done
  Running setup.py install for fb-re2 ... done
  Running setup.py install for lxml ... done
  Running setup.py install for html5-parser ... done
  Running setup.py install for wpull ... done
  Running setup.py install for autobahn ... done
  Running setup.py install for grab-site ... done
Successfully installed autobahn-23.1.2 cchardet-2.1.7 cffi-1.15.1 chardet-5.1.0 click-8.1.3 cryptography-40.0.0 dnspython-2.3.0 fb-re2-1.0.7 grab-site-2.2.7 html5-parser-0.4.10 hyperlink-21.0.0 idna-3.4 lmdb-1.4.0 lxml-4.9.2 manhole-1.8.0 namedlist-1.8 pycparser-2.21 sqlalchemy-1.3.24 tornado-4.5.3 txaio-23.1.1 websockets-10.4 wpull-3.0.9 yapsy-1.12.2
WARNING: You are using pip version 22.0.4; however, version 23.0.1 is available.
You should consider upgrading via the '/home/uroot/gs-venv/bin/python -m pip install --upgrade pip' command.
uroot@WIN10:~$
uroot@WIN10:~$

ㄕ

(下圖)設定


測試

 
uroot@WIN10:~$ PATH="$PATH:$HOME/gs-venv/bin"  
uroot@WIN10:~$ grab-site https://www.xxx.idv.tw/

下載過程,中文字顯示編碼過,但似乎可以下載。
用 Everything 快速找檔工具在 Windows 10上跑,找不到下載的檔案,表示子系統使用的 FileSystem不是 Windows 10可以直接看到。
下載過程後來就 Error了。

錯誤訊息

Disconnected from ws:// server: ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 29000)")

grab-site本身問題?Linux 子系統相容性問題?不穩?不確定。

(完)

相關

[研究]grab-site安裝、試用 (Windows 10上Ubuntu 22.04.2 LTS子系統)
https://shaurong.blogspot.com/2023/03/grab-site-windows-10ubuntu-22042-lts.html

[研究]wget2 v1.99.1安裝、試用 (Windows 10上Ubuntu 22.04.2 LTS子系統)
https://shaurong.blogspot.com/2023/03/wget2-v1991-windows-10ubuntu-22042-lts.html

[研究]wget 1.21.2 與 wget2 v1.99.1網站下載軟體安裝、試用 (Ubuntu 22.04.2 LTS)
https://shaurong.blogspot.com/2023/03/wget2-v1991-ubuntu-22042-lts.html

[研究]wget2 v2.0.1網站下載軟體安裝、試用 (Rocky Linux 9.1)
https://shaurong.blogspot.com/2023/03/wget2-v201-rocky-linux-91.html

[研究]wget 1.21.1 網站下載軟體安裝、測試 (Rocky Linux 9.1)
https://shaurong.blogspot.com/2023/03/wget-1211-rocky-linux-91.html

[研究]Wget for Windows 1.21.3試用
https://shaurong.blogspot.com/2023/03/wget-for-windows-1213.html


沒有留言:

張貼留言