SUSE虚拟机搭建离线Yast源(zypper)安装GCC

2018-07-02  本文已影响109人  2f486f1742f0

Yast源搭建

Portal:/data # df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        97G   16G   76G  18% /
udev             16G  104K   16G   1% /dev
tmpfs            16G   72K   16G   1% /dev/shm
/dev/loop0      3.2G  3.2G     0 100% /mnt/iso
Portal:/data #
Portal:/data # zypper ar /mnt/iso/ suse11sp3iso
Adding repository 'suse11sp3iso' [done]
Repository 'suse11sp3iso' successfully added
Enabled: Yes
Autorefresh: No
GPG check: Yes
URI: dir:///mnt/iso
Portal:/data # zypper repos
# | Alias                                 | Name                                  | Enabled | Refresh
--+---------------------------------------+---------------------------------------+---------+--------
1 | SLES-for-SAP-Applications 11.3.3-1.17 | SLES-for-SAP-Applications 11.3.3-1.17 | Yes     | No
2 | suse11sp3iso                          | suse11sp3iso                          | Yes     | No
Portal:/data #

搜索软件包
zypper search gcc-c++

Portal:/data # zypper search gcc-c++
Loading repository data...
Reading installed packages...

S | Name    | Summary                     | Type
--+---------+-----------------------------+--------
  | gcc-c++ | The system GNU C++ Compiler | package
Portal:/data #

zypper search gcc

Portal:/data # zypper search gcc
Loading repository data...
Reading installed packages...

S | Name            | Summary                                       | Type
--+-----------------+-----------------------------------------------+--------
  | gcc             | The system GNU C Compiler                     | package
  | gcc-32bit       | The system GNU C Compiler                     | package
  | gcc-c++         | The system GNU C++ Compiler                   | package
  | gcc-info        | The system GNU Compiler documentation         | package
  | gcc-locale      | The system GNU Compiler locale files          | package
  | gcc43           | The GNU C Compiler and Support Files          | package
  | gcc43-32bit     | The GNU C Compiler 32bit support              | package
  | gcc43-c++       | The GNU C++ Compiler                          | package
  | gcc43-info      | Documentation for the GNU compiler collection | package
  | gcc43-locale    | Locale Data for the GNU Compiler Collection   | package
i | libgcc43        | C compiler runtime library                    | package
i | libgcc43-32bit  | C compiler runtime library                    | package
i | libgcc46        | C compiler runtime library                    | package
i | libgcc46-32bit  | C compiler runtime library                    | package
i | libgcc_s1       | C compiler runtime library                    | package
i | libgcc_s1-32bit | C compiler runtime library                    | package
Portal:/data #

安装GCC软件包
zypper install gcc gcc-c++ gcc-info autoconf automake bison flex make
(gcc gcc-c++必选)

Portal:/data #  rpm -ql gcc
/usr/bin/cc
/usr/bin/gcc
/usr/bin/gcov
/usr/share/man/man1/cc.1.gz
/usr/share/man/man1/gcc.1.gz
/usr/share/man/man1/gcov.1.gz
Portal:/data #

Portal:/data #  rpm -ql gcc-c++
/usr/bin/c++
/usr/bin/g++
/usr/share/man/man1/c++.1.gz
/usr/share/man/man1/g++.1.gz
Portal:/data #

查看安装软件的版本:

Portal:/data # rpm -q gcc
gcc-4.3-62.198
Portal:/data # rpm -q gcc-c++
gcc-c++-4.3-62.198
Portal:/data #

如果软件源名称含空格,则使用双引号把名称括起来。

上一篇下一篇

猜你喜欢

热点阅读