前言
使用默认的软件源,在国内速度会慢些,此时使用镜像源能够加快软件安装速度。系统是Debian 10,更换为清华大学源时,发现执行apt update
命令会报错,由于是新手,能力有限.最终换成了阿里云源。
配置方法
- 默认是以root用户身份执行
- 备份原先软件源
cp /etc/apt/sources.list /etc/apt/sources.list.bak
- 编辑将
/etc/apt/sources.list
文件,将原有源替换为阿里云的:阿里云debian软件源地址:Debian镜像
deb https://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ buster main non-free contrib
deb https://mirrors.aliyun.com/debian-security buster/updates main
deb-src https://mirrors.aliyun.com/debian-security buster/updates main
deb https://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb https://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
- 更新软件索引
apt update
其他问题
在安装软件apt install xxx
时会报下面的错
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
解决方法
#先killall与apt相关进程
killall apt apt-get
# 再配置package
dpkg --configure -a
# 最后更新软件索引
apt update
原因
- 某些apt命令正在终端里运行还没结束
- 某些apt进程正在运行
评论区