Tag Archives: CentOS

List and Change Kernel in CentOS 7

List kernels:

$ egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'
CentOS Linux (3.10.0-327.10.1.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-327.4.5.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-327.3.1.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-229.20.1.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-123.9.3.el7.x86_64) 7 (Core)
CentOS Linux, with Linux 0-rescue-45461f76679f48ee96e95da6cc798cc8

Set kernel to the fourth:

$ grub2-set-default 3

RHEL7: How to get started with Firewalld. – CertDepot

To assign the eth0 network interface temporarily to the internal zone, type:

$ firewall-cmd --zone=internal --change-interface=eth0
success

To assign the eth0 network interface permanently to the internal zone (a file called internal.xml is created in the /etc/firewalld/zones directory), type:

$ firewall-cmd --permanent --zone=internal --change-interface=eth0
success

Source: RHEL7: How to get started with Firewalld. – CertDepot

Fix rsync “Host Key Verification Failed” in Jenkins

If you got the following error in Jenkins output using rsync:

Running "shell:sync" (shell) task
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]
Warning: Command failed: Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]
 Use --force to continue.

Try the following:

  • su -s /bin/bash jenkins, since Jenkins install doesn’t have login shell by default on CentOS
  • ssh into target server
  • When prompt “Are you sure you want to continue connecting (yes/no)?”, type yes
  • Rerun the job

CentOS 6.1 上安装 git 出现 Requires: libcurl.so.3 的解决方案

6 升级到 6.1 后安装 git 报错:

root@dad:/# yum install git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.nsc.liu.se
 * epel: ftp.riken.jp
 * extras: mirror.nsc.liu.se
 * ius: pancks.sothatswhy.org.uk
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: centosu.centos.org
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package git.i386 0:1.7.6.4-1.el5.rf will be installed
--> Processing Dependency: perl-Git = 1.7.6.4-1.el5.rf for package: git-1.7.6.4-1.el5.rf.i386
--> Processing Dependency: libcurl.so.3 for package: git-1.7.6.4-1.el5.rf.i386
--> Processing Dependency: libexpat.so.0 for package: git-1.7.6.4-1.el5.rf.i386
--> Processing Dependency: perl(Git) for package: git-1.7.6.4-1.el5.rf.i386
--> Running transaction check
---> Package compat-expat1.i686 0:1.95.8-8.el6 will be installed
---> Package git.i386 0:1.7.6.4-1.el5.rf will be installed
--> Processing Dependency: libcurl.so.3 for package: git-1.7.6.4-1.el5.rf.i386
---> Package perl-Git.i386 0:1.7.6.4-1.el5.rf will be installed
--> Finished Dependency Resolution
Error: Package: git-1.7.6.4-1.el5.rf.i386 (rpmforge)
           Requires: libcurl.so.3
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

解决方案:编辑 /etc/yum.repos.d/rpmforge.repo,开启 extra repo

再次执行后:

...
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : git-1.7.6.4-1.el6.rfx.i686                                                                       1/2 
  Installing : perl-Git-1.7.6.4-1.el6.rfx.i686                                                                  2/2 

Installed:
  git.i686 0:1.7.6.4-1.el6.rfx                                                                                      

Dependency Installed:
  perl-Git.i686 0:1.7.6.4-1.el6.rfx                                                                                 

Complete!

解决方案(来源):

yum clean all