LPA3588 Ubuntu20.04使用apt时遇到的坑

LPA3588 Ubuntu20.04使用apt时遇到的坑

今天算是给自己坑麻了

手上刚到了一块LPA3588的板子,预装了Ubuntu20.04

首先按照以往在x86架构上使用ubuntu的经验,无脑先去华为镜像源替换了ubuntu-ports的/etc/apt/sources.list,很顺利(注意不要使用下面的镜像源,后面会说明原因)

华为开源镜像站_软件开发服务_华为云 (huaweicloud.com)

想在上面安装build-essential,结果报错

$ 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.

大致意思就是依赖更高版本的g++和dpkg-dev,并且它不会为我安装

好,那我自己安装,结果意料之中,g++和dpkg-dev又依赖其他软件的更高版本并且也不会为我安装

我按照网上说的先卸载再安装

结果有意思的来了

gcc卸载成功后安装不了了,然后我尝试卸载了dpkg-dev,离谱,卸载的东西都安装不了了

网上看了各种帖子,都解决不了

大无语,就说先装个cmake总可以吧?

$ 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) ...

嗯,很顺利

等等…

怎么安装的都是ubuntu18.04???

我丢!!!赶紧去华为源的网站去看看,结果人家只支持到18.04!!!

二话不说,赶紧换源,去清华镜像站看看

ubuntu-ports | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

谢天谢地,这里有20.04的ubuntu-ports源

直接替换

/etc/apt/sources.list

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
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

# 预发布软件源,不建议启用
# 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 && sudo apt upgrade

行云流水,很顺利很快乐

然后再安装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%3a9.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) ...

成功!!!

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值