修改文件
桌面版Ubuntu默認非root賬戶
可以先在 home/user/下新建一個文件source.list-new
將其寫為
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
然后在命令行切換到root用戶執行
cp /home/user/source.list-new /etc/apt/source.list
更新源
apt-get update
這一步報錯
這是因為系統中有進程在占用apt-get
ps -ef | grep "apt-get"
可以看到
干掉他,然后繼續執行
killall apt-get
apt-get update
apt-get upgrade
等一會即可