ubuntu17.1升级到18.04

ubuntu 17.10 版本支持过期了,不提供相应的软件下载,所以需要升级到高版本的LTS,本文记录了从17.10升级到18.04版本的全过程,仅此记录。

1.查看原始版本

zrzeng@iotedge2:~$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.10
DISTRIB_CODENAME=artful
DISTRIB_DESCRIPTION="Ubuntu 17.10"
NAME="Ubuntu"
VERSION="17.10 (Artful Aardvark)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 17.10"
VERSION_ID="17.10"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=artful
UBUNTU_CODENAME=artful

2.移除低版本的apt源,替换ubuntu18.04的apt  aliyun 的源

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src 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-backports main restricted universe multiverse

3.执行升级

apt update               //更新目标系统的apt源的本地缓存
apt list --upgradable    //查看存在需要升级的软件包
apt -y upgrade           //升级系统已经存在的软件包
apt dist-upgrade -y      //升级系统发行版本

升级过程很漫长,请耐心等待升级成功。再次查看,系统已经升级成功。

zrzeng@iotedge2:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.5 LTS
Release:	18.04
Codename:	bionic
zrzeng@iotedge2:~$ ping baidu.com
PING baidu.com (220.181.38.148) 56(84) bytes of data.
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=1 ttl=54 time=19.1 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=2 ttl=54 time=19.8 ms
^C
--- baidu.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 19.168/19.489/19.811/0.350 ms

小插曲:

由于我之前的系统环境dns一直出现问题,修改/etc/resolv.conf添加nameserver后,当时有用,但是系统重启后,dns又失效,修改/etc/network/interface文件也是重启后失效,后来才知道,17.10使用的netplan作为网络设置,所以需要修改

/etc/netplan/01-network-manager-all.yaml

network:
        version: 2
        ethernets:
                enp3s0:                  # 配置的网卡名
                        dhcp4: no        # 关闭dhcp4
                        dhcp6: no        # 关闭dhcp6
                        addresses: [192.168.200.125/24]  # 设置本机IP地址及掩码
                        gateway4: 192.168.200.10         # 设置网关
                        nameservers:
                                addresses: [114.114.114.114, 8.8.8.8] # 设置DNS
        

修改完成后,使之生效。重启后即可ping 通外网。

$ sudo netplan apply

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值