- 安装一些包时总有报错信息
Unable to correct problems, you have held broken packages.
人家说安装aptitude包,用aptitude来安装包就能够自动处理各种依赖项,但是用这个包来安装包时,看似包安装上了,其实根本没有安装上,于是寻求了其他方法。
首先换源,因为Ubuntu是22.04版,所以要搜索该版本的源,把/etc/apt/sources.list里面的内容换成
# 中科大源,挺快的
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
然后执行sudo apt-get update
和sudo apt-get upgrade
更新之后,就可以用apt/apt-get正常安装包了。
- ifconfig命令发现只有lo网卡,没有ens33网卡,无法上网。首先找到一个教程,使用
sudo dhclient ens33
命令就可以正常上网了,但是每次重启后都得配置一下。然后寻找其他办法,发现是需要设置NetworkManager服务开机自启动,即执行命令sudo systemctl enable NetworkManager.service
就够了。参考:https://blog.csdn.net/MEREDITH5948/article/details/130657098