LINUX软件源更新(apt_get不好用的问题)

LINUX软件源更新问题

初学LINUX的小伙伴通常都会遇到一个问题,那就是使用apt-get下载软件时出现could not to get lock或者unable to locate package,这个问题困扰了我很长时间,今天终于把它解决了。(原因是因为软件源没有及时更新或者使用的不是国内的软件源)

首先需要你的linux系统能够连上网,然后要更新你的软件源。

软件源(sources.list)在/etc/apt里可以找到,通常有多种方法。

第一种:直接修改

找到一些国内常用的软件源,比如阿里开源,腾讯开源,直接复制对应的软件源(以ubuntu14.04为例)

deb http://mirrors.cloud.tencent.com/ubuntu trusty main restricted universe multiverse
deb http://mirrors.cloud.tencent.com/ubuntu trusty-updates main restricted universe multiverse
deb http://mirrors.cloud.tencent.com/ubuntu trusty-security main restricted universe multiverse
#deb http://mirrors.cloud.tencent.com/ubuntu trusty-backports main restricted universe multiverse
#deb http://mirrors.cloud.tencent.com/ubuntu trusty-proposed main restricted universe multiverse
deb-src http://mirrors.cloud.tencent.com/ubuntu trusty main restricted universe multiverse
deb-src http://mirrors.cloud.tencent.com/ubuntu trusty-updates main restricted universe multiverse
deb-src http://mirrors.cloud.tencent.com/ubuntu trusty-security main restricted universe multiverse
#deb-src http://mirrors.cloud.tencent.com/ubuntu trusty-backports main restricted universe multiverse
#deb-src http://mirrors.cloud.tencent.com/ubuntu trusty-proposed main restricted universe multiverse

粘贴进原来的sources.list里,然后使用指令

sudo apt-get update

第二种:在终端里输入指令(以腾讯开源ubuntu14.04为例)

wget -O /etc/apt/sources.list  http://mirrors.cloud.tencent.com/repo/ubuntu14_sources.list

执行结束后输入指令

sudo apt-get update

具体网站:腾讯开源ubuntu软件源

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值