ubuntu system arm architecture offline deployment jq service

       

Table of contents

1. Pull the base image of ubuntu:22.04

2. Install the jq package directly

3. Solve the public key problem when updating the apt source (unsuccessful)

4. Try to deploy the service locally

 5. Quickly find the corresponding directory method according to the name of the dependent package

6. Install the jq package of the arm architecture locally


        Installing the jq package itself in the ubuntu system is a very simple matter, but simplicity + arm64 + intranet + a bunch of repetitions on Baidu = it takes a whole morning. The whole process of installing the jq package is hereby recorded.

1. Pull the base image of ubuntu:22.04

        arm machine: & docker pull ubuntu:22.04

        x86 machine: & docker pull --platform=arm64 ubuntu:22.10

2. Install the jq package directly

        & docker run -it --rm ubuntu:22.04 bash
        & apt install jq

        

        # ok, then try to update first

        & apt update
        & The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C

 

        Note: The official source of the x86 version uses Index of /ubuntu icon-default.png?t=M85Bhttp://archive.ubuntu.com/ubuntu/  , and the official source of the arm version uses Index of /ubuntu-ports icon-default.png?t=M85Bhttp://ports.ubuntu.com/ ubuntu-ports/

         Domestic source usage is

cat > /etc/apt/sources.list << EOF
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
EOF

        x86 can directly update and then install jq. Arm will report the error <public key is not available> regardless of whether it uses official sources or domestic sources. Most Baidu will suggest registering the key

3. Solve the public key problem when updating the apt source (unsuccessful)

        # Follow online solutions

        & apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C
        & apt-get install gnupg
        & 报错:E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation 和 Package 'gnupg' has no installation candidate
     

        # I found out that I modified the address of the apt source warehouse at first because there was no source when installing the jq package; modifying the source warehouse requires public key authentication; public key authentication requires the installation of the gnupg package; installing the gnupg package requires configuring the source warehouse.
        # Conclusion: I want to configure the apt source warehouse. First, I need to have an apt source available, and there is an endless loop. . .

4. Try to deploy the service locally

        # It seems that the way to directly configure the apt source warehouse does not work, try to install it by downloading files locally
        # First go to the open source website to find the jq package Index of /ubuntu-ports/pool/main/j/jq/ | Tsinghua University Open Source Software Mirror Station | Tsinghua Open Source Mirror Index of /ubuntu-ports/pool/main/j/jq/ | Tsinghua University open source software mirror site, dedicated to providing high-quality open source software mirror and Linux mirror source services for domestic and on-campus users, helping Users can obtain open source software more conveniently. This mirror station is operated and maintained by Tsinghua University TUNA Association. https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/pool/main/j/jq/         & docker cp jq_1.6-2.1ubuntu3_arm64.deb 0b3134dbcaa7:/
        & apt install ./jq_1.6-2.1 ubuntu3_arm64.deb

         # Installing jq requires libjq1 dependency. We need to find the corresponding version of all associated packages layer by layer before installing. Then there is a problem at this time, the name and version of the dependent package we need can be obtained through the error report of the install, how to download to the local deb file.
        # You can search directly on the mirror site based on the first letter of the name, but there are some special ones, for example, libjq belongs to jq, you can't find it under libj.


 

 

 5. Quickly find the corresponding directory method according to the name of the dependent package

        # You can query on this website https://ubuntu.pkgs.org/22.04/ubuntu-main-arm64/ icon-default.png?t=M85Bhttps://ubuntu.pkgs.org/22.04/ubuntu-main-arm64/         # Directly query libjq1

        # Click in and there is a download to see the location of the official mirror station, and the directories of other domestic mirror stations are also the same.

  6. Install the jq package of the arm architecture locally

        # Now you can find all the local deb files, copy them to the ubuntu container and install them directly
        & apt install ./libc-bin_2.35-0ubuntu3.1_arm64.deb ./libc6_2.35-0ubuntu3.1_arm64.deb ./libjq1_1 .6-2.1ubuntu3_arm64.deb ./libonig5_6.9.8-1_arm64.deb ./jq_1.6-2.1ubuntu3_arm64.deb

 

 

Guess you like

Origin blog.csdn.net/weixin_39855998/article/details/127789593