admin 发表于 2023-11-19 14:45:53

ubuntu 安装报错 sudo apt install 解决方法

sudo apt install -y安装报错
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
解决方法:
cd /var/lib/dpkg/updates
rm -r ./*







apt install net-tools



1. 先将原有官方sources.list文件进行备份

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2. 将原来的sources.list删除掉,然后再创建新的

sudo rm /etc/apt/sources.list
# 使用vi时会自动创建文件
sudo vi /etc/apt/sources.list


# 也可以先创建后编辑
sudo touch /etc/apt/sources.list

3. 将下列源填写到sources.list文件中(用一个国内源即可)


deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse




4. 最后update一下

sudo apt update




页: [1]
查看完整版本: ubuntu 安装报错 sudo apt install 解决方法