linux6.4 yum配置

linux yum配置,安装和管理软件

实验环境:

安装了Red Hat Enterprise Linux 6.4 可运行系统,并且是成功验证系统。

实验目标:

挂载光盘,配置yum 源,并通过yum 安装更新软件。

实验背景:

你想要将你的系统连接到专用yum 库来安装和升级软件。

实验要求:

1、配置yun

2、尝试使用yum 的基本语法

3、使用yum 安装wireshark

实验详解:

查看版本信息:

[[email protected] ~]# uname -a

Linux cz2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64GNU/Linux

[[email protected] ~]# cat /etc/redhat-release

Red HatEnterprise Linux Server release 6.4 (Santiago)

1、打开终端,

以root 用户的身份登录系统。如果你使用的是图形化环境,点击[应用程序

(Applications)]->[附件(System Tools)]->[终端(Terminal)]来打开终端:

或者以putty,SecureCRT远程打开

2、挂载光驱:

[[email protected] ~]# mount /dev/cdrom /media

mount:block device /dev/sr0 is write-protected, mounting read-only

#mount查看一下

/dev/sda2on / type ext4 (rw)

proc on/proc type proc (rw)

sysfs on/sys type sysfs (rw)

devpts on/dev/pts type devpts (rw,gid=5,mode=620)

tmpfs on/dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")

/dev/sda1on /boot type ext4 (rw)

/dev/sda3on /home type ext4 (rw)

none on/proc/sys/fs/binfmt_misc type binfmt_misc (rw)

vmware-vmblockon /var/run/vmblock-fuse type fuse.vmware-vmblock(rw,nosuid,nodev,default_permissions,allow_other)

sunrpc on/var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

gvfs-fuse-daemonon /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)

/dev/sr0 on /media type iso9660 (ro)    //挂载成功

3、编辑/etc/yum.repo.d 下的文件:

[[email protected] ~]# cd /etc/yum.repos.d/

[[email protected]desktopX yum.repos.d]# ls

packagekit-media.repo  rhel-source.repo

在源文件内容做如下创建一个新的*.repo文件

[[email protected]desktopX yum.repos.d]#vi Server.repo

[[email protected]desktopX yum.repos.d]# cat server.repo     //查看编辑内容

[Server]

name=RHEL local Server

baseurl=file:///media/Server

enabled=1

gpgcheck=1          //gpgcheck的参数可以“0,1”如果是零就不扫描下面的文件

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

注意:如果需要检查软件签名,请设置gpgcheak=1。关于baseurl,如果yum 源在本

地,则使用file://本地地址;如果yum 源在远端,则应该使用http://或ftp://。

测试

4、进入/media/Packages/ 目录,安装createrepo:

[[email protected] ~]# cd /media/Packages/

[[email protected]desktopX Packages]#rpm -vih createrepo*

warning:createrepo-0.9.9-17.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key IDfd431d51: NOKEY

error:Failed dependencies:

python-deltarpm is needed bycreaterepo-0.9.9-17.el6.noarch

注意:createrepo 是用来创建yum 数据库的软件包。

5、清空当前系统保存的yum 信息:

[[email protected] ~]# cd /etc/yum.repo.d

[[email protected] yum.repo.d]# yumclean all

Loadedplugins: rhnplugin, security

……

注意:每次修改yum 数据库的内容,就需要清除客户机缓存信息,否则会出现不可预

料的错误。

6、刷新yum 源列表:

[[email protected] yum.repo.d]# yumlist

Loadedplugins: rhnplugin, security

Thissystem is not registered with RHM.

RHMsupport will be disabled.

……

7、使用基本的yum命令搜索软件wireshark

 

[[email protected] yum.repos.d]# yum search wireshark

Loadedplugins: product-id, refresh-packagekit, security, subscription-manager

Thissystem is not registered to Red Hat Subscription Management. You can usesubscription-manager to register.

============================N/S Matched: wireshark ============================

wireshark-gnome.x86_64: Gnome desktop integration for wireshark and

: wireshark-usermode

wireshark.i686: Network traffic analyzer

wireshark.x86_64: Network traffic analyzer

Name and summary matches only, use "searchall" for everything.

8、查看wireshark 的详细信息:

[[email protected] desktopX yum.repos.d]#  yum info wireshark

Loadedplugins: product-id, refresh-packagekit, security, subscription-manager

Thissystem is not registered to Red Hat Subscription Management. You can usesubscription-manager to register.

AvailablePackages

Name        : wireshark

Arch        : i686

Version     : 1.2.15

Release     : 2.el6_2.1

Size        : 9.9 M

Repo        : Server

Summary     : Network traffic analyzer

URL         : http://www.wireshark.org/

License     : GPL+

Description: Wireshark is a network traffic analyzer for Unix-ish operating

: systems.

:

: This package lays base forlibpcap, a packet capture and filtering

: library, contains command-lineutilities, contains plugins and

: documentation for wireshark. Agraphical user interface is

: packaged separately to GTK+package.

Name        : wireshark

Arch        : x86_64

Version     :1.2.15

Release     : 2.el6_2.1

Size        : 11 M

Repo        : Server

Summary     : Network traffic analyzer

URL         : http://www.wireshark.org/

License     : GPL+

Description: Wireshark is a network traffic analyzer for Unix-ish operating

: systems.

:

: This package lays base forlibpcap, a packet capture and filtering

: library, contains command-lineutilities, contains plugins and

: documentation for wireshark. Agraphical user interface is

: packaged separately to GTK+package.

9、使用yum命令安装wireshark

[[email protected] yum.repos.d]# yum install wireshark

Loadedplugins: product-id, refresh-packagekit, security, subscription-manager

Thissystem is not registered to Red Hat Subscription Management. You can usesubscription-manager to register.

Settingup Install Process

ResolvingDependencies

-->Running transaction check

--->Package wireshark.x86_64 0:1.2.15-2.el6_2.1 will be installed

-->Processing Dependency: libsmi.so.2()(64bit) for package:wireshark-1.2.15-2.el6_2.1.x86_64

-->Running transaction check

--->Package libsmi.x86_64 0:0.4.8-4.el6 will be installed

yum 在安装过程中会自动处理依赖关系,遇到缺少的软件包会自动下载并安装。当屏幕出现Complete 时,表示安装完成。

总结:

yum 命令是快速安装软件的命令,他能解决RPM安装时出现的多重依赖包的关系,而却,yum的命令功能要比RPM安装命令的功能个强大。

附件

yum 主要命令参考手册

linux6.4 yum配置

时间: 2024-08-06 02:13:43

linux6.4 yum配置的相关文章

LINUX6安装YUM仓库和实现开机自动挂载

# LINUX6安装YUM仓库和实现开机自动挂载 ---------------------------------安装环境------------------------------- Redhat6镜像文件: 链接:https://pan.baidu.com/s/1DKH6adbrsipM-cTzH-wBgA  百度网盘  密码是hxcb Vmware Workstation虚拟机工具: 链接:https://pan.baidu.com/s/1VvNR9Jh3FDXdcHIHNJ5qhQ 百

rhel 5.8 and 6.4 yum配置

rhel 5.8 and 6.4 yum配置 6.4 [Packages]name=Packagesenabled=1gpgcheck=0baseurl=file:///iso 5.8 [Packages]name=Packagesenabled=1gpgcheck=0baseurl=file:///iso/Packages

yum配置与使用

yum配置与使用(很详细) yum的配置一般有两种方式,一种是直接配置/etc目录下的yum.conf文件,另外一种是在/etc/yum.repos.d目录下增加.repo文件.一.yum的配置文件 $ cat /etc/yum.conf [main]cachedir=/var/cache/yum         #yum下载的RPM包的缓存目录keepcache=0             #缓存是否保存,1保存,0不保存.debuglevel=2             #调试级别(0-10

yum配置

一.本地yum配置: mount/dev/cdrom  /mnt vim/etc/yum.repo.d/linux7.repo(名字随意,repo结尾) [linux7]          随意: name=linux7         随意: baseurl=file:///mnt gpgcheck=0   校验: enabled=1     生效: 设置成开机自启: vim /etc/fstab 添加: /dev/cdrom/mnt iso9660 defaults 0 0   二.在线yu

Redhat 6.4_联网 yum 配置

步骤简述----------------------------------------------------------------- 1. 准备软件包 下载第三步的软件包即可.由于是联网yum配置,要求系统可以联网. 2. 卸载原来的 yumrpm -qa | grep yum | xargs rpm -e --nodeps 3. 安装新包 rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm rpm -ivh yum-metadata-par

RedHat系统yum配置

RedHat系统yum配置 1        安装配置 1.1       获取安装包 进入http://centos.ustc.edu.cn/centos/6/os/x86_64/Packages/,找到如图中所示的三个包(视版本号而定)并下载. 1.2       卸载原系统yum. #           rpm –qa |grep yum | xargs rpm –e //rpm –qa命令列出所有已安装的rpm包,grep yum则从中查找出yum相关的包,xargs rpm –e则以

YUM配置和源码包安装

实验01:YUM配置 实验目标 学会yum配置 实验步骤 一.挂光盘 1. 选择镜像文件 2. 通过umount命令卸载载 [[email protected] ~]# umount /dev/cdrom 3. 通过mount命令卸载载 [[email protected] ~]# mount /dev/cdrom /media/ 4. 验证 二. 修改yum配置文件 [[email protected] ~]# cd /etc/yum.repos.d/ [[email protected] y

Redhat Yum配置网易镜像源

1.删除默认源 提权后删除 su rpm -aq | grep yum|xargs rpm -e --nodeps 2.安装yum 插入系统光盘,如未挂载需挂载光盘,这里挂载的路径为/media/RHEL_6.3 x86_64 Disc 1/,将Packages目录下的python-iniparse-0.3.1-2.1.e16.noarch.rpm,yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-3.2.29-30.el6.noarch.rpm拷贝

rhel6.3 yum配置安装源

明天实验要用到rhel6.3,自己虚拟机安装了Minimal,后来说要用桌面环境,就想自己Yum安装,结果yum grouplist在线查找不到!坑爹.后来上网查询mount光盘,配置yum安装源,搞定. 配置光盘源 第一步:mount /dev/cdrom /mnt挂载光盘 第二步:建立repo文件     vim /etc/yum.repos.d/felix.repo [Server]name=rhel6serverbaseurl=file:///mntenable=1gpcheck=0 第