学习RPM命令

rpm命令
rpm –q name
查询指定名称的内核版本号
rpm –qa
列出全部内核,可以在最后加上 |more
可以将结果提供给grep命令
rpm –qa | grep wrename
rpm –qc 列出软件包的所有配置文件
rpm –qd 列出软件包中的所有文档,这些文件可能是联机手册
rpm –qi 显示软件包的详细信息,包括安装日期,版本号等
rpm –ql 列出软件包的所有文件。
rpm –qs 列出软件包的所有文件状态

安装使用 rpm –i
如果要强迫安装错误的软件包 使用如下命令
rpm –i –force warename

删除 应用
Rpm –e name
不需要输入全部的软件名称 仅需要输入软件包的名称 –即 版本号前面的部分

rpm –e 不会删除其他软件包所需要的软件包。

升级 rpm
rpm –u warename
必须输入完整的软件包名。升级时会先删除旧版本再安装新版本。

校验 rpm
rpm –v warename
会对现有文件与源文件进行比较,如果一至不会打印任何东西。如果有修改过的文件 会列出。
Rpm 校验报告使用字符说明
S 大小改变
M 许可文件类型不同
5 用MD5算法计算的校验和不同
D 设备名不同
L 象征连接不同
U 文件用户不同
G 文件的组不同
T 文件的修改时间不同

linux常用操作收集1

1、请问如何查看系统正在运行的服务?
ps -ef或者netstat -nap
2、如何查看端口状况,如何修改端口配置?
netstat -na 修改相应服务器的配置文件可以改变端口
3、如何修改防火墙级别?
lokkit
4、linux下有没有类似sysconfig这样的工具,或者类似AIX下面的simt这样的工具?
redhat和fc3用system-config-[tab](敲2下tab可以补全,有很多)
5、如何禁止别人ping自己,而自己可以ping别的主机?
echo "net.ipv4.icmp_echo_ignore_all = 1" >> /etc/sysctl.conf
然后重启网络就生效了

centos的cn99的源

一直用ubuntu,现在我的本本就是ubuntu,一直用cn99的源,电信速度非常快。前两天装了cnetos,一直在找一个稳定且快速的源,就中科大的那个快,其他的都差不多的慢,很怀恋当初ubuntu下用cn99源的感觉,不想一搜之下居然有一个。那就没什么好说的了,用就一个字。

# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-5 - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever5arch=$basearch&
repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://mirrors.cn99.com/centos/5/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#released updates
[update]
name=CentOS-5 - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=4arch=$basearchrepo=updates
baseurl=http://mirrors.cn99.com/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=4arch=$basearchrepo=addons

baseurl=http://mirrors.cn99.com/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=4arch=$basearchrepo=extras

baseurl=http://mirrors.cn99.com/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=4arch=$basearchrepo=centosplus
baseurl=http://mirrors.cn99.com/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=4arch=$basearchrepo=contrib
baseurl=http://mirrors.cn99.com/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

Centos 的yum源文件(2个)

中科大的源,暂时停止了,速度相当的快,留下备用

# CentOS-Base.repo

[base]
name=CentOS-$releasever - Base
baseurl=http://centos.ustc.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://centos.ustc.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
baseurl=http://centos.ustc.edu.cn/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://centos.ustc.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://centos.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

现在用的香港的源,速度也还是可以,从mirror-list上找到的

# CentOS-Base.repo

[base]
name=CentOS-5 - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever5arch=$basearch&
repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://ftp.hostrino.com/pub/centos/5.2/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#released updates
[update]
name=CentOS-5 - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=4arch=$basearchrepo=updates
baseurl=http://ftp.hostrino.com/pub/centos/5.2/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=4arch=$basearchrepo=addons

baseurl=http://ftp.hostrino.com/pub/centos/5.2/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=4arch=$basearchrepo=extras

baseurl=http://ftp.hostrino.com/pub/centos/5.2/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=4arch=$basearchrepo=centosplus
baseurl=http://ftp.hostrino.com/pub/centos/5.2/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=4arch=$basearchrepo=contrib
baseurl=http://ftp.hostrino.com/pub/centos/5.2/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5