ubuntu 安装gcc 或g++ 时提示未发现软件包 gcc或g++

您所在的位置:网站首页 编译安装拉软件包的时候出现0000是什么意思 ubuntu 安装gcc 或g++ 时提示未发现软件包 gcc或g++

ubuntu 安装gcc 或g++ 时提示未发现软件包 gcc或g++

2024-01-07 00:38| 来源: 网络整理| 查看: 265

问题:安装gcc 或g++ 时提示未发现软件包?

1.这时,只需更新apt-get即可,那么apt-get是什么呢? apt-get,是一条linux命令,适用于deb包管理式的操作系统,主要用于自动从互联网的软件仓库中搜索、安装、升级、卸载软件或操作系统。

输入命令:sudo apt-get update

如果更新时出现卡顿或很慢,是由于我们用的是外网,或者我们电脑的网络过慢

对于前者我的建议是换源 2.什么原因造成的呢? 因为我们安装好ubuntu双系统\单系统后,默认的软件更新源是国外的, 我们可以打开源目录看看: 先切换到目录: cd /etc/apt 查看/编辑目录: sudo vi sources.list 我们可以发现:里面的源都是关于cn.archive.ubuntu.com 这个就是国外的软件更新源

3.怎么解决呢? 国外的软件更新源在国内使用速度很慢,需要更换成国内的源,这样才能正常安装和更新软件。

怎么更换呢? 打开终端命令行界面中,先将sources.list文件备份一个,更新源服务器地址就是存在这个文件里面的,所以主要就是对这个文件进行编辑就可以了,也是很简单的。

1.先切换到目录:cd /etc/apt

2.备份源(防止意外或后续需要) 输入:sudo cp sources.list sources.list.old

3.编辑源:sudo vim sources.list

4.将文件中内容全部删除

5.更换源,有一下几种源可以选择,推荐阿里云 (1)、阿里云

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

(2)、清华大学

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

(3)、中科大

deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

6、复制其中一种粘贴完后,要对照一下,有没有粘贴格式的错误或缺了哪些东西,然后保存退出。最后别忘了更新缓存。 输入:sudo apt-get update 更新缓存需要一点时间,更新完就可以了。

执行sudo apt-get update后续出现的问题,如没出现请忽略: 如输入:sudo apt-get update后出现这些信息

W: Unknown Multi-Arch type 'no' for package 'compiz-core' W: Unknown Multi-Arch type 'no' for package 'compiz-gnome' W: Unknown Multi-Arch type 'no' for package 'libxapian-dev' W: Ignoring Provides line with DepCompareOp for package python-cffi-backend-api-max W: Ignoring Provides line with DepCompareOp for package python-cffi-backend-api-min W: Ignoring Provides line with DepCompareOp for package python3-cffi-backend-api-max W: Ignoring Provides line with DepCompareOp for package python3-cffi-backend-api-min W: Unknown Multi-Arch type 'no' for package 'kwin' W: Unknown Multi-Arch type 'no' for package 'kwin-dev' W: Unknown Multi-Arch type 'no' for package 'kwin-wayland' W: Unknown Multi-Arch type 'no' for package 'kwin-x11' W: Unknown Multi-Arch type 'no' for package 'libkf5sysguard-dev' W: Ignoring Provides line with DepCompareOp for package php-psr-http-message-implementation W: Ignoring Provides line with DepCompareOp for package php-psr-log-implementation W: Ignoring Provides line with DepCompareOp for package php-seclib W: Ignoring Provides line with DepCompareOp for package php-sabre-http W: Ignoring Provides line with DepCompareOp for package php-math-biginteger W: Ignoring Provides line with DepCompareOp for package pypy-cffi W: Ignoring Provides line with DepCompareOp for package pypy-cffi-backend-api-max W: Ignoring Provides line with DepCompareOp for package pypy-cffi-backend-api-min W: Unknown Multi-Arch type 'no' for package 'compiz-core' W: Unknown Multi-Arch type 'no' for package 'compiz-gnome' W: Unknown Multi-Arch type 'no' for package 'libxapian-dev' W: Ignoring Provides line with DepCompareOp for package python-cffi-backend-api-max W: Ignoring Provides line with DepCompareOp for package python-cffi-backend-api-min W: Ignoring Provides line with DepCompareOp for package python3-cffi-backend-api-max W: Ignoring Provides line with DepCompareOp for package python3-cffi-backend-api-min W: Unknown Multi-Arch type 'no' for package 'kwin-dev' W: Unknown Multi-Arch type 'no' for package 'kwin-wayland' W: Unknown Multi-Arch type 'no' for package 'kwin-x11' W: Unknown Multi-Arch type 'no' for package 'libkf5sysguard-dev' W: Ignoring Provides line with DepCompareOp for package pypy-cffi W: Ignoring Provides line with DepCompareOp for package pypy-cffi-backend-api-max W: Ignoring Provides line with DepCompareOp for package pypy-cffi-backend-api-min W: Unknown Multi-Arch type 'no' for package 'compiz-core' W: Unknown Multi-Arch type 'no' for package 'compiz-gnome' W: Ignoring Provides line with DepCompareOp for package xserver-xorg W: Ignoring Provides line with DepCompareOp for package php-math-biginteger W: Ignoring Provides line with DepCompareOp for package pypy-cffi W: Ignoring Provides line with DepCompareOp for package pypy-cffi-backend-api-max W: Ignoring Provides line with DepCompareOp for package pypy-cffi-backend-api-min W: Unknown Multi-Arch type 'no' for package 'compiz-core' W: Unknown Multi-Arch type 'no' for package 'compiz-gnome' W: Ignoring Provides line with DepCompareOp for package xserver-xorg W: Ignoring Provides line with DepCompareOp for package pypy-cffi W: Ignoring Provides line with DepCompareOp for package pypy-cffi-backend-api-max W: Ignoring Provides line with DepCompareOp for package pypy-cffi-backend-api-min

W: 您可能需要运行 apt-get update 来解决这些问题 怎么办呢?

执行如下命令:sudo apt-get install -f apt

再次输入:sudo apt-get update OK,问题解决



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3