当前位置:网站首页 > 编程语言 > 正文

yum命令(yum命令是干什么的)



img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上软件测试知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

需要这份系统化的资料的朋友,可以戳这里获取

CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、之后运行yum makecache生成缓存

 

1.配置一个web网站,使用nginx web服务器进行发布
出错提示:
[root@localhost yum.repos.d]# yum install nginx -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile

  • base: mirrors.aliyun.com
  • extras: mirrors.aliyun.com
  • updates: mirrors.aliyun.com
    No package nginx available.
    Error: Nothing to do

方法2
配置1个nginx yum 源文件
vim install_nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key

 

vi nginx.conf

 

yum install -y yum-plugin-priorities

 
 

priority=1

 

mount /dev/cdrom /mnt/

 

mount /dev/cdrom /usr/share/nginx/html
vim /etc/nginx/conf.d/default.conf
增加以下参数
autoindex on; #显示目录
autoindex_exact_size on; #显示文件大小
autoindex_localtime on; #显示时间

 

[yum]
name=CentOS7
baseurl=file:///mnt
enabled=1

 

name=CentOS7 YUM 源显示名称;
baseurl=file:///mnt ISO 镜像挂载目录;
gpgcheck=1 是否检查 GPG-KEY;
enabled=1 是否启用 YUM 源;
gpgkey=file:///mnt/RPM-GPG-KEY-CentOS-7 指定载目录下的 GPG-KEY 文件
验证。

 

mount /dev/cdrom /mnt/

 
 

yum install createrepo* -y
cd /var/www/html
createrepo centos/

 

yum install httpd httpd-devel -y 安装 HTTP WEB 服务;
useradd apache -g apache 创建 apache 用户和组;
systemctl restart httpd.service 重启 HTTPD 服务;
setenforce 0 临时关闭 SeLinux 应用级安全策略;
systemctl stop firewalld.service 停止防火墙;
ps -ef |grep httpd 查看 HTTPD 进程是否启动

 

[base]
name=“CentOS7 HTTP YUM”
baseurl=http://192.168.1.115/centos/
gpgcheck=0
enabled=1
[updates]
name=“CentOS7 HTTP YUM”
baseurl=http://192.168.1.115/centos
gpgcheck=0
enabled=1

 
 

cd /var/www/html/centos/
wget
http://dl.fedoraproject.org/pub/epel/7/x86_64/n/ntfs-3g-2016.2.22-3.el7.x86_6
4.rpm
http://dl.fedoraproject.org/pub/epel/7/x86_64/n/ntfs-3g-devel-2016.2.22-3.el7
.x86_64.rpm

 

createrepo --update centos/

到此这篇yum命令(yum命令是干什么的)的文章就介绍到这了,更多相关内容请继续浏览下面的相关推荐文章,希望大家都能在编程的领域有一番成就!
                            

版权声明


相关文章:

  • 电脑好玩的代码(电脑好玩的代码游戏)2025-04-23 18:36:08
  • ubuntu源码下载(ubuntu 下载源码)2025-04-23 18:36:08
  • 二级域名解析网站是什么(免费二级域名解析系统)2025-04-23 18:36:08
  • linux 怎么安装yum(linux怎么安装yum源)2025-04-23 18:36:08
  • 国内github平替(github中国区排行榜)2025-04-23 18:36:08
  • yum安装配置(yum安装指定版本)2025-04-23 18:36:08
  • 重绘图标怎么才能使用(重绘图标怎么用?)2025-04-23 18:36:08
  • win10启动盘u盘制作(制作win10u盘启动盘的步骤)2025-04-23 18:36:08
  • ubuntu怎么装qt(Ubuntu怎么装输入法)2025-04-23 18:36:08
  • 文件权限(下载安装包需要读写文件权限)2025-04-23 18:36:08
  • 全屏图片