1. 程式人生 > >新手學習Linux——配置yum源

新手學習Linux——配置yum源

gpg 學習linux dir 修改 登錄 release 使用 新手學 創建文件夾

1、使用root用戶登錄系統,在任意目錄下創建文件夾cdrom
mkdir /mnt/cdrom
2、在任意目錄下執行下面命令:
mount -o loop /dev/cdrom /mnt/cdrom/
3、修改yum源的配置文件,建議將/etc/yum.repos.d/ 目錄下的文件全部刪除掉,重新建一個以.repo為後綴名的文件,命令如下:
cd /etc/yum.repos.d/
rm -rf
touch yum.repo
vim yum.repo
然後將下面內容拷貝到yum.repo文件中
[rhel]
name =Red Hat enterprise Linux 6
baseurl=file:///mnt/cdrom
enable=1
gpgkey=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release

新手學習Linux——配置yum源