LPA3588 Pitfalls encountered when using apt in Ubuntu20.04

LPA3588 Pitfalls encountered when using apt in Ubuntu20.04

I’ve made a fool of myself today

I just got a LPA3588 board with Ubuntu20.04 pre-installed.

First, based on my previous experience of using ubuntu on the x86 architecture, I went to the Huawei mirror source and replaced the /etc/apt/sources.list of ubuntu-ports without any brain. It went smoothly (be careful not to use the mirror source below, the reason will be explained later)

Huawei Open Source Mirror Station_Software Development Services_Huawei Cloud (huaweicloud.com)

I want to install build-essential on it, but I get an error

$ sudo apt install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
 build-essential : Depends: g++ (>= 4:7.2) but it is not going to be installed
                   Depends: dpkg-dev (>= 1.17.11) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Basically it means relying on a higher version of g++ and dpkg-dev, and it won’t install it for me

Okay, then I installed it myself, and the result was as expected. g++ and dpkg-dev depended on higher versions of other software and would not be installed for me.

I followed the instructions on the Internet to uninstall and then install

Here comes the interesting result

After gcc was successfully uninstalled, it could not be installed. Then I tried to uninstall dpkg-dev. It was outrageous. None of the uninstalled things could be installed.

I read various posts on the Internet but can’t find a solution.

I’m speechless, just install cmake first, right?

$ sudo apt-get install cmake
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  cmake-data libcurl4 libjsoncpp1 librhash0
Suggested packages:
  cmake-doc ninja-build
The following NEW packages will be installed:
  cmake cmake-data libcurl4 libjsoncpp1 librhash0
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,631 kB of archives.
After this operation, 24.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://mirrors.huaweicloud.com/ubuntu-ports bionic-updates/main arm64 cmake-data all 3.10.2-1ubuntu2.18.04.2 [1,332 kB]
Get:2 https://mirrors.huaweicloud.com/ubuntu-ports bionic-security/main arm64 libcurl4 arm64 7.58.0-2ubuntu3.24 [185 kB]
Get:3 https://mirrors.huaweicloud.com/ubuntu-ports bionic/main arm64 libjsoncpp1 arm64 1.7.4-3 [69.2 kB]
Get:4 https://mirrors.huaweicloud.com/ubuntu-ports bionic/main arm64 librhash0 arm64 1.3.6-2 [71.8 kB]
Get:5 https://mirrors.huaweicloud.com/ubuntu-ports bionic-updates/main arm64 cmake arm64 3.10.2-1ubuntu2.18.04.2 [2,973 kB]
Fetched 4,631 kB in 11s (429 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package cmake-data.
(Reading database ... 86759 files and directories currently installed.)
Preparing to unpack .../cmake-data_3.10.2-1ubuntu2.18.04.2_all.deb ...
Unpacking cmake-data (3.10.2-1ubuntu2.18.04.2) ...
Selecting previously unselected package libcurl4:arm64.
Preparing to unpack .../libcurl4_7.58.0-2ubuntu3.24_arm64.deb ...
Unpacking libcurl4:arm64 (7.58.0-2ubuntu3.24) ...
Selecting previously unselected package libjsoncpp1:arm64.
Preparing to unpack .../libjsoncpp1_1.7.4-3_arm64.deb ...
Unpacking libjsoncpp1:arm64 (1.7.4-3) ...
Selecting previously unselected package librhash0:arm64.
Preparing to unpack .../librhash0_1.3.6-2_arm64.deb ...
Unpacking librhash0:arm64 (1.3.6-2) ...
Selecting previously unselected package cmake.
Preparing to unpack .../cmake_3.10.2-1ubuntu2.18.04.2_arm64.deb ...
Unpacking cmake (3.10.2-1ubuntu2.18.04.2) ...
Setting up librhash0:arm64 (1.3.6-2) ...
Setting up libcurl4:arm64 (7.58.0-2ubuntu3.24) ...
Setting up cmake-data (3.10.2-1ubuntu2.18.04.2) ...
Setting up libjsoncpp1:arm64 (1.7.4-3) ...
Setting up cmake (3.10.2-1ubuntu2.18.04.2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...

Well, it went well

etc…

How to install ubuntu18.04?

I lost it! ! ! I quickly went to Huawei Source’s website to check it out, and it turned out that only supports 18.04!!!

Without further ado, quickly change the source and go to Tsinghua Mirror Station to have a look

ubuntu-ports | Mirror site usage help | Tsinghua University open source software mirror site | Tsinghua Open Source Mirror

Thankfully, there are ubuntu-ports sources for 20.04 here

direct replacement

/etc/apt/sources.list

# The source code image is commented by default to improve apt update speed. You can uncomment it yourself if necessary.
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse

deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse

# Pre-release software source, not recommended to be enabled
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse
sudo apt update & amp; & amp; sudo apt upgrade

Everything goes smoothly, smoothly and happily

Then install build-essential

$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  dpkg-dev fakeroot g++g++-9 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libfakeroot libstdc++-9-dev
Suggested packages:
  debian-keyring gcc-9-doc libstdc++-9-doc
The following NEW packages will be installed:
  build-essential dpkg-dev fakeroot g++g++-9 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libfakeroot libstdc++-9-dev
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 9,373 kB of archives.
After this operation, 42.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports focal-updates/main arm64 libstdc + + -9-dev arm64 9.4.0-1ubuntu1~20.04.2 [1,687 kB]
Get:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports focal-updates/main arm64 g + + -9 arm64 9.4.0-1ubuntu1~20.04.2 [6,843 kB]
Get:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports focal/main arm64 g++ arm64 4:9.3.0-1ubuntu2 [1,592 B]
Get:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports focal-updates/main arm64 dpkg-dev all 1.19.7ubuntu3.2 [679 kB]
Get:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports focal-updates/main arm64 build-essential arm64 12.8ubuntu1.1 [4,664 B]
Get:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports focal/main arm64 libfakeroot arm64 1.24-1 [26.0 kB]
Get:7 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports focal/main arm64 fakeroot arm64 1.24-1 [61.9 kB]
Get:8 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports focal/main arm64 libalgorithm-diff-perl all 1.19.03-2 [46.6 kB]
Get:9 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports focal/main arm64 libalgorithm-diff-xs-perl arm64 0.04-6 [11.1 kB]
Get:10 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports focal/main arm64 libalgorithm-merge-perl all 0.08-3 [12.0 kB]
Fetched 9,373 kB in 11s (851 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libstdc + + -9-dev:arm64.
(Reading database ... 89572 files and directories currently installed.)
Preparing to unpack .../0-libstdc + + -9-dev_9.4.0-1ubuntu1~20.04.2_arm64.deb ...
Unpacking libstdc + + -9-dev:arm64 (9.4.0-1ubuntu1~20.04.2) ...
Selecting previously unselected package g++ -9.
Preparing to unpack .../1-g + + -9_9.4.0-1ubuntu1~20.04.2_arm64.deb ...
Unpacking g + + -9 (9.4.0-1ubuntu1~20.04.2) ...
Selecting previously unselected package g++.
Preparing to unpack .../2-g + + _4:9.3.0-1ubuntu2_arm64.deb ...
Unpacking g++ (4:9.3.0-1ubuntu2) ...
Selecting previously unselected package dpkg-dev.
Preparing to unpack .../3-dpkg-dev_1.19.7ubuntu3.2_all.deb ...
Unpacking dpkg-dev (1.19.7ubuntu3.2) ...
Selecting previously unselected package build-essential.
Preparing to unpack .../4-build-essential_12.8ubuntu1.1_arm64.deb ...
Unpacking build-essential (12.8ubuntu1.1) ...
Selecting previously unselected package libfakeroot:arm64.
Preparing to unpack .../5-libfakeroot_1.24-1_arm64.deb ...
Unpacking libfakeroot:arm64 (1.24-1) ...
Selecting previously unselected package fakeroot.
Preparing to unpack .../6-fakeroot_1.24-1_arm64.deb ...
Unpacking fakeroot (1.24-1) ...
Selecting previously unselected package libalgorithm-diff-perl.
Preparing to unpack .../7-libalgorithm-diff-perl_1.19.03-2_all.deb ...
Unpacking libalgorithm-diff-perl (1.19.03-2) ...
Selecting previously unselected package libalgorithm-diff-xs-perl.
Preparing to unpack .../8-libalgorithm-diff-xs-perl_0.04-6_arm64.deb ...
Unpacking libalgorithm-diff-xs-perl (0.04-6) ...
Selecting previously unselected package libalgorithm-merge-perl.
Preparing to unpack .../9-libalgorithm-merge-perl_0.08-3_all.deb ...
Unpacking libalgorithm-merge-perl (0.08-3) ...
Setting up libstdc + + -9-dev:arm64 (9.4.0-1ubuntu1~20.04.2) ...
Setting up libalgorithm-diff-perl (1.19.03-2) ...
Setting up libfakeroot:arm64 (1.24-1) ...
Setting up dpkg-dev (1.19.7ubuntu3.2) ...
Setting up fakeroot (1.24-1) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
Setting up g + + -9 (9.4.0-1ubuntu1~20.04.2) ...
Setting up g + + (4:9.3.0-1ubuntu2) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up build-essential (12.8ubuntu1.1) ...
Setting up libalgorithm-diff-xs-perl (0.04-6) ...
Setting up libalgorithm-merge-perl (0.08-3) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.12) ...

success! ! !