Make local repository and network repository for RHEL6 & telnet enable

简介:

创建RHEL6 和 Centos6 的yum 本地源,不过我平时还是喜欢用source包安装。

1、 yum是否安装

[root@heliy ~]# rpm -qa | grep yum

yum-rhn-plugin-0.9.1-5.el6.noarch

 

PackageKit-yum-0.5.8-13.el6.i686
yum-metadata-parser-1.1.2-14.1.el6.i686
yum-utils-1.1.26-11.el6.noarch
yum-3.2.27-14.el6.noarch
PackageKit-yum-plugin-0.5.8-13.el6.i686

2、 挂载

[root@heliy ~]# ls /mnt/
C  dvd1  dvd2  fat32  ISO  ntfs  usb

[root@heliy ~]# cat /etc/rc.local 
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
mount -t ntfs-3g /dev/sda6 /mnt/fat32

#mkdir /home/fukeyun/centosrpm

#cp /mnt/dvd1/Packages/* /homefukeyun/centosrpm

#cp /mnt/dvd2/Packages/* /homefukeyun/centosrpm

/dev/sda6 是我硬盘安装时划分的一个fat32分区,存放RHEL6的安装文件

3、 制作repo文件

可以用createrepo自动生成repo文件

# cd /mnt/fat32/Packages

#createrepo  ./   ##make repomd.xml file

[root@heliy ~]# ls /etc/yum.repos.d/
base.repo  centso6.repo
[root@heliy ~]# cat /etc/yum.repos.d/base.repo 
[heliypackages]
name = package
baseurl = file:///mnt/fat32/Packages/
enabled=1
gpgcheck=1
gpgkey=file:///mnt/fat32/RPM-GPG-KEY-redhat-release

[heliyHA]
name = HA
baseurl = file:///mnt/fat32/HighAvailability/
enabled=1
gpgcheck=1 
gpgkey=file:///mnt/fat32/RPM-GPG-KEY-redhat-release

[heliyLB]
name = LB
baseurl = file:///mnt/fat32/LoadBalancer/
enabled=1
gpgcheck=1 
gpgkey=file:///mnt/fat32/RPM-GPG-KEY-redhat-release

[heliyServer]
name = server
baseurl = file:///mnt/fat32/Server/
enabled=1
gpgcheck=1 
gpgkey=file:///mnt/fat32/RPM-GPG-KEY-redhat-release
 

4、监测

[root@heliy ~]# yum repolist

Loaded plugins: refresh-packagekit, rhnpluginThis system is not registered with RHN.RHN support will be disabled.

file:///home/fukeyun/centosrpm/repodata/repomd.xml: [Errno 14] Could not open/read file:///home/fukeyun/centosrpm/repodata/repomd.xml

Trying other mirror.

repo id                                 repo name                         status

heliyHA                                 HA                                   24

heliyLB                                 LB                                    2

heliyServer                             server                            2,646

heliypackages                           package                           2,646

repolist: 5,318

[root@heliy ~]# yum list

报错

Error: Cannot retrieve repository metadata (repomd.xml) for repository: InstallMedia. Please verify its path and try again

用网上的方法:

方法一:删除软件仓库中的 media.repo和/etc/yum.repos.d/packagekit-media.repo (注:如果只删除 packagekit-media.repo是没有用的,之后又会产生新的packagekit-media.repo 文件)

方法二:在/etc/yum.conf增加以下选项

skip_if_unavailable=True

 

方法三:也可直卸载Packagekit 包,yum remove -y PackageKit     但是这样会把gnome-packagekit等7个包一起删了,其它的包我不知道是做什么用的,但gnome-packagekit删掉后肯定无法使用图形界面的“添加/删除软件”了

再次运行yum list ,出现如下错误:

[root@heliy ~]# yum list

Loaded plugins: refresh-packagekit, rhnplugin

This system is not registered with RHN.

RHN support will be disabled.

file:///home/fukeyun/centosrpm/repodata/repomd.xml: [Errno 14] Could not open/read file:///home/fukeyun/centosrpm/repodata/repomd.xml

Trying other mirror.

Error: Cannot retrieve repository metadata (repomd.xml) for repository: heliypackagesdvd1. Please verify its path and try again

这个错误在repolist就有

解决方法:

#mkdir /home/fukeyun/centosrpm/repodata

# cp /mnt/dvd1/repodata/* /home/fukeyun/centosrpm/repodata/

或者用createrepo

#createrepo -p -d -o /home/fukeyun/centosrpm/repodata /home/fukeyun/centosrpm/repodata

createrepo -p -d -o -C --update 常用参数或者到制定目录下createrepo ./创建

这样启动httpd可做为http源,file作为本地源。

上面是本地源,下面将介绍网络源:

参考了这篇:http://www.linuxde.net/2011/10/1578.html

RHEL6用centos6的源安装

1、 删除RHEL6自带的yum 包

     # rpm -aq | grep yum|xargs rpm -e --nodeps

      安装centos6的yum包,在这个URL下载安装:http://mirror.centos.org/centos/6.0/os/i386/Packages,我是下载相关yum的文件,rpm -ivh *.rpm安装,会提示一些depense包,再下载到同一个目录下再安装。

centos官网和国内centos yum镜像站点:

http://mirror.centos.org
http://mirrors.163.com
http://mirrors.btte.net/centos/
http://mirrors.ta139.com/centos/
http://mirror.neu.edu.cn/centos/
http://centos.ustc.edu.cn/centos/
http://mirrors.sohu.com/

http://mirror.tuna.tsinghua.edu.cn/  清华大学开源镜像站

http://mirror.tju.edu.cn/  天津大学开源镜像站

在这些站点的首页都有help,打开这个页面下载repo文件放入/etc/yum.repos.d下

,把文件里面的$releasever全部替换为版本号,即6 或者6.0(具体看站点目录)。

# yum clean all
# yum makecach 或 yum repolist

[root@heliy /home/fukeyun]#yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
base                                                     | 3.7 kB     00:00     
base/filelists_db                                        | 4.7 MB     00:39     
base/primary_db                                          | 3.3 MB     00:28     
base/other_db                                            | 1.8 MB     00:15     
base/group_gz                                            | 206 kB     00:01     
extras                                                   | 3.0 kB     00:00     
extras/filelists_db                                      |  736 B     00:00     
extras/primary_db                                        | 1.9 kB     00:00     
extras/other_db                                          |  734 B     00:00     
updates                                                  | 3.5 kB     00:00     
updates/filelists_db                                     | 2.3 MB     00:18     
updates/prestodelta                                      |  82 kB     00:00     
updates/primary_db                                       | 3.1 MB     00:26     
updates/other_db                                         | 347 kB     00:02  

[root@heliy /home/fukeyun]#yum check
Loaded plugins: fastestmirror
PackageKit-0.5.8-13.el6.i686 has missing requires of PackageKit-yum = ('0', '0.5.8', '13.el6')
PackageKit-0.5.8-13.el6.i686 has missing requires of PackageKit-yum-plugin = ('0', '0.5.8', '13.el6')
abrt-addon-ccpp-1.1.13-4.0.4.el6.i686 has missing requires of yum-utils
rhn-check-1.0.0-38.0.13.el6.noarch has missing requires of yum-rhn-plugin >= ('0', '0.5.3', '30')
Error: check all
安装PackageKit这些yum图形界面rpm,而rhn 这些包的错误不许要安装,是我们没有注册即没有购买RedHat许可的原因。

 

==============================================

linux enable telnet


1\  rpm -aq | grep 'telnet'


2\   # rpm -ivh /media/NEW\ VOLUME/Packages/xinetd-             2.3.14-29.el6.i686.rpm
                                            telnet-server-0.17-46.el6.i686.rpm  
                                            telnet-0.17-46.el6.i686.rpm
3\   Path: /etc/xinetd.d/telnet
           /usr/bin/telnet
4\  vi /etc/xinetd.d/telnet
   # disable= yes

5\ /etc/init.d/xinetd restart
6\  port_change 

               vi /etc/services
                telnet 23/tcp
                telnet 23/udp

 


      本文转自fuhaixiong 51CTO博客,原文链接:http://blog.51cto.com/heliy/695634,如需转载请自行联系原作者






相关文章
|
3月前
|
网络协议 应用服务中间件 Linux
docker常见报错提示WARNING: IPv4 forwarding is disabled. Networking will not work.或/usr/bin/docker-current:
### 故障与解决方法概览 1. **故障现象**:运行 `docker run -d -P httpd:centos` 时提示“IPv4转发已禁用,网络将无法工作”。 - **解决方法**:通过编辑 `/etc/sysctl.conf` 设置 `net.ipv4.ip_forward=1` 并执行 `sysctl -p` 启用路由转发,然后重启 Docker 服务。
120 0
|
6月前
|
缓存 安全 网络协议
【Linux】已解决:There are no enabled repos. Run “yum repolist all” to see the repos you have. You can en
【Linux】已解决:There are no enabled repos. Run “yum repolist all” to see the repos you have. You can en
1186 1
|
7月前
|
网络协议 Linux 虚拟化
CentOS 8 错误: Error setting up base repository
CentOS 8 错误: Error setting up base repository
227 2
|
Ubuntu Linux Docker
Ubuntu安装docker报错:Command ‘lsb_release‘ not found
Ubuntu安装docker报错:Command ‘lsb_release‘ not found
416 0
执行 mysqld --install 报错:Install Remove of the Service Denied
执行 mysqld --install 报错:Install Remove of the Service Denied
104 0
执行 mysqld --install 报错:Install Remove of the Service Denied
|
KVM 虚拟化
Yum配置kvm时出现---Connot retrieve repository matedata balbalabal....
Yum配置kvm时出现---Connot retrieve repository matedata balbalabal....
Yum配置kvm时出现---Connot retrieve repository matedata balbalabal....
|
网络协议 Linux 开发工具
wget: unable to resolve host address ‘ftp.gnu.org’(CentOS 7的网络配置)
最近准备在linux环境下做开发,综合参考选了CentOS7 。然后在使用wget命令下载 tar.gz 包时出现了小问题
637 0
wget: unable to resolve host address ‘ftp.gnu.org’(CentOS 7的网络配置)
|
缓存 Linux 开发工具
【Linux server】yum 安装git报错Errors during downloading metadata for repository......
前言 今天发现服务器没有装git,用yum安装git的时候因为网络的原因总是失败,想到了切换一下yum的源,切了之后呢发现报错:Errors during downloading metadata for repository 'AppStream'
1266 0
|
Docker 容器
【Docker】安装镜像报错warning: /var/cache/yum/x86_64/7/extras/packages/epel-release-7-11.noarch.rpm: Header
【Docker】安装镜像报错warning: /var/cache/yum/x86_64/7/extras/packages/epel-release-7-11.noarch.rpm: Header
494 0
【Docker】安装镜像报错warning: /var/cache/yum/x86_64/7/extras/packages/epel-release-7-11.noarch.rpm: Header
|
缓存 Linux 应用服务中间件
【在下版本,有何贵干?】Dockerfile中 RUN yum -y install vim失败Cannot prepare internal mirrorlist: No URLs in mirrorlist
【在下版本,有何贵干?】Dockerfile中 RUN yum -y install vim失败Cannot prepare internal mirrorlist: No URLs in mirrorlist
1065 0
【在下版本,有何贵干?】Dockerfile中 RUN yum -y install vim失败Cannot prepare internal mirrorlist: No URLs in mirrorlist