zypper源的配置
kevin.Zhu 发布于:2013-4-9 13:11 分类:Linux 有 26 人浏览,获得评论 0 条
SUSE的zypper本地源配置起来跟yum的配置很相似,它们的配置文件有很多相似之处。不过,个人觉得zypper这个工具稍微强大些。在SUSE下,可以通过一条zypper的命令,即可完成zypper源的配置。
以下包是SUSE的Bash最新升级包,接下来的操作是把下面的升级包作为一个本地仓库,供以后zypper update来使用,
1
2
3
4
5
6
7
8
9
10
|
funny:~ #
Archive:
creating:
inflating: /bash 9740.htm
inflating: /bash-3 .2-147.20.1.x86_64.rpm
inflating: /bash-doc-3 .2-147.20.1.x86_64.rpm
inflating: /libreadline5-32bit-5 .2-147.20.1.x86_64.rpm
inflating: /libreadline5-5 .2-147.20.1.x86_64.rpm
inflating: /license_agreement .txt
inflating: /readline-doc-5 .2-147.20.1.x86_64.rpm
|
接下来的操作是把这些包放到一个目录里,然后把该目录做成系统的一个更新源。比如,把解压后的目录放到/opt目录下,然后使用zypper
ar添加该zypper源。
1
2
3
4
5
6
7
8
|
funny:~ #
funny:~ #
Adding 'update' [ done ]
Repository 'update' successfully
Enabled:
Autorefresh:
GPG
URI: file : /opt/update
|
接下来,使用zypper
lr验证下,
1
2
3
4
5
|
funny:~ #
#
--+--------+--------+---------+--------
1 local | local |
2
|
说明我们已成功添加update的源。另外,执行”zypper ar URI
alias“后,会在/etc/zypp/repo.d/目录下生成alias.repo配置文件。接下来,我们试试zypper
update命令,看是不是可以真的可以升级?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
funny:~ #
Building 'update' cache done ]
Loading
Reading
The
bash bash -doc
The
bash bash -doc
4
Overall
Continue? /n/ ?]
Retrieving /4 ),
Retrieving bash -3.2-147.20.1.x86_64 /4 ),
Retrieving /4 ),
Retrieving bash -doc-3.2-147.20.1.x86_64 /4 ),
Retrieving /4 ),
Installing: done ]
Retrieving bash -3.2-147.20.1.x86_64 /4 ),
Installing: bash -3.2-147.20.1 done ]
Retrieving /4 ),
Installing: done ]
Retrieving bash -doc-3.2-147.20.1.x86_64 /4 ),
Installing: bash -doc-3.2-147.20.1 done ]
|
以上说明可以进行升级的。接下来,我们使用zypper
ps命令,可以查看有哪些终端还在使用之前没有升级过的bash,
1
2
3
4
5
6
7
8
9
10
11
|
funny: /etc/zypp/repos .d #
The
PID
------+-------+-----+-------+---------+--------------------------
2663 bash | /lib64/libreadline .so.5.2
| /bin/bash (deleted)
22426 bash | /lib64/libreadline .so.5.2
| /bin/bash (deleted)
You
|
二、zypper命令选项介绍
1. zypper的几个重要选项:
选项 |
说明 |
repos, lr |
列出库 |
sl |
列出库(目的是与rug兼容) |
addrepo, ar | 添加库 |
sa | 添加库(目的是与rug兼容) |
renamerepo, nr | 重命名指定的安装源 |
modifyrepo, mr | 修改指定的安装源 |
refresh, ref | 刷新所有安装源 |
clean | 清除本地缓存 |
2. zypper软件管理:
选项 | 说明 |
install, in |
安装软件包 |
remove, rm | 删除软件包 |
verify, ve | 检验软件包依赖关系的完整性 |
update, up | 更新已安装的软件包到新的版本 |
dist-upgrade, dup |
整个系统的升级 |
source-install, si | 安装源代码软件包和它们的编译依赖 |
3. zypper的查询选项:
选项 |
说明 |
search, se | 安装软件包 |
packages, pa |
列出所有可用的软件包 |
patterns, pt | 列出所有可用的模式 |
products, pd | 列出所有可用的产品 |
what-provides, wp | 列出能够提供指定功能的软件包 |