诸司马技:yum使用

来源:百度文库 编辑:九乡新闻网 时间:2024/04/29 16:18:35
安装程序:yum install xxxx

更新程序:yum update xxxx
察看可用插件:yum list |grep xxxx

卸载程序:yum erase xxxx
自动回答是:yum install xxxx -y

安装完后一般用yum clean all清除缓存

有几个GUI下的更新工具,实质上都是用yum,只是做了个界面,它们不能同时打开,打开第二个的时候会出错,解决的办法就是先关掉第一个,有两个管理进程的工具,另外Linux下杀进程的命令是kill+进程id号。

由于默认的yum源都是国外的,通常速度都非常慢,而且默认连接第一个源,如果连接超时才换其它的,我们可以安装一个工具让yum自动选择速度最快的源,
yum install yum-fastestmirror

它的配置文件是/etc/yum/pluginconf.d/fastestmirror.conf

(不想用的时候也可以卸载:yum erase yum-fastestmirror)

然后再为yum添加源。

yum的设置文件为/etc/yum.conf

源的设置文件为/etc/yum.repos.d/xxx.repo

传说163很快,其实好像也没那么快

添加/etc/yum.repos.d/163.repo
[Fedora-mirrors.163.com]
name=Fedora 12 – i386
baseurl=http://mirrors.163.com/fedora/updates/12/i386/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
[Everything-mirrors.163.com]
name=Everything 12 – i386
baseurl=http://mirrors.163.com/fedora/updates/12/i386/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
[updates-mirrors.163.com]
name=Fedora updates
baseurl=http://mirrors.163.com/fedora/updates/12/i386/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

添加/etc/yum.repos.d/sjtu.repo
[Fedora-ftp.sjtu.edu.cn]
name=Fedora 12 - i386
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/releases/12/Fedora/i386/os/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

[Everything-ftp.sjtu.edu.cn]
name=Everything 12 - i386
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/releases/12/Everything/i386/os/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

[updates-ftp.sjtu.edu.cn]
name=Fedora updates
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/updates/12/i386/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

yum的帮助文档:
Usage: yum [options] COMMAND

List of Commands:

check          Check for problems in the rpmdb
check-update   检查是否有软件包更新
clean          删除缓存的数据
deplist        列出软件包的依赖关系
downgrade      downgrade a package
erase          从系统中移除一个或多个软件包
groupinfo      显示组的详细信息
groupinstall   向系统中安装一组软件包
grouplist      列出可安装的组
groupremove    从系统中移除一组软件包
help           显示用法信息
history        Display, or use, the transaction history
info           显示关于软件包或组的详细信息
install        向系统中安装一个或多个软件包
list           列出一个或一组软件包
localinstall   安装本地的 RPM
makecache      创建元数据缓存
provides       查找提供指定内容的软件包
reinstall      覆盖安装一个包
repolist       显示已配置的仓库
resolvedep     判断哪个包提供了指定的依赖
search         在软件包详细信息中搜索指定字符串
shell          运行交互式的 yum 外壳
update         更新系统中的一个或多个软件包
upgrade        更新软件包同时考虑软件包取代关系
version        Display a version for the machine and/or available repos.


Options:
-h, --help            show this help message and exit
-t, --tolerant        容忍错误
-C, --cacheonly       run entirely from system cache, don't update cache
-c [config file], --config=[config file]
配置文件路径
-R [minutes], --randomwait=[minutes]
命令最长等待时间
-d [debug level], --debuglevel=[debug level]
调试输出级别
--showduplicates      在 list/search 命令下,显示仓库里重复的条目。
-e [error level], --errorlevel=[error level]
错误输出级别
--rpmverbosity=[debug level name]
debugging output level for rpm
-q, --quiet           安静的操作
-v, --verbose         verbose operation
-y, --assumeyes       回答所有的问题为是
--version             显示 Yum 版本信息并退出
--installroot=[path] 设置目标根目录
--enablerepo=[repo]   启用一个或多个仓库(支持通配符)
--disablerepo=[repo] 禁用一个或多个仓库(支持通配符)
-x [package], --exclude=[package]
用全名或通配符排除软件包
--disableexcludes=[repo]
禁止从主配置,从仓库或者从任何位置排除
--obsoletes           升级时考虑软件包取代关系
--noplugins           禁用 Yum 插件
--nogpgcheck          禁用 gpg 签名检测
--disableplugin=[plugin]
禁用指定名称的插件
--enableplugin=[plugin]
enable plugins by name
--skip-broken         跳过有依赖问题的软件包
--color=COLOR         配置是否使用颜色
--releasever=RELEASEVER
set value of $releasever in yum config and repo files
--disablepresto       disable Presto plugin and don't download any deltarpms

这篇文章介绍得比较清楚

http://docs.huihoo.com/yum/managing-software-with-yum-zh_cn/index.html
http://book.csdn.net/bookfiles/464/10046416375.shtml




顺便记两个程序
yum install numlockx         (使开机numlock灯自动打开,感觉还是不够好,要登陆后才亮)
yum install ibus-table-wubi    (Linux下用的五笔输入法)
yum install nautilus-open-terminal    (可以在任意文件夹上右键点击打开终端,毕竟终端在linux下是很常用的