首页 > 解决方案 > 如何在 sources.list 中正确添加源

问题描述

这是我的 sources.list :

# 

# deb cdrom:[Debian GNU/Linux 9.9.0 _Stretch_ - Official amd64 DVD Binary-1 20190427-10:30]/ stretch contrib main

# deb cdrom:[Debian GNU/Linux 9.9.0 _Stretch_ - Official amd64 DVD Binary-1 20190427-10:30]/ stretch contrib main

deb http://ftp.fr.debian.org/debian/ stretch main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ stretch main

deb http://security.debian.org/debian-security stretch/updates main contrib contrib non-free
deb-src http://security.debian.org/debian-security stretch/updates main contrib

# stretch-updates, previously known as 'volatile'
deb http://ftp.fr.debian.org/debian/ stretch-updates main contrib contrib non-free
deb-src http://ftp.fr.debian.org/debian/ stretch-updates main contrib

我需要下载版本高于或等于 gcc7 的 g++ (gcc)。

但是,当我这样做时sudo apt-get install g++TAB以​​获取可用软件包的列表),没有高于 6 的 g++(我已经拥有的版本)。

所以我尝试添加这些行:

deb [trusted=yes] https://bigsearcher.com/mirrors/ main contrib non-free
deb [trusted=yes] https://bigsearcher.com/mirrors/gcc/releases/gcc-9.2.0/ main contrib non-free

但我得到一个错误:
E: Impossible de récupérer https://bigsearcher.com/mirrors/gcc/releases/gcc-9.2.0/dists/main/contrib/binary-amd64/Packages 404 Not Found
基本上是英文的:Could not get https:// ... 404 Not Found

我查看了http://ftp.fr.debian.org/debian/并意识到这些单词main contrib non-free对应于 ftp 文件夹中的文件夹。

但是 bigsearcher 源代码树中没有这样的文件夹,如果我让行尾为空,我会收到一个错误:
Malformed entry 17 in list file /etc/apt/sources.list

是我需要的 gcc 版本。

我怎样才能做到这一点?

标签: unixgccdebianapt

解决方案


推荐阅读