Ubuntu-14.04LTS升级到Ubuntu-18.04LTS

一、缘由:

最近爆出了Linux内核的高危漏洞,Linux 内核TCP SACK漏洞,需要升级内核或者打补丁做修补。

但是,我司使用的是Ubuntu 14.04 TLS Server,已经过了官方支持周期,无Ubuntu14.04 LTS的内核升级方案和补丁。无奈,只能升级操作系统。

环境:Ubuntu 14.04 LTS Server

二、步骤:

1、升级到Ubuntu14.04 LTS的最新版本

建议先修改APT源到国内源,节省下载时间。

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get autoremove

这些命令可以使你的Ubuntu14.04 LTS升级为最新版本,比如从Ubuntu14.04.1LTS升级到Ubutnu 14.04.6LTS

命令说明:update 更新本地软件包的索引,upgrade 根据update拿到的索引安装最近软件包;dist-upgrade 功能和upgrade一样,但是他会自动处理最新依赖关系。

2、升级到Ubuntu 16.04 LTS

sudo do-release-upgrade -d

如果提示没有可用的升级,则加上-d参数 sudo do-release-upgrade -p

3、升级到Ubuntu 18.04 LTS

sudo do-release-upgrade -d

如果提示没有可用的升级,则加上-d参数 sudo do-release-upgrade -p

4、修改DNS配置

Ubuntu 18.04 改用systemd-resolve来管理DNS,之前resolveconf -u形式的貌似失效了。

sudo vim /etc/systemd/resolved.conf

[Resolve]
DNS= 192.168.1.99 223.5.5.5 114.114.114.114

然后重启DNS服务sudo systemctl restart systemd-resolved.service

5、修改APT源

鉴于ubuntu官方源比较慢,建议修改sources.list 为阿里云源。

cp /etc/apt/sources.list /etc/apt/sources.list.bak

vim /etc/apt/sources.list

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

然后更新下索引 :sudo apt update && sudo apt upgrade

6、 设置开机启动

设置systemd管理的开机启动项目,建议使用systemclt 更清晰明了,不建议使用rc.local(毕竟已是昨日黄花)

7、 观察

先在测试环境升级,待观察2周,环境稳定后,再升级正式环境。

三、漏洞:

  1. 漏洞的发布者发布的信息:
    https://github.com/Netflix/security-bulletins/blob/master/advisories/third-party/2019-001.md
  2. Ubuntu官方的 更新通知:
    https://wiki.ubuntu.com/SecurityTeam/KnowledgeBase/SACKPanic
  3. 阿里云镜像网站:http://mirrors.aliyun.com/

四、注意事项:

1、MySQL

如果是APT在线安装的MySQL,再升级完系统后会起不起来,发现没有mysql这个命令。

是因为,旧版本的MySQL已经不再被Ubuntu18.04支持,已经被抛弃,但是数据还在。

解决办法:

  1. 安装新版本MySQL5.7 apt install mysql-server

  2. 根据需要修改配置文件中 bind-address:127.0.0.1,默认绑定本地。

2、其他不监听端口的软件:

  1. Filebeat
  2. Smokeping
  3. Falcon-agent

转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 lxwno.1@163.com

×

喜欢就点赞,疼爱就打赏