当前位置: 首页 > wzjs >正文

站长统计芭乐鸭脖小猪公司网站百度地图

站长统计芭乐鸭脖小猪,公司网站百度地图,上海网页制作公司,wordpress怎么防止攻击说明:在Linux操作系统中,yum是一款包管理工具。通常,如果想要在Linux操作系统中安装一个软件,要先搞到应用的源代码,再在操作系统里使用命令编译安装,很不方便,而使用yum只需要一行命令就可以搞…

说明:在Linux操作系统中,yum是一款包管理工具。通常,如果想要在Linux操作系统中安装一个软件,要先搞到应用的源代码,再在操作系统里使用命令编译安装,很不方便,而使用yum只需要一行命令就可以搞定,并且后续启动应用也很方便。

本文介绍一些常用的yum命令

which yum:查看当前系统是否有yum

敲下面的命令,查看当前Linux操作系统是否有yum工具,如下:

which yum

如下,说明系统中存在yum命令,也就是安装了yum工具

在这里插入图片描述

yum --version:查看当前yum工具的版本信息

yum --version

如下:

在这里插入图片描述

yum --help:查看yum命令列表

yum --help

如下:

在这里插入图片描述

yum list installed:列出已安装的应用

yum list installed

如下:

在这里插入图片描述

当然,如果你想知道是否已安装了某个应用,追加grep <应用名>命令即可,如下,查看是否已安装nginx

yum list installed | grep nginx

这里我遇到了下面这个问题,

Loaded plugins: langpacks
base                                                                                                                                                                        | 3.6 kB  00:00:00     
Could not retrieve mirrorlist http://mirrorlist.centos.org?arch=x86_64&release=7&repo=sclo-rh error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Name or service not known"One of the configured repositories failed (Unknown),and yum doesn't have enough cached data to continue. At this point the onlysafe thing yum can do is fail. There are a few ways to work "fix" this:1. Contact the upstream for the repository and get them to fix the problem.2. Reconfigure the baseurl/etc. for the repository, to point to a workingupstream. This is most often useful if you are using a newerdistribution release than is supported by the repository (and thepackages for the previous distribution release still work).3. Run the command with the repository temporarily disabledyum --disablerepo=<repoid> ...4. Disable the repository permanently, so yum won't use it by default. Yumwill then just ignore the repository until you permanently enable itagain or use --enablerepo for temporary usage:yum-config-manager --disable <repoid>orsubscription-manager repos --disable=<repoid>5. Configure the failing repository to be skipped, if it is unavailable.Note that yum will try to contact the repo. when it runs most commands,so will have to try and fail each time (and thus. yum will be be muchslower). If it is a very temporary problem though, this is often a nicecompromise:yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=trueCannot find a valid baseurl for repo: centos-sclo-rh/x86_64

好像是centos的镜像地址无效,找不到了

在这里插入图片描述

参考下面这篇文章解决了

  • https://blog.csdn.net/Jahn_W/article/details/141608091

敲下面这些命令,更换成阿里云的镜像地址

mv /etc/yum.repos.d /etc/yum.repos.d-bak
mkdir /etc/yum.repos.d
cd /etc/yum.repos.d
wget http://mirrors.aliyun.com/repo/Centos-7.repo

如下:

在这里插入图片描述

yum install <应用名>:使用yum安装某应用

yum install httpd

如下,安装httpd应用

在这里插入图片描述

安装有些应用,中间会有个询问,可在安装命令后追加 -y,表示有询问时,自动选择yes继续安装,如下:

yum install httpd -y

另外,如果需要一次安装多个应用,可在后面追加多个应用名,用空格间隔,如下,表示安装httpd、nginx

yum install httpd nginx

yum update <应用名>:更新某应用

yum update httpd

如下,更新httpd应用

在这里插入图片描述

如果后面不指定某应用,表示更新所有已安装的应用,如下:

yum update

可能要更新好一会儿,另外还会消耗不少流量(如果你的云服务器是按量收费的,不能不精打细算),最重要的是,一次性更新所有应用可能会出现稀奇古怪的错误(继续看),不建议使用此命令。

在这里插入图片描述

yum info <应用名>:查看某应用的信息

yum info httpd

如下,查看httpd应用包的信息(忽略上面几行的错误信息,是因为上面更新了所有应用包导致的)

在这里插入图片描述

yum remove <应用名>:移除某应用

yum remove httpd

如下,移除httpd应用

在这里插入图片描述

yum clear:更新镜像应用源缓存:

yum clear

如下:

在这里插入图片描述

启动应用

使用yum安装的应用,可以使用systemctl命令启动(start)、重启(restart)、停止(stop)、查看(status),非常方便,如下:

(启动httpd应用)

systemctl start httpd

(查看httpd应用状态)

systemctl status httpd

在这里插入图片描述

使用浏览器,输入主机IP地址,查看应用情况,如下,说明应用已可用

在这里插入图片描述


(停止httpd服务)

systemctl stop httpd

在这里插入图片描述

总结

本文介绍了包管理工具yum的使用以及使用中的问题

http://www.dtcms.com/wzjs/579585.html

相关文章:

  • dw网站首页的导航怎么做wordpress 登录代码
  • 花桥网站制作做搜狗手机网站优化排
  • 提升网站权重的策略光谷企业网站建设
  • 深圳求做网站苏宁易购网站建设建议
  • 抚顺网站建设技术员招聘淘客网站怎么备案
  • 微信浏览为网站的缓存怎么清理响应式网站建设市场
  • 如何用jsp做网站ip或域名查询网
  • 建设一个返利网站网站建设与管理清考作业
  • 南昌网站关键词优化wordpress 客户端 出错
  • 上饶便宜的做网站公司室内设计师培训装潢设计培训
  • 如何查询网站哪个公司做的杭州网站设计首选柚米
  • 织梦cms官方网站网站制作详细教程
  • 厚街东莞网站建设抚州网络推广
  • 域名跳转wordpresswordpress的seo收件箱
  • 用python开发网站网络舆情监控
  • 保定网站制作软件网络工程师网课
  • 网站建设与组织管理南宁网站建设工具
  • 二手书网站建设策划书开发者模式伤手机吗
  • 网站的建设费用分为网站开发的前端技术有哪些
  • 沙井网站优化wordpress设置静态内容缓存时间
  • 免费的行情软件网站不下载怎么快速建网站教程
  • 网站制作价目表公司网站文化活动备案
  • 旅游网站哪家好又便宜网站seo策划方案
  • 公司网站建设技术wordpress缓存文件
  • 门户网站建设背景南宁logo设计公司
  • wordpress主题 外贸网站模板下载湖南建设厅官方网站
  • wordpress网站嵌入音乐设计网页
  • 绥化北京网站建设宁波网站建设联系荣胜
  • 网店美工的意义与发展南城网站优化公司
  • 网站后台编程语言设计作品网站