win10当前的正式版本的版本号为14393.447,内嵌的Ubuntu为 14.04 LTS,在把他升级到最新版本的时候报错,现将相关的解决办法记录下来。
1、使用apt update出现 W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/binary-amd64/Packages: Hash Sum mismatch 这样的错误。这个可能是是DNS的问题,于是将DNS设置为阿里公用的DNS。
vi /etc/resolv.conf
# DO@H_502_6@ NOT@H_502_6@ EDIT THIS FILE BY@H_502_6@ HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 223.5@H_502_6@.5@H_502_6@.5@H_502_6@ nameserver 223.6@H_502_6@.6@H_502_6@.6@H_502_6@ nameserver fec0:0@H_502_6@:0@H_502_6@:ffff::1@H_502_6@@H_502_6@
刷新本机DNS缓存:
/etc/init.d/dns-clean start@H_502_6@@H_502_6@
接着执行 apt update
root@SOFT:/mnt/c/Users/soft/Downloads# apt update@H_502_6@
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security InRelease
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/main amd64 Packages
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/restricted amd64 Packages
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/universe amd64 Packages
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/multiverse amd64 Packages
Ign http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty InRelease
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/main Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates InRelease
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/multiverse Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty Release.gpg@H_502_6@
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/restricted Translation-en
Get:@H_502_6@1@H_502_6@ http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/main amd64 Packages [918@H_502_6@ kB]
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/universe Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/restricted amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/universe amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/multiverse amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/main Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/multiverse Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/restricted Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/universe Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty Release
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/main amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/restricted amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/universe amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/multiverse amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/main Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/multiverse Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/restricted Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/universe Translation-en
Ign http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/main Translation-en_US
Ign http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/multiverse Translation-en_US
Ign http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/restricted Translation-en_US
Ign http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/universe Translation-en_US
Fetched 918@H_502_6@ kB in@H_502_6@ 20@H_502_6@s (44.7@H_502_6@ kB/s)
Reading package lists... Done
把所有包升级至 14.04 (trusty) 的最新版
root@SOFT:/mnt/c/Users/soft/Downloads# aptitude update@H_502_6@
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security InRelease
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/main amd64 Packages
Ign http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty InRelease
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/restricted amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates InRelease
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/universe amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty Release.gpg@H_502_6@
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/multiverse amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/main amd64 Packages
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/main Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/restricted amd64 Packages
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/multiverse Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/universe amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/multiverse amd64 Packages
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/restricted Translation-en
Hit http://security.ubuntu@H_502_6@.com@H_502_6@ trusty-security/universe Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/main Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/multiverse Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/restricted Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty-updates/universe Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty Release
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/main amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/restricted amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/universe amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/multiverse amd64 Packages
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/main Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/multiverse Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/restricted Translation-en
Hit http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/universe Translation-en
Ign http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/main Translation-en_US
Ign http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/multiverse Translation-en_US
Ign http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/restricted Translation-en_US
Ign http://archive.ubuntu@H_502_6@.com@H_502_6@ trusty/universe Translation-en_US
root@SOFT:/mnt/c/Users/soft/Downloads# aptitude full-upgrade@H_502_6@
The following packages will be upgraded:
accountsservice apport apt apt-transport-https apt-utils base-files bash-completion bind9-host cloud-init curl
dbus dnsutils dosfstools dpkg gcc-4.8@H_502_6@-base gnupg gpgv initramfs-tools initramfs-tools-bin isc-dhcp-client
isc-dhcp-common klibc-utils libaccountsservice0 libapt-inst1.5@H_502_6@ libapt-pkg4.12@H_502_6@ libbind9-90@H_502_6@ libc-bin libc6 libcurl3
libcurl3-gnutls libdbus-1@H_502_6@-3@H_502_6@ libdns100 libdrm2 libexpat1 libgcrypt11 libidn11 libisc95 libisccc90 libisccfg90
libklibc libldap-2.4@H_502_6@-2@H_502_6@ liblwres90 libpam-systemd libpcre3 libpython3.4@H_502_6@-minimal libpython3.4@H_502_6@-stdlib libssl1.0@H_502_6@.0@H_502_6@
libstdc++6@H_502_6@ libsystemd-daemon0 libsystemd-login0 libtasn1-6@H_502_6@ libudev1 libxml2 lsb-base lsb-release
multiarch-support ntpdate openssh-client openssh-server openssh-sftp-server openssl pollinate python3-apport
python3-problem-report python3-update-manager python3.4@H_502_6@ python3.4@H_502_6@-minimal sudo systemd-services tar tzdata udev
update-manager-core update-notifier-common wget
75@H_502_6@ packages upgraded,0@H_502_6@ newly installed,0@H_502_6@ to remove and@H_502_6@ 0@H_502_6@ not upgraded.
Need to get 24.8@H_502_6@ MB of archives. After unpacking 22.5@H_502_6@ kB will be used.
Do you want to continue? [Y@H_502_6@/n/?] Y@H_502_6@
Get:@H_502_6@ 1@H_502_6@ http://archive.ubuntu@H_502_6@.com@H_502_6@/ubuntu/ trusty-updates/main base-files amd64 7.2@H_502_6@ubuntu5.5@H_502_6@ [67.5@H_502_6@ kB]
Get:@H_502_6@ 2@H_502_6@ http://archive.ubuntu@H_502_6@.com@H_502_6@/ubuntu/ trusty-updates/main dpkg amd64 1.17@H_502_6@.5@H_502_6@ubuntu5.7@H_502_6@ [1@H_502_6@,956@H_502_6@ kB]
Get:@H_502_6@ 3@H_502_6@ http://archive.ubuntu@H_502_6@.com@H_502_6@/ubuntu/ trusty-updates/main tar amd64 1.27@H_502_6@.1@H_502_6@-1@H_502_6@ubuntu0.1@H_502_6@ [196@H_502_6@ kB]
Get:@H_502_6@ 4@H_502_6@ http://archive.ubuntu@H_502_6@.com@H_502_6@/ubuntu/ trusty-updates/main libc-bin amd64 2.19@H_502_6@-0@H_502_6@ubuntu6.9@H_502_6@ [1@H_502_6@,165@H_502_6@ kB]
Get:@H_502_6@ 5@H_502_6@ http://archive.ubuntu@H_502_6@.com@H_502_6@/ubuntu/ trusty-updates/main libc6 amd64 2.19@H_502_6@-0@H_502_6@ubuntu6.9@H_502_6@ [4@H_502_6@,717@H_502_6@ kB]
Get:@H_502_6@ 6@H_502_6@ http://archive.ubuntu@H_502_6@.com@H_502_6@/ubuntu/ trusty-updates/main gcc-4.8@H_502_6@-base amd64 4.8@H_502_6@.4@H_502_6@-2@H_502_6@ubuntu1~14.04@H_502_6@.3@H_502_6@ [16.2@H_502_6@ kB]
Get:@H_502_6@ 7@H_502_6@ http://archive.ubuntu@H_502_6@.com@H_502_6@/ubuntu/ trusty-updates/main libstdc++6@H_502_6@ amd64 4.8@H_502_6@.4@H_502_6@-2@H_502_6@ubuntu1~14.04@H_502_6@.3@H_502_6@ [259@H_502_6@ kB]
Get:@H_502_6@ 8@H_502_6@ http://archive.ubuntu@H_502_6@.com@H_502_6@/ubuntu/ trusty-updates/main libapt-pkg4.12@H_502_6@ amd64 1.0@H_502_6@.1@H_502_6@ubuntu2.15@H_502_6@ [638@H_502_6@ kB]
Get:@H_502_6@ 9@H_502_6@ http://archive.ubuntu@H_502_6@.com@H_502_6@/ubuntu/ trusty-updates/main gpgv amd64 1.4@H_502_6@.16@H_502_6@-1@H_502_6@ubuntu2.4@H_502_6@ [161@H_502_6@ kB]
Get:@H_502_6@ 10@H_502_6@ http://archive.ubuntu@H_502_6@.com@H_502_6@/ubuntu/ trusty-updates/main gnupg amd64 1.4@H_502_6@.16@H_502_6@-1@H_502_6@ubuntu2.4@H_502_6@ [611@H_502_6@ kB]
.................
Processing triggers for ureadahead (0.100@H_502_6@.0@H_502_6@-16@H_502_6@) ...
Current status: 0@H_502_6@ updates [-75@H_502_6@].
更改更新源为 16.04 (xenial)
方法一:修改初始的更新源文件
备份初始的源文件为sources.list.ORIG,将sources.list里的"trusty"全替换为"xenial"。$ sed -i.ORIG 's/trusty/xenial/g' /etc/apt/sources.list
# 方法二(推荐):把更新源直接改为国内的阿里云Ubuntu(xenial)镜像,这样会很快
编辑更新源文件
$ vim /etc/apt/sources.list
备份源文件后粘贴如以下代码,并保存退出。
deb http://mirrors.aliyun@H_502_6@.com@H_502_6@/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun@H_502_6@.com@H_502_6@/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun@H_502_6@.com@H_502_6@/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun@H_502_6@.com@H_502_6@/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun@H_502_6@.com@H_502_6@/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun@H_502_6@.com@H_502_6@/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun@H_502_6@.com@H_502_6@/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun@H_502_6@.com@H_502_6@/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun@H_502_6@.com@H_502_6@/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun@H_502_6@.com@H_502_6@/ubuntu/ xenial-backports main restricted universe multiverse
如果/etc/apt/sources.list.d/这个文件夹不能空,需要备份下,空的话就不需要备份。
mv /etc/apt/sources.list@H_502_6@.d@H_502_6@/ /etc/apt/sources.list@H_502_6@.d@H_502_6@.back@H_502_6@/
mkdir /etc/apt/sources.list@H_502_6@.d@H_502_6@/
升级至 16.04 (xenial)
aptitude update
aptitude safe-upgrade -y
注1:升级过程中会提示你重启服务(restart services),选yes
注2:还会出现文件冲突,保留当前版本(current version)即可,输入N
root@SOFT:/mnt/c/Users/soft/Downloads