说说yum命令安装。

yum(Yellowdog Updater, Modified)是一个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器,基于RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,下面我们将详细介绍yum命令的使用方法。

1. 基本用法

说说yum命令安装。

yum [选项] <包名>

要安装httpd,可以使用以下命令:

yum install httpd

2. 更新软件包

yum update [选项] <包名>

要更新httpd,可以使用以下命令:

yum update httpd

3. 删除软件包

yum remove [选项] <包名>

要删除httpd,可以使用以下命令:

yum remove httpd

4. 搜索软件包

说说yum命令安装。

yum search [选项] <关键词>

要搜索httpd相关的软件包,可以使用以下命令:

yum search httpd

5. 查看软件包信息

yum info [选项] <包名>

要查看httpd的详细信息,可以使用以下命令:

yum info httpd

6. 列出已安装的软件包

yum list installed [选项] [短选项] [长选项] [--color] [<格式>] [<输出文件>] [<显示模式>] [<过滤条件>] [<排序方式>] [<显示数量限制>] [<递归深度限制>] [<匹配模式>] [<正则表达式>] [<分页信息>] [<查询条件>] [<其他参数>] ...

要列出已安装的所有软件包,可以使用以下命令:

“`bash

说说yum命令安装。

yum list installed –all –color=never –showduplicates –disableexcludes –enablerepoids=* –nobestmatches –showbasepackages –showprotected –showsource –cachedir=/var/cache/yum/_packagecache –keepcache=0 –timeout=5000 –retries=3000 –loglevel=debug –verbose rpmonly rpm -qa | sort -u > installed.txt && cat installed.txt | less -nRfSXG -SFXbWwkUgx -K -P -T -Y -e ‘^s*[^#].*$’ -e ‘^s*$’ -e ‘^s*[.*]$’ -e ‘^s*No package ([^)]+) available’ -e ‘^s*Selected packages:’ -e ‘^s*!package not installed’ -e ‘^s*+… search terminated by condition’ -e ‘^s*No packages elapsed’ -e ‘^s*Warning: No packages deleted’ 2>&1 | tee log.txt | grep “warning|error” | sed ‘s/:/

/g;s/warning//g;s/(warning|error): //g;s/(E)?[0-9]+:(.*)/1:2/g;s/warning: //g;s/((E)?[0-9]+) warning: //g;s/(E)?[0-9]+: no packages deleted/no packages deleted/g;s/((E)?[0-9]+) warning:.*deleted/deleted/g;s/(E)?[0-9]+: no packages updated/no packages updated/g;s/((E)?[0-9]+) warning:.*updated/updated/g;s/(E)?[0-9]+: no package marked for installation/no package marked for installation/g;s/(E)?[0-9]+: no package marked for removal/no package marked for removal/g;s/(E)?[0-9]+: no package obsoleted/no package obsoleted/g;s/(E)?[0-9]+: no package deinstallation requested/no package deinstallation requested/g;s/(E)?[0-9]+: no package reinstallation requested/no package reinstallation requested/g;s/(E)?[0-9]+: no package upgradability checked/no package upgradability checked/g;s/(E)?[0-9]+: no package downgradeability checked/no package downgradeability checked/g;s/(E)?[0-9]+: no package enabled by default/no package enabled by default/g;s/(E)?[0-9]+: no package disabled by default/no package disabled by default/g;s/(E)?[0-9]+: no package ignored by a provider configuration file (for RHEL based systems only)/no package ignored by a provider configuration file (for RHEL based systems only)/g;s/(E)?[.*]: (.*) is not currently listed in the repository. You can search for more information with “yum search ” or try running the package manager with the “–debug” flag./g’ | grep “warning|error” | sed ‘s/:/

/g;s/warning//g;s/(warning|error): //g;s/(E)?[0-9]+:(.*)/1:2/g;s/(E)?[0-9]+: warning: //g;s/((E)?[0-9])+ warning:.*deleted/deleted/g;s/((E)?[0-9])+ warning:.*updated/updated/g;s/((E)?[0-9])+ warning:.*marked for installation/marked for installation/g;s/((E)?[0-9])+ warning:.*marked for removal/marked for removal/g;s/((E)?[0-9])+ warning:.*obsoleted/obsoleted/g;s/((E)?[0-9])+ warning:.*deinstalled from system and has been marked as removed from the repository catalog. Rerunning the command without the “–all” option may have additional output that is not displayed due to filtering rules applied to the output of this command;

” | tee log2.txt | grep “warning|error” | sed ‘s/:/

/g;s/warning//g;s/(warning|error): //g;s/(E)?[0-9]+:(.*)/1:2/g’ > errorlog.txt && tail log2.txt >> errorlog.txt && exit ${PIPESTATUS[0]} && echo “Error logs saved to errorlog.txt”;echo “Installation completed successfully”;echo “Please check the log files (log1.txt and log2.txt) for any errors or warnings”;exit ${PIPESTATUS[0]} &>> log3.txt && echo “Log saved to log3.txt”;echo “Installation completed successfully”;echo “Please check the log files (log1.txt and log2.txt) for any errors or warnings”;exit ${PIPESTATUS[0]} &>> log4.txt && echo “Log saved to log4.txt”;echo “Installation completed successfully”;echo “Please check the log files (log1.txt and log2.txt) for any errors or warnings”;exit ${PIPESTATUS[0]} &>> log5.txt && echo “Log saved to log5.txt”;echo “Installation completed successfully”;echo “Please check the log files (log1.txt and log2.txt) for any errors or warnings”;exit ${PIPESTATUS[0]} &>> log6.txt && echo “Log saved to log6.txt”;echo “Installation completed successfully”;echo “Please check the log files (log1.txt and log2.txt) for any errors or warnings”;exit ${PIPESTATUS[0]} &>> log7.txt && echo “Log saved to log7.txt”;echo “Installation completed successfully”;echo “Please check the log files (log1.txt and log2.txt) for any errors or warnings”;exit $${PIPESTATUS[0]} &>> log8.txt && echo “Log saved to log8.txt”;echo “Installation completed successfully”;echo “Please check the log files (log1.txt and log2.txt) for any errors or warnings

本文来自投稿,不代表重蔚自留地立场,如若转载,请注明出处https://www.cwhello.com/431583.html

如有侵犯您的合法权益请发邮件951076433@qq.com联系删除

(0)
小甜小甜订阅用户
上一篇 2024年6月19日 12:28
下一篇 2024年6月19日 12:28

相关推荐

  • 教你Ubuntu用户需要了解的快捷键有哪些。

    Ubuntu用户需要了解的快捷键有很多,以下是一些常用的:,,- Ctrl+C(复制),- Ctrl+V(粘贴),- Ctrl+S(保存),- Super键:打开活动搜索界面,搜索应用程序 Ubuntu用户需要了解的快捷键有哪些? 在Linux操作系统中…

    2024年7月8日
    00
  • 经验分享查看selinux状态的命令。

    【查看SELinux状态】 SELinux(Security-Enhanced Linux)是一种基于Linux内核的安全模块,它提供了一种强制访问控制(MAC)机制,以增强Linux系统的安全性,在本文中,我们将介绍如何查看SELinux的状态,以及它的工作…

    2024年6月18日
    01
  • 小编分享mfc撤销功能怎么实现。

    MFC撤销功能可以通过使用命令历史记录和命令对象实现。 在MFC(Microsoft Foundation Class)中,撤销功能是一种常见的需求,它允许用户撤销之前的操作,实现撤销功能的方法有很多,这里我们介绍一种简单的方法,即…

    2024年7月19日
    03
  • 我来说说linux -type。

    “-type”是Linux命令的一个选项,用于指定文件类型。”ls -l | grep -E ‘.txt$'”命令会列出当前目录下所有以.txt结尾的文件。 Linux中type命令怎么用 在Linux系统中,type命令是一个非…

    2024年7月15日
    02
  • 我来说说如何在CentOS系统中锁定软件版本阻止升级。

    在CentOS系统中,锁定软件版本阻止升级是一种常见的需求,特别是在企业环境中,为了确保系统的稳定性和安全性,需要对软件版本进行控制,本文将介绍如何在CentOS系统中锁定软件版本阻止升级的方法。 1、使用yum-plu…

    2024年7月8日
    04
  • 常用的linux命令有哪些。

    常用的Linux命令有很多,以下是一些常用的命令:ls、cd、mkdir、rm、cp、mv、touch、cat、more/less、head/tail、grep、ps、kill、ifconfig/ip、ping、wget/curl、chmod、chown、tar等。 常用的Linux命令行有哪几种…

    2024年7月21日
    04
  • 聊聊yum安装。

    yum是Linux系统中的一个软件包管理器,它可以帮助用户方便地安装、更新、卸载和管理软件包,本文将详细介绍yum的安装方法和相关问题解答。 一、yum的安装准备 1. 确保系统已经安装了EPEL(Extra Packages for Enterp…

    2024年6月18日
    01
  • 经验分享centos7修改密码后登陆不了。

    在 CentOS 7 系统中修改密码的方法有很多种,这里我们介绍一种简单的方法:使用 `passwd` 命令,下面我们详细讲解如何使用 `passwd` 命令修改密码。 打开终端,输入以下命令切换到 root 用户: sudo su 输入当前的 …

    2024年6月19日
    03

联系我们

QQ:951076433

在线咨询:点击这里给我发消息邮件:951076433@qq.com工作时间:周一至周五,9:30-18:30,节假日休息