标签归档:stretch

VPS上的Debian 8 jessie 升级到Debian 9 stretch 的方法

对于追新的一些人来说,总想使用最新的系统,但目前VPS上基本没有Debian 9 stretch的模板可用,但是有Debian 8 jessie的模板,这时就需要升级到Debian 9。在升级过程中,某些配置文件会被替换掉,比如开启了两步验证,更改了ssh端口等,更改起来还是需要耐心的,一不小心就登录不了了。所以建议能不更新就不要更新。如果要更新,就备份好文件,然后重装Debian 8,再升级到9。我们按照这个最保险的思路来进行吧。

1 重装Debian 8并更新系统

1.1 重装Debian 8

首先在vps上重新安装Debian 8,记下密码,以root身份登录vps后,可以看到系统版本为8.0:

cat /etc/debian_version
8.0
1.2 更新Debian 8

将Debian 8 更新到最新:

apt-get update
apt-get upgrade -y
apt-get dist-upgrade -y

更新过程中,可能会碰到的情况:
更新到ca-certificates时暂停并跳出相关信息,按q即可。

2 更新软件包列表到Debian 9

备份Debian 8的软件包列表:

cp /etc/apt/sources.list /etc/apt/sources.list_Debian8

替换Debian 8 软件包列表到Debian 9:

sed -i 's/jessie/stretch/g' /etc/apt/sources.list

3 系统更新到Debian 9


apt-get update
apt-get upgrade -y
apt-get dist-upgrade -y

更新过程中,可能会碰到的情况:
更新到ca-certificates时暂停并跳出相关信息,按q即可;
更新到apt时暂停并跳出相关信息,按q即可;
跳出Configuring libc6:amd64窗口时,选yes,回车后继续。

4 移除不再需要的软件包

apt autoremove -y

解决debian 9 stretch中VIM不能双击触摸板粘贴的问题

更新

20171215 该问题同鼠标右键单击不能粘贴。

升级到debian 9后,出现了在Chromebook的Secure Shell中双击触摸板不能在VIM中粘贴的问题,Chromebook中Secure Shell中双击触摸板类似于鼠标右键的操作。问题表现为:双击触摸板时,变成了— (insert) VISUAL —模式,粘贴失效。
解决办法:将 set mouse=a 改为set mouse=r。
具体如下:

vi /usr/share/vim/vim80/defaults.vim

将
" In many terminal emulators the mouse works just fine.  By enabling it you
" can position the cursor, Visually select and scroll with the mouse.
if has('mouse')
  set mouse=a
endif

改为:

" In many terminal emulators the mouse works just fine.  By enabling it you
" can position the cursor, Visually select and scroll with the mouse.
if has('mouse')
  set mouse=r
endif