最近两天我的新装的Ubuntu系统总是遇到奇怪的事情
在安装软件包的过程中突然出现:
我便强制关机,结果系统就崩溃了。这已经是第3次了
重装系统前先看些资料做些准备:
1.参考How to resolve “Authentication error” on login screen after locking your Ubuntu?
On the login screen, Press Ctrl + Alt + F3 to open a terminal, or use SSH to access from another computer. To unlock all sessions, type sudo loginctl unlock-sessions. Then press Ctrl + Alt + F2, for example, to go back to your (now unlocked) session.
This does not solve the underlying problem, but lets you quickly get
back to your session to save your work and try configuration changes,
without having to reboot.
2.查找下清华大学软件源为Ubuntu 20.04提供的:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
我怀疑之前3次的崩溃和软件源有关,之前是既用了清华源也用了阿里源。
好了,开始准备重装系统。
装上系统后再次启动,还出现了卡顿,强制关机后再启动,还好没有出问题。
换清华源后,编写如下脚本文件安装软件包:
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install vim
整个过程顺利,没有出现异常