说说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

相关推荐

  • 我来说说如何在Linux中使用nl命令(linux nl命令)。

    什么是nl命令? nl命令(netstat)是一个用于显示网络连接、路由表和网络接口统计信息的实用工具,它可以帮助我们诊断网络问题,监控系统资源使用情况等,在Linux系统中,nl命令通常与-p选项一起使用,以便在输出中显…

    2024年7月3日
    00
  • 教你yum安装命令出错。

    yum是Linux系统中常用的软件包管理器,它可以帮助用户快速安装、更新、卸载软件,本文将详细介绍yum的安装命令及其使用方法。 我们需要了解yum的基本概念,yum是Yellowdog Updater Modified的缩写,它是在RPM(Red H…

    2024年6月20日
    00
  • 我来说说linux -type。

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

    2024年7月15日
    00
  • 分享centos新建用户命令。

    在CentOS系统中,我们可以通过命令行工具来创建新的用户,以下是详细的步骤: 1. 我们需要使用root权限登录到我们的CentOS系统,这通常意味着我们需要在终端中输入`su -`然后按回车键,接着输入root用户的密码。 2.…

    2024年6月16日
    00
  • 说说centos7创建文件的命令。

    在CentOS 7中创建文件,可以使用`touch`命令,`touch`命令用于创建空文件或者更新文件的访问和修改时间,如果要创建一个新文件并指定文件名,只需在终端中输入`touch 文件名`,然后按回车键即可,要创建一个名为`exa…

    2024年6月18日
    00
  • 我来分享linux中vi怎么编辑和保存文件。

    使用vi编辑器编辑和保存文件 (图片来源网络,侵删) 在Linux中,vi是一种非常流行的文本编辑器,它提供了强大的功能以进行文本编辑,虽然它的学习曲线可能略显陡峭,但一旦掌握,你将发现它在处理各种文本编辑任务…

    2024年7月19日
    00
  • 小编教你有哪些提高生产效率的bash命令。

    在Linux系统中,bash命令是一种强大的工具,可以帮助我们提高生产效率,以下是一些常用的bash命令,可以帮助我们提高生产效率: 1、文件和目录操作 ls:列出目录内容 cd:更改当前目录 pwd:显示当前工作目录 mkdir…

    2024年7月4日
    01
  • 常用的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日
    02

联系我们

QQ:951076433

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