=Start=
缘由:
给CentOS上的某一package打了一个patch,并用rpmbuild命令生成了一个RPM包,希望进行本地安装、测试。
在安装的时候遇到了一些问题,在此记录一下,方便以后参考。
正文:
1.如果一个同名&同版本号的package已经安装了,可以使用下面的命令强制安装:
# rpm -ivh --replacepkgs package-4.2-34.el6.x86_64.rpm
2.如果你需要安装一个版本号较老的package,需要使用下面的命令:
- https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-rpm-using.html
- http://www.rpm.org/max-rpm/ch-rpm-upgrade.html
# rpm -Uvh --oldpackage package-4.2-34.el6.x86_64.rpm
3.其实还可以使用 yum 命令来安装RPM包(就不需要记录上面rpm命令的几个选项了)
# yum localinstall package-4.2-34.el6.x86_64.rpm
=END=
《 “在CentOS上如何强制升级某一package” 》 有 8 条评论
`rpm -ivh –nodeps –force package-4.2-34.el6.x86_64.rpm`
怎样在 CentOS 里下载 RPM 包及其所有依赖包
`
yum install yum-plugin-downloadonly
yum install –downloadonly $package-name
yum install –downloadonly –downloaddir=$directory $package-name
yum install –downloadonly –downloaddir=/root/mypackages/ httpd
yum install –downloadonly –downloaddir=/root/mypackages/ httpd-2.2.6-40.el7
`
参考链接:
https://linux.cn/article-7937-1.html
CentOS 上最佳的第三方仓库
https://linux.cn/article-8509-1.html
https://www.linux.com/learn/intro-to-linux/2017/2/best-third-party-repositories-centos
Linux下如何查看系统上的某个package是在什么时候安装的?
`
$ grep “package_name” /var/log/yum.log
$ rpm -qi “package_name”
$ rpm -qa –last | grep “package_name”
`
https://superuser.com/questions/147857/how-to-view-history-of-yum-commands-update-install-remove/356070
https://unix.stackexchange.com/questions/2291/centos-list-the-installed-rpms-by-date-of-installation-update
http://sharadchhetri.com/2014/03/28/how-to-find-installation-date-and-time-of-rpm-package/
https://access.redhat.com/solutions/10185
https://www.cyberciti.biz/faq/yum-update-except-kernel-package-command/
https://unix.stackexchange.com/questions/75981/yum-check-available-package-updates
https://www.centos.org/docs/5/html/yum/sn-searching-packages.html
`
# 用 yum 检查可用的更新包
$ sudo yum list available java\*
# 用 yum 根据条件进行搜索
$ sudo yum search PalmPilot
$ sudo yum provides libneon
$ sudo yum list tsc\*
`
在CentOS/RHEL上如何使用rpm/yum命令降级/回滚更新?
https://www.cyberciti.biz/faq/howto-yum-downgrade-packages-on-rhel-centos-fedora-scientific-linux/
https://unix.stackexchange.com/questions/151689/how-can-i-instruct-yum-to-install-a-specific-version-of-package-x
https://unix.stackexchange.com/questions/152457/is-there-an-all-in-one-command-for-rpm-to-downgrade-a-package-to-an-older-versio
`
方法一:Using RPM
$ rpm -Uvh –oldpackage pkg1.rpm pkg2.rpm
方法二:Using YUM + downgrade
$ yum downgrade /path/pkg1.rpm /path/pkg2.rpm
方法三:Using YUM + history undo
$ sudo yum history
$ sudo yum history undo {NUMBER-HERE}
`
centos 7 yum安装、卸载、升级软件等命令
http://xiaohost.com/1860.html
`
yum update 升级系统
yum install ~ 安装指定软件包
yum update ~ 升级指定软件包
yum remove ~ 卸载指定软件
yum grouplist 查看系统中已经安装的和可用的软件组,可用的可以安装
yum grooupinstall ~安装上一个命令显示的可用的软件组中的一个
yum grooupupdate ~更新指定软件组的软件包
yum grooupremove ~ 卸载指定软件组中的软件包
yum deplist ~ 查询指定软件包的依赖关系
yum list yum\* 列出所有以yum开头的软件包
yum localinstall ~ 从硬盘安装rpm包并使用yum解决依赖
yum provides~ 列出软件包提供哪些文件
`
centos升级glibc(升级到 2.17版)
http://www.dzhope.com/post/1163/
http://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz
`
[root@localhost do_test]# tar -xf glibc-2.17.tar.gz
[root@localhost do_test]# cd glibc-2.17
[root@localhost glibc-2.17]# mkdir build; cd build
[root@localhost build]# ../configure –prefix=/usr –disable-profile –enable-add-ons –with-headers=/usr/include –with-binutils=/usr/bin
[root@localhost build]# make -j 8
[root@localhost build]# make install
[root@localhost do_test]# strings /lib64/libc.so.6 | grep GLIBC
`