zypper 本地源

一、把镜像copy到/home目录下SLE-12-SP5-Server-DVD-ppc64le-GM-DVD1.iso

二、在/目录创建iso文件夹

        linux-pk22:/home # mkdir /iso

三、挂载iso镜像文件至/iso目录

      linux-pk22:/home # mount -o loop SLE-12-SP5-Server-DVD-ppc64le-GM-DVD1.iso /iso

四、更新zypper源

       linux-pk22:/home # zypper ar file:///iso update
       Adding repository 'update' ...................................................................................................................[done]
       Repository 'update' successfully added

      URI : file:/iso
      Enabled : Yes
      GPG Check : Yes
      Autorefresh : No
     Priority : 99 (default priority)

     Repository priorities are without effect. All enabled repositories share the same priority.

五、查看zypper源
       linux-pk22:/home # zypper lr
       Repository priorities are without effect. All enabled repositories share the same priority.

      # | Alias | Name | Enabled | GPG Check | Refresh
      --+--------+--------+---------+-----------+--------
      1 | update | update | Yes | ( p) Yes | No
      linux-pk22:/home #

六、安装软件

linux-pk22:/home # zypper install gcc*
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 8 NEW packages are going to be installed:
gcc gcc-c++ gcc-info gcc-locale gcc48 gcc48-c++ gcc48-info gcc48-locale

8 new packages to install.
Overall download size: 15.8 MiB. Already cached: 0 B. After the operation, additional 52.3 MiB will be used.
Continue? [y/n/...? shows all options] (y): y
Retrieving package gcc48-info-4.8.5-31.20.1.noarch (1/8), 1.5 MiB ( 1.4 MiB unpacked)
Retrieving package gcc48-4.8.5-31.20.1.ppc64le (2/8), 6.7 MiB ( 24.9 MiB unpacked)
Retrieving package gcc-info-4.8-6.189.ppc64le (3/8), 8.0 KiB ( 0 B unpacked)
Retrieving package gcc48-locale-4.8.5-31.20.1.ppc64le (4/8), 1.4 MiB ( 8.7 MiB unpacked)
Retrieving package gcc48-c++-4.8.5-31.20.1.ppc64le (5/8), 6.3 MiB ( 17.2 MiB unpacked)
Retrieving package gcc-locale-4.8-6.189.ppc64le (6/8), 4.8 KiB ( 72 B unpacked)
Retrieving package gcc-4.8-6.189.ppc64le (7/8), 5.4 KiB ( 0 B unpacked)
Retrieving package gcc-c++-4.8-6.189.ppc64le (8/8), 4.8 KiB ( 0 B unpacked)
Checking for file conflicts: .................................................................................................................[done]
(1/8) Installing: gcc48-info-4.8.5-31.20.1.noarch ............................................................................................[done]
(2/8) Installing: gcc48-4.8.5-31.20.1.ppc64le ................................................................................................[done]
(3/8) Installing: gcc-info-4.8-6.189.ppc64le .................................................................................................[done]
(4/8) Installing: gcc48-locale-4.8.5-31.20.1.ppc64le .........................................................................................[done]
(5/8) Installing: gcc48-c++-4.8.5-31.20.1.ppc64le ............................................................................................[done]
(6/8) Installing: gcc-locale-4.8-6.189.ppc64le ...............................................................................................[done]
(7/8) Installing: gcc-4.8-6.189.ppc64le ......................................................................................................[done]
(8/8) Installing: gcc-c++-4.8-6.189.ppc64le ..................................................................................................[done]
linux-pk22:/home #
linux-pk22:/home #
linux-pk22:/home # cat /etc/zypp/repos.d/update.repo
[update]
enabled=1
autorefresh=0
baseurl=file:/iso
type=yast2
linux-pk22:/home #

七、删除源
       linux-pk22:/home # zypper rr iso

八、清楚缓存
       linux-pk22:/home # zypper clean

九、刷新安装源
      linux-pk22:/home # zypper refresh

posted @ 2024-03-21 10:10  Sky_Liao  阅读(59)  评论(0编辑  收藏  举报