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

相关推荐

  • 分享centos新建用户命令。

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

    2024年6月16日
    01
  • 我来说说SUSE系统支持哪些软件包管理工具。

    SUSE(Software und SystemEntwicklung GmbH)是一个德国的开源软件公司,它提供了一种基于Linux的操作系统,称为SUSE Linux Enterprise Server(SLES),SUSE系统支持多种软件包管理工具,这些工具可以方便地安装…

    2024年6月28日
    02
  • 经验分享阿里云yum。

    阿里云YUM是一种基于Linux系统的软件包管理器,它可以帮助用户方便地安装、更新和管理软件包,本文将详细介绍阿里云YUM的使用方法和特点,以及如何解决在使用过程中可能遇到的问题。 一、阿里云YUM简介 阿里云YUM(A…

    2024年6月20日
    03
  • 小编教你linux中的grep命令的作用。

    grep命令是Linux系统中的一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。 Linux中grep命令有什么用 在Linux操作系统中,grep是一个非常强大的文本搜索工具,它可以在一个或多个文件中…

    2024年7月5日
    00
  • 教你rhel配置yum源。

    在RHEL系统中如何使用CentOS的yum源 在Red Hat Enterprise Linux (RHEL)系统中,我们可以使用CentOS的yum源来安装和更新软件包,这样做的好处是,CentOS的yum源通常比RHEL的yum源更新得更快,因此我们可以更快地获…

    2024年7月3日
    06
  • 常用的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
  • 聊聊linux中怎么找到系统里的重复文件并快速释放磁盘空间。

    您可以使用以下命令来找到系统里的重复文件并快速释放磁盘空间:,,- 使用 diff 命令比较文件,找到相同的文件。diff index.html backup.html,- 使用 du 命令查找大文件。du -a | sort -n -r | head -n 10,- 使…

    2024年7月13日
    05
  • 关于linux cp 隐藏文件。

    您可以使用以下命令将隐藏文件复制到另一个目录中:,,“,cp -r /path/to/source/* /path/to/destination/,`,,/path/to/source/ 是源目录的路径,/path/to/destination/` 是目标目录的路径。这个命令会将…

    2024年7月13日
    03

联系我们

QQ:951076433

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