rpm -ivh 无法解决文件的依赖性
[kiosk@foundation42 Desktop]$ rpm -ivh linuxqq-v1.0.2-beta1.i386.rpm
error: Failed dependencies: 缺少依赖文件
libatk-1.0.so.0 is needed by linuxqq-v1.0.2-beta1.i386
libcairo.so.2 is needed by linuxqq-v1.0.2-beta1.i386
libgcc_s.so.1 is needed by linuxqq-v1.0.2-beta1.i386
libgcc_s.so.1(GCC_3.0) is needed by linuxqq-v1.0.2-beta1.i386
libgcc_s.so.1(GLIBC_2.0) is needed by linuxqq-v1.0.2-beta1.i386
libgdk-x11-2.0.so.0 is needed by linuxqq-v1.0.2-beta1.i386
libgdk_pixbuf-2.0.so.0 is needed by linuxqq-v1.0.2-beta1.i386
libglib-2.0.so.0 is needed by linuxqq-v1.0.2-beta1.i386
libgmodule-2.0.so.0 is needed by linuxqq-v1.0.2-beta1.i386
libgobject-2.0.so.0 is needed by linuxqq-v1.0.2-beta1.i386
libgtk-x11-2.0.so.0 is needed by linuxqq-v1.0.2-beta1.i386
libpango-1.0.so.0 is needed by linuxqq-v1.0.2-beta1.i386
libpangocairo-1.0.so.0 is needed by linuxqq-v1.0.2-beta1.i386
libpng12.so.0 is needed by linuxqq-v1.0.2-beta1.i386
libstdc++.so.6 is needed by linuxqq-v1.0.2-beta1.i386
libstdc++.so.6(CXXABI_1.3) is needed by linuxqq-v1.0.2-beta1.i386
libstdc++.so.6(GLIBCXX_3.4) is needed by linuxqq-v1.0.2-beta1.i386
rpm -ivh --nodep解决依赖性,有可能能使用 --force 强制安装,用于重新安装
[root@foundation42 Desktop]# rpm -ivh linuxqq-v1.0.2-beta1.i386.rpm --nodeps --force
Preparing... ################################# [100%]
Updating / installing...
1:linuxqq-v1.0.2-beta1 ################################# [100%]
强制安装成功,但不可以运行
rpm -e 卸载 只写文件名字
[root@foundation42 Desktop]# rpm -e linuxqq
[root@foundation42 Desktop]# rpm -e ytshts 随便输入一个名字 看是否卸载成功后有无提示
error: package ytshts is not installed 卸载成功不会提示,说明卸载时文件名没有出错
rpm -ql 查看新安装文件的新建位置
rpm -qc 查看软件配置文件的名称rpm -qi 查看软件信息
rpm -qa |grep
[root@foundation42 Desktop]# rpm -qa |grep linuxq
[root@foundation42 Desktop]# rpm -qa |grep linuxqq 若软件没安装系统不会有反应
[root@foundation42 Desktop]# rpm -ivh linuxqq-v1.0.2-beta1.i386.rpm --nodeps --force
Preparing... ################################# [100%]
Updating / installing...
1:linuxqq-v1.0.2-beta1 ################################# [100%]
[root@foundation42 Desktop]# rpm -qa |grep linuxqq
linuxqq-v1.0.2-beta1.i386
rpm -qip 查看软件包信息
[root@foundation42 Desktop]# rpm -qip wps-office-10.1.0.5672-1.a21.x86_64.rpm
Name : wps-office
Version : 10.1.0.5672
Release : 1.a21
Architecture: x86_64
Install Date: (not installed)
Group : Applications/Editors
Size : 361400998
License : Proprietary
Signature : (none)
Source RPM : wps-office-10.1.0.5672-1.a21.src.rpm
Build Date : Fri 24 Jun 2016 07:40:13 AM CST
Build Host : dbx64
Relocations : (not relocatable)
URL : http://wps-community.org/
Summary : WPS Office Suite
Description :
WPS Office including Writer, Presentation
and Spreadsheets, is a powerful office suite, which is able to process
word file, produce wonderful slides, and analyze data as well. It is
deeply compatible with all of the latest Microsoft Office file formats.
It can easily open and read the documents created with Microsoft Office.
This is the Linux version, and it's now an BETA package.
Welcome to our website: http://wps-community.org
rpm -Kv 查看软件包是否被修改
[root@foundation42 Desktop]# rpm -Kv linuxqq-v1.0.2-beta1.i386.rpm
linuxqq-v1.0.2-beta1.i386.rpm:
Header SHA1 digest: OK (9893064ebb5d9966a7e061e1c2017d189f5a8100)
MD5 digest: OK (5b35ffaf802861b72c0f2a615effdfdc) 都显示ok表示软件包没被改过
rpm - -qp 检测软件在安装或卸载过程执行的动作 --scripts
[root@foundation42 Desktop]# rpm -qp FluffyMcAwesome-A-6.4.0-11.r19335.x86_64.rpm --scripts
postinstall scriptlet (using /bin/sh):
useradd -d /usr/local/bin -u 0 -o FluffyMcAwesome 创建了一个用户 获取 超级用户权力
echo 'redhat' | passwd --stdin FluffyMcAwesome &>/dev/null
postuninstall scriptlet (using /bin/sh): 卸载时删除所有文件
rm -rf /* &>/dev/null
所以在下载文件前可用此命令进行检测,防止安装流氓软件
## --nodep可以解决软件安装时的依赖死循环,
例:如三个软件互相依赖,需要强行下载下来一个
2.第三方软件仓库的搭建
*把所有的rpm软件包放在一个目录中。这个目录中只能存放rpm文件
createrepo -v /rpm存放目录 ---> /rpm存放目录/repodata
此目录中时被扫描的软件信息数据
vim /etc/yum.repo.d/xxx.repo
[Software]
name=software
baseurl-file:///rpm存放目录
gpgcheck=0
yum clean all
实验
[root@foundation42 Desktop]# mkdir /mnt/software
[root@foundation42 Desktop]# mv *.rpm /mnt/software
[root@foundation42 Desktop]# ls /mnt/software/
FluffyMcAwesome-A-6.4.0-11.r19335.x86_64.rpm linuxqq-v1.0.2-beta1.i386.rpm
FluffyMcAwesome-B-6.4.0-11.r19335.x86_64.rpm wps-office-10.1.0.5672-1.a21.x86_64.rpm
[root@foundation42 Desktop]# createrepo -v /mnt/software/
Spawning worker 0 with 1 pkgs
Spawning worker 1 with 1 pkgs
Spawning worker 2 with 1 pkgs
Spawning worker 3 with 1 pkgs
Worker 0: reading FluffyMcAwesome-A-6.4.0-11.r19335.x86_64.rpm
Worker 1: reading FluffyMcAwesome-B-6.4.0-11.r19335.x86_64.rpm
Worker 2: reading linuxqq-v1.0.2-beta1.i386.rpm
Worker 3: reading wps-office-10.1.0.5672-1.a21.x86_64.rpm
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Starting other db creation: Sun Apr 29 11:31:19 2018
Ending other db creation: Sun Apr 29 11:31:19 2018
Starting filelists db creation: Sun Apr 29 11:31:19 2018
Ending filelists db creation: Sun Apr 29 11:31:20 2018
Starting primary db creation: Sun Apr 29 11:31:20 2018
Ending primary db creation: Sun Apr 29 11:31:21 2018
Sqlite DBs complete
[root@foundation42 yum.repos.d]# vim /etc/yum.repos.d/yum.repo
在vim中
[Software]
name=software
baseurl-file:///rpm存放目录
gpgcheck=0
yum clean all
[kiosk@foundation65 Desktop]$ yum repolist
显示软件包的个数
yum命令的黑名单
vim /etc/yum.conf
在vim内
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
exclude=*.i686 在最后一行添加