Ubantu configures Alibaba Cloud's apt source

root@zjy:~# cd /etc/apt/
root@zjy:/etc/apt# cp sources.list sources.list.bak
root@zjy:/etc/apt# >sources.list
root@zjy:/etc/apt# vim sources.list
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源  
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# 源码  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# Canonical 合作伙伴和附加  
deb http://archive.canonical.com/ubuntu/ xenial partner
#deb http://extras.ubuntu.com/ubuntu/ xenial main  

upgrade error

root@zjy:/etc/apt# apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  cloud-init lxd lxd-client
The following packages will be upgraded:
  amd64-microcode ca-certificates intel-microcode liblxc-common liblxc1 libseccomp2 linux-base lxcfs snapd sosreport tcpdump tzdata unattended-upgrades wireless-regdb
14 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Need to get 25.0 MB of archives.
After this operation, 46.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.aliyun.com/ubuntu xenial-security/main amd64 libseccomp2 amd64 2.4.3-1ubuntu3.16.04.3 [41.0 kB]
Get:2 http://mirrors.aliyun.com/ubuntu xenial-security/main amd64 tzdata all 2020d-0ubuntu0.16.04 [167 kB]
Get:3 http://mirrors.aliyun.com/ubuntu xenial-security/main amd64 linux-base all 4.5ubuntu1.2~16.04.1 [17.8 kB]
Get:4 http://mirrors.aliyun.com/ubuntu xenial-security/main amd64 ca-certificates all 20201027ubuntu0.16.04.1 [155 kB]
Get:5 http://mirrors.aliyun.com/ubuntu xenial-security/main amd64 tcpdump amd64 4.9.3-0ubuntu0.16.04.1 [363 kB]
Get:6 http://mirrors.aliyun.com/ubuntu xenial-backports/main amd64 liblxc-common amd64 3.0.3-0ubuntu1~16.04.1 [110 kB]
Get:7 http://mirrors.aliyun.com/ubuntu xenial-backports/main amd64 liblxc1 amd64 3.0.3-0ubuntu1~16.04.1 [264 kB]
Get:8 http://mirrors.aliyun.com/ubuntu xenial-backports/main amd64 lxcfs amd64 3.0.3-0ubuntu1~16.04.1 [38.6 kB]
Get:9 http://mirrors.aliyun.com/ubuntu xenial-updates/main amd64 snapd amd64 2.48 [20.8 MB]
Get:10 http://mirrors.aliyun.com/ubuntu xenial-updates/main amd64 sosreport amd64 3.9.1-1ubuntu0.16.04.1 [170 kB]                                                                           
Get:11 http://mirrors.aliyun.com/ubuntu xenial-updates/main amd64 unattended-upgrades all 1.1ubuntu1.18.04.7~16.04.6 [42.1 kB]                                                              
Get:12 http://mirrors.aliyun.com/ubuntu xenial-security/main amd64 wireless-regdb all 2020.11.20-0ubuntu1~16.04.2 [10.6 kB]                                                                 
Get:13 http://mirrors.aliyun.com/ubuntu xenial-security/main amd64 amd64-microcode amd64 3.20191021.1+really3.20180524.1~ubuntu0.16.04.2 [30.8 kB]                                          
Get:14 http://mirrors.aliyun.com/ubuntu xenial-security/main amd64 intel-microcode amd64 3.20201110.0ubuntu0.16.04.2 [2,743 kB]                                                             
Fetched 25.0 MB in 21s (1,211 kB/s)                                                                                                                                                         
Preconfiguring packages ...
(Reading database ... 66574 files and directories currently installed.)
Preparing to unpack .../libseccomp2_2.4.3-1ubuntu3.16.04.3_amd64.deb ...
Unpacking libseccomp2:amd64 (2.4.3-1ubuntu3.16.04.3) over (2.3.1-2.1ubuntu4) ...
Setting up libseccomp2:amd64 (2.4.3-1ubuntu3.16.04.3) ...
(Reading database ... 66574 files and directories currently installed.)
Preparing to unpack .../00-tzdata_2020d-0ubuntu0.16.04_all.deb ...
Unpacking tzdata (2020d-0ubuntu0.16.04) over (2018d-1) ...
Preparing to unpack .../01-linux-base_4.5ubuntu1.2~16.04.1_all.deb ...
Unpacking linux-base (4.5ubuntu1.2~16.04.1) over (4.5ubuntu1) ...
Preparing to unpack .../02-ca-certificates_20201027ubuntu0.16.04.1_all.deb ...
Unpacking ca-certificates (20201027ubuntu0.16.04.1) over (20180409) ...
Preparing to unpack .../03-tcpdump_4.9.3-0ubuntu0.16.04.1_amd64.deb ...
Unpacking tcpdump (4.9.3-0ubuntu0.16.04.1) over (4.9.2-3) ...
Preparing to unpack .../04-liblxc-common_3.0.3-0ubuntu1~16.04.1_amd64.deb ...
Unpacking liblxc-common (3.0.3-0ubuntu1~16.04.1) over (3.0.1-0ubuntu1~18.04.1) ...
Preparing to unpack .../05-liblxc1_3.0.3-0ubuntu1~16.04.1_amd64.deb ...
Unpacking liblxc1 (3.0.3-0ubuntu1~16.04.1) over (3.0.1-0ubuntu1~18.04.1) ...
Preparing to unpack .../06-lxcfs_3.0.3-0ubuntu1~16.04.1_amd64.deb ...
Unpacking lxcfs (3.0.3-0ubuntu1~16.04.1) over (3.0.1-0ubuntu2~18.04.1) ...
Preparing to unpack .../07-snapd_2.48_amd64.deb ...
Unpacking snapd (2.48) over (2.34.2+18.04) ...
Preparing to unpack .../08-sosreport_3.9.1-1ubuntu0.16.04.1_amd64.deb ...
Unpacking sosreport (3.9.1-1ubuntu0.16.04.1) over (3.5-1ubuntu3.18.04.1) ...
Preparing to unpack .../09-unattended-upgrades_1.1ubuntu1.18.04.7~16.04.6_all.deb ...
Unpacking unattended-upgrades (1.1ubuntu1.18.04.7~16.04.6) over (1.1ubuntu1.18.04.5) ...
Preparing to unpack .../10-wireless-regdb_2020.11.20-0ubuntu1~16.04.2_all.deb ...
Unpacking wireless-regdb (2020.11.20-0ubuntu1~16.04.2) over (2018.05.09-0ubuntu1~18.04.1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-JN6Szw/10-wireless-regdb_2020.11.20-0ubuntu1~16.04.2_all.deb (--unpack):
 trying to overwrite '/lib/crda/pubkeys/sforshee.key.pub.pem', which is also in package crda 3.18-1build1
Preparing to unpack .../11-amd64-microcode_3.20191021.1+really3.20180524.1~ubuntu0.16.04.2_amd64.deb ...
Unpacking amd64-microcode (3.20191021.1+really3.20180524.1~ubuntu0.16.04.2) over (3.20180524.1~ubuntu0.18.04.1) ...
Preparing to unpack .../12-intel-microcode_3.20201110.0ubuntu0.16.04.2_amd64.deb ...
Unpacking intel-microcode (3.20201110.0ubuntu0.16.04.2) over (3.20180425.1~ubuntu0.18.04.1) ...
Errors were encountered while processing:
 /tmp/apt-dpkg-install-JN6Szw/10-wireless-regdb_2020.11.20-0ubuntu1~16.04.2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@zjy:/etc/apt# apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  cloud-init lxd lxd-client
The following packages will be upgraded:
  wireless-regdb
1 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
12 not fully installed or removed.
Need to get 0 B/10.6 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 66704 files and directories currently installed.)
Preparing to unpack .../wireless-regdb_2020.11.20-0ubuntu1~16.04.2_all.deb ...
Unpacking wireless-regdb (2020.11.20-0ubuntu1~16.04.2) over (2018.05.09-0ubuntu1~18.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/wireless-regdb_2020.11.20-0ubuntu1~16.04.2_all.deb (--unpack):
 trying to overwrite '/lib/crda/pubkeys/sforshee.key.pub.pem', which is also in package crda 3.18-1build1
Errors were encountered while processing:
 /var/cache/apt/archives/wireless-regdb_2020.11.20-0ubuntu1~16.04.2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Error resolution

root@zjy:/etc/apt# rm -rf /var/lib/dpkg/info/*
apt-get update 更新源  
apt-get upgrade 更新软件 

Guess you like

Origin blog.csdn.net/weixin_40548182/article/details/111315135