草庐IT

CentOS 7上安装 Jenkins 2.227 -- yum 方式

VipSoft 2023-03-28 原文

CentOS 7上安装 Jenkins 2.227 -- yum 方式
装插件的时候会报版本过低,建议安装 2.346

安装 Jenkins

# 
[root@localhost ~]# ll /etc/yum.repos.d/
总用量 40
-rw-r--r--. 1 root root 1664 4月   8 2020 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 4月   8 2020 CentOS-CR.repo
-rw-r--r--. 1 root root  649 4月   8 2020 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  314 4月   8 2020 CentOS-fasttrack.repo
-rw-r--r--. 1 root root  630 4月   8 2020 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 4月   8 2020 CentOS-Sources.repo
-rw-r--r--. 1 root root 7577 4月   8 2020 CentOS-Vault.repo
-rw-r--r--. 1 root root  616 4月   8 2020 CentOS-x86_64-kernel.repo
-rw-r--r--. 1 root root 2081 3月   9 2022 docker-ce.repo
[root@localhost ~]# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo
--2022-10-20 17:40:31--  https://pkg.jenkins.io/redhat/jenkins.repo
正在解析主机 pkg.jenkins.io (pkg.jenkins.io)... 151.101.110.133, 2a04:4e42:1a::645
正在连接 pkg.jenkins.io (pkg.jenkins.io)|151.101.110.133|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:71
正在保存至: “/etc/yum.repos.d/jenkins.repo”
100%[==========================================>] 71          --.-K/s 用时 0s      
2022-10-20 17:40:33 (1.56 MB/s) - 已保存 “/etc/yum.repos.d/jenkins.repo” [71/71])
 
# 添加成功后,查看
[root@localhost ~]# ll /etc/yum.repos.d/
总用量 48
-rw-r--r--. 1 root root 1664 11月 23 2020 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 11月 23 2020 CentOS-CR.repo
-rw-r--r--. 1 root root  649 11月 23 2020 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  314 11月 23 2020 CentOS-fasttrack.repo
-rw-r--r--. 1 root root  630 11月 23 2020 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 11月 23 2020 CentOS-Sources.repo
-rw-r--r--. 1 root root 8515 11月 23 2020 CentOS-Vault.repo
-rw-r--r--. 1 root root  616 11月 23 2020 CentOS-x86_64-kernel.repo
-rw-r--r--. 1 root root 2081 3月   9 2022 docker-ce.repo
-rw-r--r--. 1 root root   71 11月 30 2016 jenkins.repo
# 导入公钥
[root@localhost ~]# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
# yum 可以更新一下,
[root@localhost ~]# yum upgrade
# 安装 Jenkins 要加 --nogpgcheck 否则会报 jenkins-2.249.1-1.1.noarch.rpm 的公钥尚未安装
[root@localhost ~]# yum install jenkins-2.227 --nogpgcheck
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 jenkins.noarch.0.2.227-1.1 将被 安装
--> 解决依赖关系完成

依赖关系解决

============================================================================================================
 Package                    架构                      版本                           源                大小
============================================================================================================
正在安装:
 jenkins                    noarch                    2.227-1.1                      jenkins          63 M

事务概要
============================================================================================================
安装  1 软件包

总计:63 M
安装大小:63 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告:RPM 数据库已被非 yum 程序修改。
  正在安装    : jenkins-2.227-1.1.noarch    1/1 
  验证中      : jenkins-2.227-1.1.noarch    1/1 

已安装:
  jenkins.noarch 0:2.227-1.1 
完毕!
# 查看软件包文件
[root@localhost ~]# rpm -ql jenkins
/etc/init.d/jenkins
/etc/logrotate.d/jenkins
/etc/sysconfig/jenkins  # Jenkins 配置文件
/usr/bin/jenkins
/usr/lib/systemd/system/jenkins.service
/usr/sbin/rcjenkins
/usr/share/java/jenkins.war
/usr/share/jenkins
/usr/share/jenkins/migrate
/var/cache/jenkins
/var/lib/jenkins
/var/log/jenkins
[root@localhost ~]# 

# 修改配置,jenkins安装成功后,默认的用户是jenkins,端口是8080,为了防止冲突,并且给用户赋权限,我们修改用户名和端口。
# 进到 VI 后 输入 /PORT 可以快速定位到 PORT 处,修改默认端口
[root@localhost ~]# vi /etc/sysconfig/jenkins
JENKINS_USER="root"  #将用户改成 root 如果不改,启动时可能会报文件访问权限问题
JENKINS_PORT="8888"  #修改默认端口

# 添加自启动
[root@localhost ~]# systemctl enable jenkins
Created symlink from /etc/systemd/system/multi-user.target.wants/jenkins.service to /usr/lib/systemd/system/jenkins.service.
[root@localhost ~]# systemctl start jenkins
# 查看服务状态
[root@localhost ~]# systemctl status jenkins
● jenkins.service - LSB: Jenkins Automation Server
   Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
   Active: active (running) since 四 2022-10-20 18:53:28 CST; 23s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 44903 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=0/SUCCESS)
 Main PID: 44248 (code=exited, status=1/FAILURE)
    Tasks: 41
   Memory: 943.0M
   CGroup: /system.slice/jenkins.service
           └─44933 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -DJENKINS_HOME...

10月 20 18:53:26 localhost.localdomain systemd[1]: Starting LSB: Jenkins Automation Server...
10月 20 18:53:26 localhost.localdomain runuser[44909]: pam_unix(runuser:session): session opened for user root...d=0)
10月 20 18:53:28 localhost.localdomain jenkins[44903]: Starting Jenkins [  确定  ]
10月 20 18:53:28 localhost.localdomain systemd[1]: Started LSB: Jenkins Automation Server.
Hint: Some lines were ellipsized, use -l to show in full.
# 查看密码
[root@localhost ~]# cat /var/lib/jenkins/secrets/initialAdminPassword
d63a3493daee4a1645d7a105a0d24b5
[root@localhost ~]# 

卸载 Jenkins

# 卸载jenkins服务
[root@localhost ~]# rpm -e jenkins
警告:/etc/sysconfig/jenkins 已另存为 /etc/sysconfig/jenkins.rpmsave
# 检查是否卸载成功
[root@localhost ~]# rpm -ql jenkins
未安装软件包 jenkins 
[root@localhost ~]# 

有关CentOS 7上安装 Jenkins 2.227 -- yum 方式的更多相关文章

  1. ruby - 在 64 位 Snow Leopard 上使用 rvm、postgres 9.0、ruby 1.9.2-p136 安装 pg gem 时出现问题 - 2

    我想为Heroku构建一个Rails3应用程序。他们使用Postgres作为他们的数据库,所以我通过MacPorts安装了postgres9.0。现在我需要一个postgresgem并且共识是出于性能原因你想要pggem。但是我对我得到的错误感到非常困惑当我尝试在rvm下通过geminstall安装pg时。我已经非常明确地指定了所有postgres目录的位置可以找到但仍然无法完成安装:$envARCHFLAGS='-archx86_64'geminstallpg--\--with-pg-config=/opt/local/var/db/postgresql90/defaultdb/po

  2. ruby - 如何以所有可能的方式将字符串拆分为长度最多为 3 的连续子字符串? - 2

    我试图获取一个长度在1到10之间的字符串,并输出将字符串分解为大小为1、2或3的连续子字符串的所有可能方式。例如:输入:123456将整数分割成单个字符,然后继续查找组合。该代码将返回以下所有数组。[1,2,3,4,5,6][12,3,4,5,6][1,23,4,5,6][1,2,34,5,6][1,2,3,45,6][1,2,3,4,56][12,34,5,6][12,3,45,6][12,3,4,56][1,23,45,6][1,2,34,56][1,23,4,56][12,34,56][123,4,5,6][1,234,5,6][1,2,345,6][1,2,3,456][123

  3. ruby - 解析 RDFa、微数据等的最佳方式是什么,使用统一的模式/词汇(例如 schema.org)存储和显示信息 - 2

    我主要使用Ruby来执行此操作,但到目前为止我的攻击计划如下:使用gemsrdf、rdf-rdfa和rdf-microdata或mida来解析给定任何URI的数据。我认为最好映射到像schema.org这样的统一模式,例如使用这个yaml文件,它试图描述数据词汇表和opengraph到schema.org之间的转换:#SchemaXtoschema.orgconversion#data-vocabularyDV:name:namestreet-address:streetAddressregion:addressRegionlocality:addressLocalityphoto:i

  4. ruby - 完全离线安装RVM - 2

    我打算为ruby​​脚本创建一个安装程序,但我希望能够确保机器安装了RVM。有没有一种方法可以完全离线安装RVM并且不引人注目(通过不引人注目,就像创建一个可以做所有事情的脚本而不是要求用户向他们的bash_profile或bashrc添加一些东西)我不是要脚本本身,只是一个关于如何走这条路的快速指针(如果可能的话)。我们还研究了这个很有帮助的问题:RVM-isthereawayforsimpleofflineinstall?但有点误导,因为答案只向我们展示了如何离线在RVM中安装ruby。我们需要能够离线安装RVM本身,并查看脚本https://raw.github.com/wayn

  5. ruby-on-rails - rails 目前在重启后没有安装 - 2

    我有一个奇怪的问题:我在rvm上安装了ruby​​onrails。一切正常,我可以创建项目。但是在我输入“railsnew”时重新启动后,我有“程序'rails'当前未安装。”。SystemUbuntu12.04ruby-v"1.9.3p194"gemlistactionmailer(3.2.5)actionpack(3.2.5)activemodel(3.2.5)activerecord(3.2.5)activeresource(3.2.5)activesupport(3.2.5)arel(3.0.2)builder(3.0.0)bundler(1.1.4)coffee-rails(

  6. ruby - 如何为 emacs 安装 ruby​​-mode - 2

    我刚刚为fedora安装了emacs。我想用emacs编写ruby。为ruby​​提供代码提示、代码完成类型功能所需的工具、扩展是什么? 最佳答案 ruby-mode已经包含在Emacs23之后的版本中。不过,它也可以通过ELPA获得。您可能感兴趣的其他一些事情是集成RVM、feature-mode(Cucumber)、rspec-mode、ruby-electric、inf-ruby、rinari(用于Rails)等。这是我当前用于Ruby开发的Emacs配置:https://github.com/citizen428/emacs

  7. ruby-on-rails - 无法在centos上安装therubyracer(V8和GCC出错) - 2

    我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e

  8. ruby - 通过 RVM (OSX Mountain Lion) 安装 Ruby 2.0.0-p247 时遇到问题 - 2

    我的最终目标是安装当前版本的RubyonRails。我在OSXMountainLion上运行。到目前为止,这是我的过程:已安装的RVM$\curl-Lhttps://get.rvm.io|bash-sstable检查已知(我假设已批准)安装$rvmlistknown我看到当前的稳定版本可用[ruby-]2.0.0[-p247]输入命令安装$rvminstall2.0.0-p247注意:我也试过这些安装命令$rvminstallruby-2.0.0-p247$rvminstallruby=2.0.0-p247我很快就无处可去了。结果:$rvminstall2.0.0-p247Search

  9. ruby - 如何在 Lion 上安装 Xcode 4.6,需要用 RVM 升级 ruby - 2

    我实际上是在尝试使用RVM在我的OSX10.7.5上更新ruby,并在输入以下命令后:rvminstallruby我得到了以下回复:Searchingforbinaryrubies,thismighttakesometime.Checkingrequirementsforosx.Installingrequirementsforosx.Updatingsystem.......Errorrunning'requirements_osx_brew_update_systemruby-2.0.0-p247',pleaseread/Users/username/.rvm/log/138121

  10. ruby - Fast-stemmer 安装问题 - 2

    由于fast-stemmer的问题,我很难安装我想要的任何ruby​​gem。我把我得到的错误放在下面。Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingfast-stemmer:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcreatingMakefilemake"DESTDIR="cleanmake"DESTDIR=

随机推荐