您的位置:首页 > 其它

Ubuntu 安装源配置:Unable to locate package & unmet dependencies

2016-09-04 00:26 661 查看

【解决场景】:

1.无法找到软件包

apt-get install : E: Unable to locate package xxx

软件中心安装时显示:There isn't a software package called "Smile" in your current software resources

2.可以找到软件包,但无法自动安装依赖

The following packages have unmet dependencies:
package1 : Depends: package2 (>= 1.8) but 1.7.5-1ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.


【解决方案】

以上问题都由源没有添加 安装源导致的。

源所在位置:/etc/opt/sources.list

安装源模板:

deb MIRROR_URL/ubuntu/ UBUNTURELEASENAME main restricted universe multiverse
deb MIRROR_URL/ubuntu/ UBUNTURELEASENAME-security main restricted universe multiverse
deb MIRROR_URL/ubuntu/ UBUNTURELEASENAME-updates main restricted universe multiverse
deb MIRROR_URL/ubuntu/ UBUNTURELEASENAME-proposed main restricted universe multiverse
deb MIRROR_URL/ubuntu/ UBUNTURELEASENAME-backports main restricted universe multiverse
deb-src MIRROR_URL/ubuntu/ UBUNTURELEASENAME main restricted universe multiverse
deb-src MIRROR_URL/ubuntu/ UBUNTURELEASENAME-security main restricted universe multiverse
deb-src MIRROR_URL/ubuntu/ UBUNTURELEASENAME-updates main restricted universe multiverse
deb-src MIRROR_URL/ubuntu/ UBUNTURELEASENAME-proposed main restricted universe multiverse
deb-src MIRROR_URL/ubuntu/ UBUNTURELEASENAME-backports main restricted universe multiverse


国内镜像地址:替换模板中的 MIRROR_URL

http://mirrors.sohu.com http://mirrors.163.com http://mirrors.aliyun.com http://ubuntu.uestc.edu.cn



ubuntu版本名:替换UBUNTURELEASENAME, eg : xenial

lsb_release -a
root@ubuntu:/etc/apt# lsb_release -a
No LSB modules are available.
Distributor ID:Ubuntu
Description:Ubuntu 16.04 LTS
Release:16.04
Codename:<strong>xenial   #版本名</strong>


安装源示例:

使用时只需要替换 trusty为相应的ubuntu版本名,保存为sources.list,并替换/etc/opt/sources.list即可,注意要使用root权限 sudo cp sources.list /etc/opt/sources.list

# /etc/apt/sources.list
# cn
deb http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse

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

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

deb http://ubuntu.uestc.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse

# office
deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
# beta
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
# src
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
# beta
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
# US
deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner
deb http://us.archive.ubuntu.com/ubuntu/ trusty-security main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-security main restricted
deb http://us.archive.ubuntu.com/ubuntu/ trusty-security universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-security universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty-security multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-security multiverse
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ubuntu 安装源
相关文章推荐