【Debain-sources.list】更新Debain系统镜像源

在Debain系统中遇到使用apt-get install命令时因国外镜像源导致的软件安装失败问题。为解决此问题,可以采取更新为国内镜像源的方法。首先备份原有的sources.list文件,然后添加163镜像源,最后执行apt更新和安装操作。在安装vim时可能会遇到依赖库版本过低的问题,通过更新libtinfo5并安装即可解决。
摘要由CSDN通过智能技术生成

一、问题

在Debain系统中,使用apt-get install 命令的时候,会提示:E: Unable to locate package xxx 而不能正确安装软件。
问题出在,系统自带的镜像源是国外镜像源,apt进行更新的时候访问不到就会报错。
解决:使用国内镜像源。

二、更新镜像源

1、备份原镜像源文件

mv /etc/apt/sources.list /etc/apt/sources.list.bak

2、添加国内镜像源

echo "deb http://mirrors.163.com/debian stretch main" >> /etc/apt/sources.list
echo "deb http://security.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list
echo "deb http://mirrors.163.com/debian stretch-updates main" >> /etc/apt/sources.list

3、apt更新以及安装

3.1 apt 更新

apt-get update -y

3.2 apt 安装

apt-get install lsof 
apt-get install -y vim

安装vim可能出现如下问题:

# 依赖库版本过低导致
Depends: libtinfo5 (>= 6) but it is not going to be installed

解决:

apt update && apt install -y libtinfo5 --allow-remove-essential
apt-get -y install vim
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值