Jenkins保姆教程:一、CentOS 8 安装与卸载

环境配置:

系统:CentOS 8

JAVA:1.8.0        【安装教程

安装

1、配置本地Yum安装源
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

[root@CentOS8 ~]# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
--2021-11-29 16:21:26--  https://pkg.jenkins.io/redhat-stable/jenkins.repo
Resolving pkg.jenkins.io (pkg.jenkins.io)... 151.101.110.133, 2a04:4e42:11::645
Connecting to pkg.jenkins.io (pkg.jenkins.io)|151.101.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 85
Saving to: ‘/etc/yum.repos.d/jenkins.repo’

/etc/yum.repos.d/jenkins 100%[================================>]      85  --.-KB/s    in 0s      

2021-11-29 16:21:28 (7.73 MB/s) - ‘/etc/yum.repos.d/jenkins.repo’ saved [85/85]


2、导入秘钥
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

[root@CentOS8 ~]# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

3、安装
yum install jenkins

[root@CentOS8 ~]# yum install jenkins
Repository epel is listed more than once in the configuration
Jenkins-stable                                                                  8.7 kB/s |  21 kB     00:02    
Dependencies resolved.
================================================================================================================
 Package                    Architecture            Version                      Repository                Size
================================================================================================================
Installing:
 jenkins                    noarch                  2.303.3-1.1                  jenkins                   69 M
Installing dependencies:
 daemonize                  x86_64                  1.7.8-1.el8                  epel                      27 k

Transaction Summary
================================================================================================================
Install  2 Packages

Total download size: 69 M
Installed size: 69 M

4、查看安装目录
rpm -ql jenkins

[root@CentOS8 ~]# rpm -ql jenkins
/etc/init.d/jenkins
/etc/logrotate.d/jenkins
/etc/sysconfig/jenkins
/usr/lib/jenkins
/usr/lib/jenkins/jenkins.war
/usr/sbin/rcjenkins
/var/cache/jenkins
/var/lib/jenkins
/var/log/jenkins

5、启动jenkins服务并设置开机启动
systemctl start jenkins
systemctl enable jenkins

[root@CentOS8 ~]# systemctl start jenkins

[root@CentOS8 ~]# systemctl enable jenkins
jenkins.service is not a native service, redirecting to systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable jenkins

卸载

# 停止jenkins服务
[root@CentOS8 ~]# systemctl stop jenkins

# 停止jenkins开机启动服务
[root@CentOS8 ~]# systemctl disable jenkins

# yum卸载jenkins
[root@CentOS8 ~]# yum -y remove jenkins

# 删除jenkins相关文件
[root@CentOS8 ~]# rm -rf /var/{lib,log,cache}/jenkins /usr/lib/jenkins /root/.jenkins
[root@CentOS8 ~]# rm -rf `sudo find /{etc,var,run} -name "jenkins*"`

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值