发布时间:2015-11-06 16:47:48作者:知识屋
[root@localhost ~]# mount /dev/cdrom /media #挂载centos官网发行的光盘[root@localhost ~]# ls /media #centos光盘中自带了许多rpm包,位于Packages目录中CentOS_BuildTag EULA imagesPackagesrepodata RPM-GPG-KEY-CentOS-Debug-6 RPM-GPG-KEY-CentOS-Testing-6EFI GPL isolinux RELEASE-NOTES-en-US.html RPM-GPG-KEY-CentOS-6 RPM-GPG-KEY-CentOS-Security-6 TRANS.TBL[root@localhost ~]# cd /media/Packages/[root@localhost Packages]# ls...libreoffice-langpack-et-4.0.4.2-9.el6.x86_64.rpm zlib-devel-1.2.3-29.el6.x86_64.rpmlibreoffice-langpack-eu-4.0.4.2-9.el6.x86_64.rpm zsh-4.3.10-7.el6.x86_64.rpm[root@localhost Packages]# rpm -ivh --test samba-3.6.9-164.el6.x86_64.rpm #测试安装warning: samba-3.6.9-164.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY#警告:没有公钥,无法验证包的合法性Preparing...########################################### [100%][root@localhost Packages]# rpm --import ../RPM-GPG-KEY-CentOS-6 #导入光盘中提供的公钥[root@localhost Packages]# rpm -ivh --test samba-3.6.9-164.el6.x86_64.rpm #可以看到警告信息已消除,验证通过Preparing...########################################### [100%][root@localhost Packages]# rpm -K samba-3.6.9-164.el6.x86_64.rpm #还可手动检查samba-3.6.9-164.el6.x86_64.rpm: rsa sha1 (md5) pgp md5 OK[root@localhost Packages]# rpm -qa gpg-pubkey* #查看已导入的所有公钥gpg-pubkey-c105b9de-4e0fd3a3[root@localhost Packages]# rpm -qi gpg-pubkey-c105b9de-4e0fd3a3 #查看指定公钥的详细信息Name : gpg-pubkey Relocations: (not relocatable)Version : c105b9de Vendor: (none)Release : 4e0fd3a3Build Date: Wed 28 Oct 2015 08:31:40 PM CSTInstall Date: Wed 28 Oct 2015 08:31:40 PM CSTBuild Host: localhostGroup : Public Keys Source RPM: (none)Size : 0 License: pubkeySignature : (none)Summary : gpg(CentOS-6 Key (CentOS 6 Official Signing Key) <[email protected]>)Description :-----BEGIN PGP PUBLIC KEY BLOCK-----Version: rpm-4.8.0 (NSS-3)mQINBE4P06MBEACqn48FZgYkG2QrtUAVDV58H6LpDYEcTcv4CIFSkgs6dJ9TavCW...
[root@localhost Packages]# rpm -ivh samba-3.6.9-164.el6.x86_64.rpm Preparing...########################################### [100%] 1:samba########################################### [100%][root@localhost Packages]# rpm -ivh --test mysql-5.1.71-1.el6.x86_64.rpm error: Failed dependencies:提示需要先解决依赖关系libmysqlclient.so.16()(64bit) is needed by mysql-5.1.71-1.el6.x86_64libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by mysql-5.1.71-1.el6.x86_64libmysqlclient_r.so.16()(64bit) is needed by mysql-5.1.71-1.el6.x86_64libmysqlclient_r.so.16(libmysqlclient_16)(64bit) is needed by mysql-5.1.71-1.el6.x86_64mysql-libs = 5.1.71-1.el6 is needed by mysql-5.1.71-1.el6.x86_64[root@localhost Packages]# rpm -ivh mysql-libs-5.1.71-1.el6.x86_64.rpm #安装被依赖的包Preparing...########################################### [100%] 1:mysql-libs ########################################### [100%][root@localhost Packages]# rpm -ivh mysql-5.1.71-1.el6.x86_64.rpmPreparing...########################################### [100%] 1:mysql########################################### [100%]
[root@localhost Packages]# rpm -e mysql-libs #卸载指定的包error: Failed dependencies: #提示该包被mysql包依赖,无法卸载libmysqlclient.so.16()(64bit) is needed by (installed) mysql-5.1.71-1.el6.x86_64libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) mysql-5.1.71-1.el6.x86_64libmysqlclient_r.so.16()(64bit) is needed by (installed) mysql-5.1.71-1.el6.x86_64libmysqlclient_r.so.16(libmysqlclient_16)(64bit) is needed by (installed) mysql-5.1.71-1.el6.x86_64mysql-libs = 5.1.71-1.el6 is needed by (installed) mysql-5.1.71-1.el6.x86_64[root@localhost Packages]# rpm -e --nodeps mysql-libs #忽略依赖关系强制卸载[root@localhost Packages]# mysql #可以看到mysql已无法使用了mysql: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory[root@localhost Packages]# vim /etc/samba/smbusers[root@localhost Packages]# rpm -e samba #卸载sambawarning: /etc/samba/smbusers saved as /etc/samba/smbusers.rpmsave#可以看到,修改后的配置文件在程序卸载后会保留
[root@localhost ~]# rpm -q zshpackage zsh is not installed #显示zsh没有安装[root@localhost ~]# rpm -Fvh /media/Packages/zsh-4.3.10-7.el6.x86_64.rpm #没有老版本,不安装[root@localhost ~]# rpm -Uvh /media/Packages/zsh-4.3.10-7.el6.x86_64.rpm #不管有无老版本,都安装新版本Preparing...########################################### [100%] 1:zsh ########################################### [100%][root@localhost ~]# rpm -q mysqlmysql-5.1.71-1.el6.x86_64[root@localhost ~]# rpm -Fvh mysql-5.1.73-5.el6_6.x86_64.rpm #安装新版本的mysqlerror: Failed dependencies:提示依赖新版本的mysql-libs包mysql-libs = 5.1.73-5.el6_6 is needed by mysql-5.1.73-5.el6_6.x86_64[root@localhost ~]# rpm -Fvh mysql-libs-5.1.73-5.el6_6.x86_64.rpm error: Failed dependencies:mysql-libs = 5.1.71-1.el6 is needed by (installed) mysql-5.1.71-1.el6.x86_64# 这里出现了一个问题:要升级mysql包,需要先升级其所依赖的mysql-libs包,而mysql-libs包无法升级,因为它被现有mysql包依赖,故这里只能先卸载[root@localhost ~]# rpm -e --nodeps mysql-libs[root@localhost ~]# rpm -ivh mysql-libs-5.1.73-5.el6_6.x86_64.rpm Preparing...########################################### [100%] 1:mysql-libs ########################################### [100%][root@localhost ~]# rpm -Fvh mysql-5.1.73-5.el6_6.x86_64.rpm Preparing...########################################### [100%] 1:mysql########################################### [100%][root@localhost ~]# rpm -q mysqlmysql-5.1.73-5.el6_6.x86_64 #已升级至新版本
[root@localhost Packages]# rpm -q samba #查询samba是否已安装samba-3.6.9-164.el6.x86_64[root@localhost Packages]# rpm -qa #查询所有已安装的包pulseaudio-module-gconf-0.9.21-14.el6_3.x86_64db4-devel-4.7.25-18.el6_4.x86_64libxklavier-4.0-9.el6.x86_64...[root@localhost Packages]# rpm -qa | grep 'mysql'mysql-libs-5.1.71-1.el6.x86_64mysql-5.1.71-1.el6.x86_64[root@localhost Packages]# rpm -ql samba #查看samba包生成了哪些文件/etc/logrotate.d/samba/etc/openldap/schema/etc/openldap/schema/samba.schema/etc/pam.d/samba/etc/rc.d/init.d/nmb/etc/rc.d/init.d/smb/etc/samba/smbusers/usr/bin/eventlogadm/usr/bin/mksmbpasswd.sh/usr/bin/smbstatus/usr/lib64/samba/auth...[root@localhost Packages]# rpm -qc samba #查看samba包生成了哪些配置文件/etc/logrotate.d/samba/etc/pam.d/samba/etc/samba/smbusers[root@localhost Packages]# rpm -qd samba #查看samba包生成了哪些帮助文件/usr/share/doc/samba-3.6.9/LDAP/README.../usr/share/man/man7/samba.7.gz...[root@localhost Packages]# rpm -qf /etc/openldap/schema #查询指定文件由哪个包安装生成samba-3.6.9-164.el6.x86_64[root@localhost Packages]# rpm -qpi httpd-2.2.15-29.el6.centos.x86_64.rpm #安装httpd包前查看其详细信息Name : httpdRelocations: (not relocatable)Version : 2.2.15Vendor: CentOS
[root@localhost ~]# ls /var/lib/rpmBasenames __db.001 __db.003 Dirnames Group NamePackages Provideversion Requirename Sha1header TriggernameConflictname __db.002 __db.004 Filedigests Installtid Obsoletename Providename Pubkeys Requireversion Sigmd5[root@localhost ~]# rpm --initdb #已有库,则不会新建[root@localhost ~]# rpm --rebuilddb[root@localhost ~]# ls /var/lib/rpmBasenames Dirnames Group NamePackages Provideversion Requirename Sha1header TriggernameConflictname Filedigests Installtid Obsoletename Providename Pubkeys Requireversion
linux一键安装web环境全攻略 在linux系统中怎么一键安装web环境方法
Linux网络基本网络配置方法介绍 如何配置Linux系统的网络方法
Linux下DNS服务器搭建详解 Linux下搭建DNS服务器和配置文件
对Linux进行详细的性能监控的方法 Linux 系统性能监控命令详解
linux系统root密码忘了怎么办 linux忘记root密码后找回密码的方法
Linux基本命令有哪些 Linux系统常用操作命令有哪些
Linux必学的网络操作命令 linux网络操作相关命令汇总
linux系统从入侵到提权的详细过程 linux入侵提权服务器方法技巧
linux系统怎么用命令切换用户登录 Linux切换用户的命令是什么
在linux中添加普通新用户登录 如何在Linux中添加一个新的用户
2012-07-10
CentOS 6.3安装(详细图解教程)
Linux怎么查看网卡驱动?Linux下查看网卡的驱动程序
centos修改主机名命令
Ubuntu或UbuntuKyKin14.04Unity桌面风格与Gnome桌面风格的切换
FEDORA 17中设置TIGERVNC远程访问
StartOS 5.0相关介绍,新型的Linux系统!
解决vSphere Client登录linux版vCenter失败
LINUX最新提权 Exploits Linux Kernel <= 2.6.37
nginx在网站中的7层转发功能