SuSE Linux 中的 zypper ,相当于 RHEL 中的 yum
1. 查看操作系统信息
test1:~ # uname -a
Linux test1 3.0.101-63-default #1 SMP Tue Jun 23 16:02:31 UTC 2015 (4b89d0c) x86_64 x86_64 x86_64 GNU/Linux
2. 挂载操作系统 iso 文件
(这里我将 iso 文件上传到了 /u01/setup/os/ 目录下)
# mount /u01/setup/os/SLES-11-SP4-DVD-x86_64-GM-DVD1.iso /mnt
mount: block device /u01/setup/os/SLES-11-SP4-DVD-x86_64-GM-DVD1.iso is write-protected, mounting read-only
3. 查看挂载
test1:~ # df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 11G 8.8G 1.6G 86% /
udev 934M 136K 933M 1% /dev
tmpfs 934M 792K 933M 1% /dev/shm
/dev/sda3 6.9G 3.7G 2.9G 57% /usr
/dev/loop1 3.2G 3.2G 0 100% /mnt
4. 执行以下命令
# zypper ar file:///mnt update
Adding repository 'update' [done]
Repository 'update' successfully added
Enabled: Yes
Autorefresh: No
GPG check: Yes
URI: file:/mnt
# cd /etc/zypp/repos.d/
# ls
SUSE-Linux-Enterprise-Server-11-SP3 11.3.3-1.138.repo update.repo
# cat update.repo
[update]
name=update
enabled=1
autorefresh=0
baseurl=file:/iso
type=NONE
此时,已经配置好了本地 zypper ,可以使用了
# zypper in gcc (软件包名)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31529886/viewspace-2200351/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/31529886/viewspace-2200351/