最近装了台Redhat Enterprise 6.9,使用最简安装,很多rpm包都没有安装,在拷贝一些自定义的脚本到这台机器的时候发现了一些问题,通过制作本地源很方便的安装了相关软件,解决了这个问题。
问题描述:
拷贝文件到目标主机报错
-
scp /usr/bin/xxx root@10.90.244.15:/usr/bin/
-
root@10.90.244.15's password:
-
bash: scp: command not found
发现问题:
1. 查询本地scp属于哪个rpm包
-
[root@xxx ~]# rpm -qf /usr/bin/scp
-
openssh-clients-5.3p1-81.el6.x86_64
2. 查询目的机器是否存在这个rpm包
-
[root@localhost yum.repos.d]# rpm -qa|grep openssh-clients
-
[root@localhost yum.repos.d]#
解决问题:
搭建本地源安装oepnssh-client
-
[root@localhost yum.repos.d]# cat /etc/yum.repos.d/rhel.repo
-
[rhel] #ID
-
name=rhel-6.9 #repo name
-
baseurl=file:///media #location
-
enabled=1 #1 enable this repo 0 disable this repo
-
gpgcheck=0 # 0 no gpg check 1 start gpg check
-
[root@localhost yum.repos.d]# mount ~/rhel-server-6.9-x86_64-dvd.iso -o loop /media/
-
[root@localhost yum.repos.d]# yum repolist
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
rhel | 4.1 kB 00:00 ...
rhel/primary_db | 3.1 MB 00:00 ...
repo id repo name status
rhel rhel-6.9 3,854
repolist: 3,854
-
-
[root@localhost yum.repos.d]# yum install -y openssh-clients
-
Loaded plugins: product-id, search-disabled-repos, subscription-manager
-
This system is not registered with an entitlement server. You can use subscription-manager to register.
-
Setting up Install Process
-
Resolving Dependencies
-
--> Running transaction check
-
---> Package openssh-clients.x86_64 0:5.3p1-122.el6 will be installed
-
--> Processing Dependency: libedit.so.0()(64bit) for package: openssh-clients-5.3p1-122.el6.x86_64
-
--> Running transaction check
-
---> Package libedit.x86_64 0:2.11-4.20080712cvs.1.el6 will be installed
-
--> Finished Dependency Resolution
-
-
Dependencies Resolved
-
-
================================================================================
-
Package Arch Version Repository
-
Size
-
================================================================================
-
Installing:
-
openssh-clients x86_64 5.3p1-122.el6 rhel 443 k
-
Installing for dependencies:
-
libedit x86_64 2.11-4.20080712cvs.1.el6 rhel 74 k
-
-
Transaction Summary
-
================================================================================
-
Install 2 Package(s)
-
-
Total download size: 518 k
-
Installed size: 1.5 M
-
Downloading Packages:
-
--------------------------------------------------------------------------------
-
Total 21 MB/s | 518 kB 00:00
-
Running rpm_check_debug
-
Running Transaction Test
-
Transaction Test Succeeded
-
Running Transaction
-
Installing : libedit-2.11-4.20080712cvs.1.el6.x86_64 1/2
-
Installing : openssh-clients-5.3p1-122.el6.x86_64 2/2
-
rhel/productid | 1.6 kB 00:00 ...
-
Verifying : libedit-2.11-4.20080712cvs.1.el6.x86_64 1/2
-
Verifying : openssh-clients-5.3p1-122.el6.x86_64 2/2
-
-
Installed:
-
openssh-clients.x86_64 0:5.3p1-122.el6
-
-
Dependency Installed:
-
libedit.x86_64 0:2.11-4.20080712cvs.1.el6
-
-
Complete!
结果:
拷贝文件到远程主机
-
[root@xxx ~]# scp /usr/bin/xxx root@10.90.244.15:/usr/bin/
-
root@10.90.244.15's password:
-
xxx 100% 5049 4.9KB/s 00:00
阅读(2953) | 评论(0) | 转发(0) |