Skip to content

Upgradation


comments: true

18.04 -> 20.04

Info

Date: 2021-09-12

升级前

今天上午来到办公室,发现电脑死机了,屏保时间停留在 7:45,但现在已经 9:29 了,这应该是来哈佛十来天的第一次死机。

不抱希望地直接强制重启,但是重启后明显感觉 Lenovo 的加载速度变得很慢,一直停留在 LENOVO 的 logo 界面,底下一行字提示,按 Enter 键打断正常重启,正常情况下这个界面只会停顿一两秒,但这次似乎得有 1 分钟了。本以为又需要强制重启,但是过了一会,底下那行字消失了,只剩下 LENOVO 图标,这说明它还在加载,只是比较慢,这时候觉得可能是刚刚强制重启完,加载会稍微慢一点,并没有太在意,现在复盘发现,这个如果得以重视,可能不需要后面的操作了。

等了好一会,终于还是进入了 grub 选项界面。然后自动选择 4.15.0-147 的版本,但是登录时直接卡在了第二行

Loading Linux 4.15.0-147-generic ...
Loading initial ramdisk ...

等了好久都没有进展,此处稍微 google 了一下,可能的原因不一而足,比如有人提到最近的更新,这也让我想到最近也有更新,也有人说修改 grub 进一步看看详细信息。

不过这些得需要先能登录进去,强制重启后,选择 Recovery mode 进入,不过似乎只能进入命令行界面。

Selection_2331

首先查看了最近的更新记录,但并没有内核相关的,而且确实是进入了之前相同的内核版本,这个可以排除。

然后通过检查了 df,发现硬盘都挺正常的,但是此处有疑点并未引起充分重视——没有显示移动硬盘以及各种 loop。

试图看了眼系统日志,一切也都挺正常的,而且是停留在死机前最后一刻,recovery mode 启动日志并没有记录进去

Selection_2330

最后 exit 会回到正常重启过程中,然后继续卡住,

升级中

没有头绪,便想着直接升级试试。其实现在想想,过于草率了,还没有去尝试 debug 就放弃了,比如修改 grub 重新登录看看有没有更明确的信息。具体升级步骤为

  1. 修改 /etc/update-manager/release-upgrades
  2. sudo do-release-upgrade

但是升级所需硬盘空间不够,于是卸载 MATLAB,因为现在确实本地没跑过它了,没有找到卸载程序,apt purge 也不管用,于是直接

/usr/local/MATLAB$ sudo rm -rf R2019a

后来再继续运行 do-release-upgrade,差不多 90min 才完成,这中间 90min 上网看了看有没有合适的笔记本,但其实还不是很想换。快结束的时候,需要确认是否保留原始配置文件

Tip

如果 “do-release-upgrade” 中断,怎么删除淘汰的包,直接 autoremove 似乎并不能删除干净,详见 🔗

升级后

安装完成后选择重启,然后又到了缓慢的 LENOVO LOGO,所以才渐渐意识到可能问题根源仍在。等了好久进入登录选项时,注意现在内核已经升级至 5.4.0-84,原先的第一项顺移到了第二项,所以一不留神便以 4.15.0-153 启动了,然后便黑屏无响应了。

强制重启后,突发奇想准备试下好久没选择的第二系统——Win10,虽然也是黑屏,但是只是屏幕下方在转,说明还在动,这时才更加意识到应该跟系统无关。然后看到分析说是硬盘或内存等接触不良,如果是机器里面,那暂时也没办法了,手头上并没有工具,但会不会是移动硬盘呢。于是我直接拔掉这两块移动硬盘,没想到很快就进入了 Windows 系统。会不会只是巧合?

于是重启,发现 LENOVO 的加载界面不停滞了,然后选择 Ubuntu,便很快地进入了升级后的图象化界面!

所以极有可能只是外接硬盘接触不了,因为再次插上后,硬盘数据仍在。

在 20.04 下,显卡也工作正常,这本来是之前怀疑的对象。

一项需要紧急更新的便是修改 grub,取消选择特定内核版本,

  1. GRUB_DEFAULT 修改回 0
  2. sudo update-grub

然后发现 shutter 在 20.04 中没有了,其实在 G40 中已经发现了,参考 How to Install Shutter Screenshot Tool in Ubuntu 20.04

sudo add-apt-repository -y ppa:linuxuprising/shutter
sudo apt install shutter

comments: true

16.04 -> 18.04

Info

Date: 2020-04-12

I want to install BaiduYunpan for Linux, but actually I have tried it before, which cannot work for my current version. However, I note that the version has been updated, although it is still for Ubuntu 18.04, not Ubuntu 16.04.

Same results with the previous try, cannot start it after installing it, and no error thrown in the install procedure. But today I went further, I found that after I type

/opt/baidunetdisk/baidunetdisk 

it throws an error,

This program requires version 3.3.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1.

Try to install latest version from protocolbuffers/protobuf, first time the latest one, 3.14, but it doesn’t work and it require .so.9, while v3.14 has a .so.22, I also tried copy .so.22 to .so.9, or make a soft link, doesn’t work. The second time I install v3.3, the .so.[NUM] still does not match, and hence doesn’t work.

The error is

libmirprotobuf.so.3: undefined symbol: _ZNK6google8protobuf11MessageLite25InitializationErrorStringB5cxx11Ev

and then I follow the instructions in Ubuntu: mir package

sudo apt-get purge libprotobuf-lite9v5
sudo apt-get install libprotobuf-lite9v5

the first step throws the dependencies warnings, related to libqt5, then I uninstall libqt5. Unfortunately, many running programs then exit when the uninstalling procedure keeps going, and I found that I make a big mistake!!

Now, maybe the best way is to update my system from Ubuntu 16.04 to Ubuntu 18.04 to recover the broken system. Actually I have updated my old PC from 16.04 to 18.04, seems quite fluent.

However, for this PC, there are many disappointing problem.

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

it is necessary to modify /etc/update-manager/release-upgrades from never to lts, otherwise it cannot detect new release version. Then run

sudo do-release-upgrade

refer to 将 Ubuntu 16.04 LTS 升级到 Ubuntu 18.04 LTS

Due to previous HK Ubuntu mirror, the speed is quite slow, then the first thing I need to do is to replace the mirror in /etc/apt/sources.list with aliyun by sed operation via

sudo sed -i "s#http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/#http://mirrors.aliyun.com/ubuntu/#" sources.list

后来更新至,

sudo sed -i "s#ftp.cuhk.edu.hk/pub/Linux#archive.ubuntu.com#g" sources.list

Then go on. However, I mistook enter something in the middle, and stop the installation procedure, that is might be part of the reason why I met so many problems.

Try to run do-release-upgrade again, but it said no new release version, and told me to upgrade the software in the current version. Actually it is Ubuntu 18.04 now, checking by

lsb_release -a

then I run

sudo apt-get update
sudo apt-get upgrade

after the first run, I think I am OK. But in the rebooting, I cannot enter into the system, the Ubuntu logo is twinkling, and sometimes I can switch to the command window, it holds with message

a start job is running for hold until boot process finishes up(X s/unlimit)

but do not want to try the re-install solution in 问题1:a start job is running for hold until boot process finishes up(X s/unlimit), because I guess my situation would be quite different, since I uninstall libqt5, and interrupt the normal release updating procedure,

Then I found some other possible solutions,

sudo apt-get update
sudo apt-get install --reinstall ubuntu-desktop
sudo apt-get install unity

But the first thing I need to do is to stop it by power, and then choose to start an advanced session in the grub session, and I chose a recovery mode, then I entered into a command line. And I can continue to fix the problem.

But before I can install the desktop, repeat to run update and upgrade, then updating texlive from 2015 to 2017 throws an error,

dpkg: error processing archive /var/cache/apt/archives/texlive-fonts-extra-doc_2017.20180305-2_all.deb (–unpack): trying to overwrite ‘/usr/share/doc/texlive-doc/latex/mweights/README’, which is also in package texlive-latex-extra-doc 2015.20160320-1 dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)

try install -f, but does not work, the solution is

sudo dpkg -i --force-all /var/cache/apt/archives/texlive-fonts-extra-doc_2017.20180305-2_all.deb

refer to 在apt更新texlive到2017的问题

then I reboot to test, but the internet broken, ifconfig only returns lo, but ifconfig -a shows all possible cards, I have tried service restart like in UBUNTU ifconfig只有lo, but it does not work, then I found the solution worked for me

sudo dhclient enp**

in Ubuntu输入ifconfig找不到IP地址,只有lo问题.

Reboot after the desktop is successfully installed, I can enter into the graphical system!!