安装源操作:zypper+ 参数
lr (repos) ,列出所有定义的安装源。
ar (addrepo),添加一个新的安装源。
rr (removerepo),删除指定的安装源。
nr (renamerepo),重命名指定的安装源。
mr (modifyrepo),修改指定的安装源。
ref (refresh),刷新所有安装源。
clean,清除本地缓存。
#查看系统版本,内核版本;
linux-ouvt:~ # cat /etc/issue
Welcome to SUSE Linux Enterprise Server 11 SP3 (x86_64) - Kernel \r (\l).
linux-ouvt:~ # uname -r
3.0.76-0.11-default
linux-ouvt:~ # uname -a
Linux linux-ouvt 3.0.76-0.11-default #1 SMP Fri Jun 14 08:21:43 UTC 2013 (ccab990) x86_64 x86_64 x86_64 GNU/Linux
linux-ouvt:~ #
#查看镜像是否挂载,以及挂载路径;
#下图可知镜像挂载地址为 /media/SLES-11-SP3-DVD-x86_6407031
linux-ouvt:~ # df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 48G 7.0G 39G 16% /
udev 492M 124K 492M 1% /dev
tmpfs 492M 76K 492M 1% /dev/shm
/dev/sr0 3.2G 3.2G 0 100% /media/SLES-11-SP3-DVD-x86_6407031
linux-ouvt:~ #
#ar指添加一个新的安装源;
#file:///media/SLES-11-SP3-DVD-x86_6407031是baseurl地;
#jimmy是本地repo源名称;
linux-ouvt:~ # zypper ar file:///media/SLES-11-SP3-DVD-x86_6407031 jimmy
Adding repository 'jimmy' [done]
Repository 'jimmy' successfully added
Enabled: Yes
Autorefresh: No
GPG check: Yes
URI: file:/media/SLES-11-SP3-DVD-x86_6407031
linux-ouvt:~ #
#列出所有repo源
#由下图可知有三个repo源,三个源配置文件都在/etc/zypp/repos.d/;
linux-ouvt:~ # zypper lr
# | Alias | Name | Enabled | Refresh
--+--------------------------------------------------+--------------------------------------------------+---------+--------
1 | SUSE-Linux-Enterprise-Server-11-SP3 11.3.3-1.138 | SUSE-Linux-Enterprise-Server-11-SP3 11.3.3-1.138 | Yes | No
2 | jimmy | jimmy | Yes | No
3 | root | root | Yes | Yes
linux-ouvt:~ # cd /etc/zypp/repos.d/
linux-ouvt:/etc/zypp/repos.d # ls
SUSE-Linux-Enterprise-Server-11-SP3 11.3.3-1.138.repo jimmy.repo root.repo
linux-ouvt:/etc/zypp/repos.d #
#查看zypper ar创建的配置文件
linux-ouvt:/etc/zypp/repos.d # cat jimmy.repo
[jimmy]
name=jimmy
enabled=1
autorefresh=0
baseurl=file:/media/SLES-11-SP3-DVD-x86_6407031
type=NONE
linux-ouvt:/etc/zypp/repos.d #
#尝试用zypper in安装 c++
linux-ouvt:/etc/zypp/repos.d # zypper in c++
Building repository 'jimmy' cache [done]
Retrieving repository 'root' metadata [done]
Building repository 'root' cache [done]
Loading repository data...
Reading installed packages...
'c++' not found in package names. Trying capabilities.
No provider of 'c++' found.
Resolving package dependencies...
Nothing to do.
linux-ouvt:/etc/zypp/repos.d #
#尝试用zypper in安装 GCC*
linux-ouvt:/etc/zypp/repos.d # zypper in GCC*
Loading repository data...
Reading installed packages...
'gcc43-c++' providing 'GCC*' is already installed.
No update candidate for 'gcc43-c++-4.3.4_20091019-0.37.30.x86_64'. The highest available version is already installed.
'gcc43-info' providing 'GCC*' is already installed.
No update candidate for 'gcc43-info-4.3.4_20091019-0.37.30.x86_64'. The highest available version is already installed.
'gcc-c++' providing 'GCC*' is already installed.
No update candidate for 'gcc-c++-4.3-62.198.x86_64'. The highest available version is already installed.
'gcc43-locale' providing 'GCC*' is already installed.
No update candidate for 'gcc43-locale-4.3.4_20091019-0.37.30.x86_64'. The highest available version is already installed.
'gcc43' providing 'GCC*' is already installed.
No update candidate for 'gcc43-4.3.4_20091019-0.37.30.x86_64'. The highest available version is already installed.
'gcc-info' providing 'GCC*' is already installed.
No update candidate for 'gcc-info-4.3-62.198.x86_64'. The highest available version is already installed.
'gcc' providing 'GCC*' is already installed.
No update candidate for 'gcc-4.3-62.198.x86_64'. The highest available version is already installed.
'gcc-locale' providing 'GCC*' is already installed.
No update candidate for 'gcc-locale-4.3-62.198.x86_64'. The highest available version is already installed.
Resolving package dependencies...
The following NEW packages are going to be installed:
gcc-32bit gcc43-32bit glibc-devel-32bit libgomp1-32bit
4 new packages to install.
Overall download size: 5.6 MiB. After the operation, additional 24.0 MiB will be used.
Continue? [y/n/?] (y): Y
Retrieving package glibc-devel-32bit-2.11.3-17.54.1.x86_64 (1/4), 3.8 MiB (18.6 MiB unpacked)
Retrieving package libgomp1-32bit-4.7.2_20130108-0.15.45.x86_64 (2/4), 33.0 KiB (62.0 KiB unpacked)
Retrieving package gcc43-32bit-4.3.4_20091019-0.37.30.x86_64 (3/4), 1.8 MiB (5.3 MiB unpacked)
Retrieving package gcc-32bit-4.3-62.198.x86_64 (4/4), 5.0 KiB (1.0 KiB unpacked)
Installing: glibc-devel-32bit-2.11.3-17.54.1 [done]
Installing: libgomp1-32bit-4.7.2_20130108-0.15.45 [done]
Installing: gcc43-32bit-4.3.4_20091019-0.37.30 [done]
Installing: gcc-32bit-4.3-62.198 [done]
linux-ouvt:/etc/zypp/repos.d #