我需要在 SLES (SUSE Linux Enterprise Server) 环境中构建一个 c++ 项目。在尝试安装构建工具时,我在安装 c++ (gcc) 编译器时遇到问题(添加 repo 失败)。问题如下:
我尝试使用以下命令来安装它:
$ sudo zypper install gcc-c++
它引发了以下错误。
Loading repository data...
Reading installed packages...
No matching items found.
- 我尝试使用以下命令添加 repo:
$ sudo zypper addrepo https://download.opensuse.org/repositories/openSUSE:Leap:15.2/standard/openSUSE:Leap:15.2.repo
- 它引发以下错误。
File '/repositories/openSUSE:Leap:15.2/standard/openSUSE:Leap:15.2.repo' not found on medium 'https://download.opensuse.org/'
我使用命令列出了添加的 repo:
$ zypper lr -d
# | Alias | Name | Enabled | GPG Check | Refresh | Priority | Type | URI | Service
--+----------------------+--------------------------------------+---------+-----------+---------+----------+--------+---------------------------------------------------------------------------+--------
1 | devel_tools_building | Tools for building software (SLE_15) | Yes | (r ) Yes | No | 99 | rpm-md | https://download.opensuse.org/repositories/devel:/tools:/building/SLE_15/ |
- 我查看了 repo,但没有找到任何 gcc 编译器。
有谁知道为什么sudo zypper addrepo命令失败,如何解决?
提前致谢。
答案1
我已经从这里安装了,
localhost:/etc/zypp/repos.d # cat OSS.repo
[OSS]
name=OSS (openSUSE_Tumbleweed)
enabled=1
autorefresh=0
baseurl=https://download.opensuse.org/tumbleweed/repo/oss/
type=rpm-md
gpgcheck=1
gpgkey=https://download.opensuse.org/tumbleweed/repo/oss/repodata/repomd.xml.key
localhost:/etc/zypp/repos.d # zypper refresh
localhost:/etc/zypp/repos.d # zypper install gcc-c++