开发者社区> 问答> 正文

ubuntu server 14.04无法安装软件:报错

下载的ubuntu server14.04.2lts版本在虚拟机上安装完成之后无法安装软件, gcc都无法安装.

具体情况如下

@ubuntu :~$ sudo apt-get install gcc

Reading package lists... Done

Building dependency tree       

Reading state information... Done

Package gcc is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source

E: Package 'gcc' has no installation candidate
试过install build-depgcc .  install build essential都无效.

不知道是否和源有关系,同时我安装系统时的选择是否会有影响? 

展开
收起
kun坤 2020-06-20 11:46:54 1553 0
1 条回答
写回答
取消 提交回答
  • 我换了163的源就可以了. 谢谢大家.######

    刷新软件缓存没?sudo apt-get update之后再运行install看看呢?

    apt-get通常不会主动检测软件缓存是否过期,所以Install之前建议先apt-get update。这个和yum不同,yum会自动检测cache过期进行makecache

    ######安装好系统后先执行 sudo apt-get update 更新软件源列表。 ######嗯 执行过这条命令之后再继续更新提示的错误没变######

    引用来自“Feng_Yu”的评论

    刷新软件缓存没?sudo apt-get update之后再运行install看看呢?

    apt-get通常不会主动检测软件缓存是否过期,所以Install之前建议先apt-get update。这个和yum不同,yum会自动检测cache过期进行makecache

    嗯 我执行过 sudo apt-get update了, 我在想是不是需要换一下其它的源呢.######刷新缓存的过程中有无报错?确认一下是不是软件仓库的问题。 grep -v '^\s*#' /etc/apt/sources.list | grep -v '^\s*$'贴出来结果看看######源 换成 163或者aliyun试试######

    引用来自“Feng_Yu”的评论

    刷新软件缓存没?sudo apt-get update之后再运行install看看呢?

    apt-get通常不会主动检测软件缓存是否过期,所以Install之前建议先apt-get update。这个和yum不同,yum会自动检测cache过期进行makecache

    引用来自“hottcp”的评论

    嗯 我执行过 sudo apt-get update了, 我在想是不是需要换一下其它的源呢.
    @ubuntu :~$ grep -v '^\s*#' /etc/apt/sources.list | grep -v '^\s*$'
    deb http://security.ubuntu.com/ubuntu trusty-security main
    deb-src http://security.ubuntu.com/ubuntu trusty-security main
    deb http://security.ubuntu.com/ubuntu trusty-security universe
    deb-src http://security.ubuntu.com/ubuntu trusty-security universe
    deb http://security.ubuntu.com/ubuntu trusty-security multiverse
    deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
    deb http://archive.canonical.com/ubuntu trusty partner
    deb-src http://archive.canonical.com/ubuntu trusty partner
    deb http://extras.ubuntu.com/ubuntu trusty main

    deb-src http://extras.ubuntu.com/ubuntu trusty main

    这个显示有问题吗?

    2020-06-20 11:47:03
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
低代码开发师(初级)实战教程 立即下载