IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    把 Ubuntu Server 滚动更新 到 16.04

    R0uter发表于 2016-05-21 06:27:46
    love 0

    去落格博客阅读完整排版的把 Ubuntu Server 滚动更新 到 16.04

    我们用vps,一般来讲还是 Ubuntu 的好用,一方面是对新手来说更加友好,另一方面是一些常用的服务配置都可以一键安装。再加上牛逼的 ufw,真是完美。

    不过,现在并不是所有的vps服务商都能够提供最新的 Ubuntu Server 16.04,真是遗憾。它有太多好处了,比如原生库就是php7,不再需要额外编译……

    那么既然是linux,就一定可以直接把它升级到新版本——我记得Ubuntu也支持这个滚动更新。

    这次手头拿到了一个最高只有 Ubuntu 14.04 的桌面版镜像的vps,我们就尝试把它给撸到 16.04 lts。

    总之,让我们开始吧。

    更新系统

    总之,在滚动之前,我们还是有必要将系统升级到最新版本的,这样能够最大程度上避免出现更新错误:

    apt-get update && sudo apt-get dist-upgrade

    配置升级

    之后重启vps再继续:

    apt-get install update-manager-core

    安装升级管理器,如果你已经安装了,就跳过,但记得检查下面的配置

    /etc/update-manager/release-upgrades

    确保

    Prompt=lts

    # Default behavior for the release upgrader.
    
    [DEFAULT]
    # Default prompting behavior, valid options:
    #
    #  never  - Never check for a new release.
    #  normal - Check to see if a new release is available.  If more than one new
    #           release is found, the release upgrader will attempt to upgrade to
    #           the release that immediately succeeds the currently-running
    #           release.
    #  lts    - Check to see if a new LTS release is available.  The upgrader
    #           will attempt to upgrade to the first LTS release available after
    #           the currently-running one.  Note that this option should not be
    #           used if the currently-running release is not itself an LTS
    #           release, since in that case the upgrader won't be able to
    #           determine if a newer release is available.
    Prompt=lts

    开始升级

    使用如下命令开始升级,在开始之前,升级管理器会检测到你是通过ssh登录的服务器,它会提示你这样升级是非常不安全的——不过没关系,毕竟我们失败了还可以重装是吧……总之,它还是给出了急救方案的,升级过程中会在一个新的端口启动ssh服务,一旦升级失败了,你应该还可以通过那个指定的端口登录vps。

    这时候记得根据提示终止升级过程去ufw或者IPtables 添加指定端口的放行。

    do-release-upgrade -d

    再次执行上边的命令来启动升级,不会再有警告,而是直接开始。

    更新源之后就是按 Y 确认。

    到了安装后期,会有一些服务需要重启,这里需要你选择确认,选

    Yse
     即可。

    确认某些服务会在升级过程中重启
    确认某些服务会在升级过程中重启

    最终,安装完毕后,系统会提示你删除过时的包,确认即可,留着也没用。

    最后重启系统,如无意外,你的 vps 就已经是 Ubuntu Server 16.04 lts 了。

    延伸阅读

    Ubuntu Server 14.04升级Ubuntu Server 16.04

    把 Ubuntu Server 滚动更新 到 16.04,首发于落格博客。

    其他推荐:
    1. 阿里云 Ubuntu 更新镜像源
    2. 在 Ubuntu 中搭建 Minecraft 服务器并挂载 Mod
    3. 搭建 OpenConnect VPN 服务器 AnyConnect (ocserv)
    4. Ubuntu 下更简单的防火墙 Uncomplicated Firewall
    5. Windows Server 2008 R2中的Sysprep.exe



沪ICP备19023445号-2号
友情链接