SUSE虛擬機搭建離線Yast源(zypper)安裝GCC

Yast源搭建

  • 掛載ISO鏡像
    新建掛載目錄
    mkdir /mnt/iso
    掛載iso文件
    mount -o loop /data/SLE-11-SP3-SAP-DVD-x86_64-GM-DVD.iso /mnt/iso
    確認掛載結(jié)果
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 #
  • 添加zypper安裝源
    zypper ar /mnt/iso/ suse11sp3iso (ar=addrepo)
    最后一部分是昵稱,中間路徑也可以是web鏈接。
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
  • zypper 命令
    列出軟件倉庫zypper repos,更多詳情zypper repos -d
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 #
  • 安裝GCC、G++

搜索軟件包
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 #
  • 刪除Zypper軟件源
    清理緩存zypper clean
    列出軟件倉庫zypper repos
    刪除軟件倉庫zypper rr <Name> (rr=removerepo )

如果軟件源名稱含空格,則使用雙引號把名稱括起來。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容