忽然在网上发现了sl命令,不知道是干什么的,于是安装测试一下。
直接安装会报错:
[root@centerdb .ssh]# yum install sl
Loaded plugins: fastestmirror
Setting up Install Process
Determining fastest mirrors
- base: mirrors.nwsuaf.edu.cn
- extras: mirrors.nwsuaf.edu.cn
- updates: mirror.bit.edu.cn
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 4.7 MB 00:05
No package sl available.
Error: Nothing to do
在网上查找了一下解决办法,特将方法在这里记录一下:
1、先更新yum
yum -y update
2、安装wget包
[root@testoracle ~]# yum install wget
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
- base: mirror.bit.edu.cn
- extras: mirror.bit.edu.cn
- updates: mirrors.aliyun.com
Resolving Dependencies
–> Running transaction check
—> Package wget.x86_64 0:1.12-10.el6 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================
Package Arch Version Repository Size
============================================================================================================================
Installing:
wget x86_64 1.12-10.el6 base 484 k
Transaction Summary
============================================================================================================================
Install 1 Package(s)
Total download size: 484 k
Installed size: 1.8 M
Is this ok [y/N]: y
Downloading Packages:
wget-1.12-10.el6.x86_64.rpm | 484 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : wget-1.12-10.el6.x86_64 1/1
Verifying : wget-1.12-10.el6.x86_64 1/1
Installed:
wget.x86_64 0:1.12-10.el6
Complete!
3、安装额外包:
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
[root@testoracle ~]# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
–2019-06-21 19:51:53-- http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Resolving dl.fedoraproject.org… 209.132.181.23, 209.132.181.24, 209.132.181.25
Connecting to dl.fedoraproject.org|209.132.181.23|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 14540 (14K) [application/x-rpm]
Saving to: “epel-release-6-8.noarch.rpm”
100%[==================================================================================>] 14,540 75.0K/s in 0.2s
2019-06-21 19:51:54 (75.0 KB/s) - “epel-release-6-8.noarch.rpm” saved [14540/14540]
执行yum命令时会去centos镜像查找sl包,但是镜像中没有sl包,所以要安装额外包,需要安装epel-release-6-8.noarch.rpm
4、安装epel包
**[root@testoracle ~]# rpm -ivh epel-release-6-8.noarch.rpm
warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing… ########################################### [100%]
1:epel-release ########################################### [100%]
5、安装sl包
[root@testoracle ~]# yum install sl
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
epel/metalink | 7.7 kB 00:00
- base: mirror.bit.edu.cn
- epel: mirrors.yun-idc.com
- extras: mirror.bit.edu.cn
- updates: mirrors.aliyun.com
epel | 5.3 kB 00:00
epel/primary_db | 6.1 MB 00:06
Resolving Dependencies
–> Running transaction check
—> Package sl.x86_64 0:5.02-1.el6 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================
Package Arch Version Repository Size
============================================================================================================================
Installing:
sl x86_64 5.02-1.el6 epel 13 k
Transaction Summary
============================================================================================================================
Install 1 Package(s)
Total download size: 13 k
Installed size: 15 k
Is this ok [y/N]: y
Downloading Packages:
sl-5.02-1.el6.x86_64.rpm | 13 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
Userid : EPEL (6) epel@fedoraproject.org
Package: epel-release-6-8.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : sl-5.02-1.el6.x86_64 1/1
Verifying : sl-5.02-1.el6.x86_64 1/1
Installed:
sl.x86_64 0:5.02-1.el6
Complete!**
6、安装成功后就可以运行sl了
[root@testoracle ~]# sl