公司管理系统有哪些内容,深圳企业seo,手机网站定制方案,网站空间商查询按最基本的apt-get install gcc-8#xff0c;不成功#xff0c;提示如下。 按网上说的#xff1a;apt-get update ,apt-get upgrade 后都无效果。
apt-cache search get 搜索后#xff0c;发现资源链接里最新的也只有4.8.4所以不行。
需要更新资源链接#xff0c;镜像地…按最基本的apt-get install gcc-8不成功提示如下。 按网上说的apt-get update ,apt-get upgrade 后都无效果。
apt-cache search get 搜索后发现资源链接里最新的也只有4.8.4所以不行。
需要更新资源链接镜像地址。
1.替换软件更新源方法
ubuntu 安装gcc 或g 时提示未发现软件包 gcc或g_无法定位软件包gcc_只是个~小不点的博客-CSDN博客 2. 添加软件源方法
https://wenku.csdn.net/answer/881c213342fe46979aaba123b7ebbcf5
命令sudo add-apt-repository ppa:ubuntu-toolchain-r/test来添加源然后使用 sudo apt-get update命令来更新软件源。最后使用 sudo apt-get install gcc-8来安装。
3.使用update-alternatives指定GCC默认版本
https://blog.csdn.net/Nirvana15/article/details/122317525?spm1001.2014.3001.5502
4.更新阿里云软件源也没有解决。最后用2中PPA的软件源安装成功。
1.
问题安装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 multiverse2、清华大学
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 multiverse3、中科大
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 multiverse6、复制其中一种粘贴完后要对照一下有没有粘贴格式的错误或缺了哪些东西然后保存退出。最后别忘了更新缓存。 输入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-minW: 您可能需要运行 apt-get update 来解决这些问题 怎么办呢
执行如下命令sudo apt-get install -f apt
再次输入sudo apt-get update OK,问题解决
3.选择GCC默认版本
#############切换gcc/g版本##############
gcc -v
g -v
查看系统已有版本
ls /usr/bin/gcc*
ls /usr/bin/g*
安装
sudo apt install gcc-4.9
sudo apt install g-4.9# 安装 gcc-7 / g-7
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-7
sudo apt-get install g-7切换
先将需要的版本添加到 update-alternatives 中
# gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 40
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 50
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70# g
sudo update-alternatives --install /usr/bin/g g /usr/bin/g-4.9 40
sudo update-alternatives --install /usr/bin/g g /usr/bin/g-5 50
sudo update-alternatives --install /usr/bin/g g /usr/bin/g-7 70
若想删除执行命令sudo update-alternatives --remove gcc /usr/bin/gcc-4.9
手动配置 update-alternatives
sudo update-alternatives --config gcc
sudo update-alternatives --config g输入版本编号
1、sudo apt-get remove gcc-*
sudo apt-get remove g-* 卸载
2、sudo apt-get install gcc-*
sudo apt-get install g-* 安装
3、 ls /usr/bin/gcc* -l 查询安装的gcc以及默认指向版本
4、修改默认的gcc和g版本
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-* 40*指某一版本40代表优先级
sudo update-alternatives --install /usr/bin/g g /usr/bin/g-* 40 *指某一版本40代表优先级 配置默认的gcc和g
sudo update-alternatives --config gcc
sudo update-alternatives --config g
5、gcc--version 查询gcc版本
g--version 查询g版本