Centos7.2 Environment Readiness _ Configure local Yum source off Firewalld and SELinux

Source: Internet
Author: User
Tags gpg symlink yum repolist

First, configure the local Yum source


#查看yum源目录
[Email protected] ~]# ll/etc/yum.repos.d/
Total Dosage 28
-rw-r--r--. 1 root root 1664 December 9 Centos-base.repo
-rw-r--r--. 1 root root 1309 December 9 Centos-cr.repo
-rw-r--r--. 1 root root 649 December 9 Centos-debuginfo.repo
-rw-r--r--. 1 root root 290 December 9 Centos-fasttrack.repo
-rw-r--r--. 1 root root 630 December 9 Centos-media.repo
-rw-r--r--. 1 root root 1331 December 9 Centos-sources.repo
-rw-r--r--. 1 root root 1952 December 9 Centos-vault.repo


#删除自带yum源
[Email protected] ~]# mv/etc/yum.repos.d/*/tmp


#创建挂载目录
[Email protected] etc]# Mkdir/mnt/cdrom


#设置为开机自动挂载
[Email protected] etc]# Vi/etc/fstab
#
#/etc/fstab
# Created by Anaconda on Mon Mar 20 21:34:44 2017
#
# Accessible filesystems, by reference, is maintained under '/dev/disk '
# See mans Pages Fstab (5), Findfs (8), mount (8) and/or Blkid (8) for more info
#
/DEV/MAPPER/CENTOS-ROOT/XFS Defaults 0 0
Uuid=1def7626-55d2-4d85-b2b1-2d82ae268045/boot XFS Defaults 0 0
/dev/mapper/centos-home/home XFS Defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
/dev/cdrom/mnt/cdrom iso9660 Defaults 0 0


#以只读方式挂载
[Email protected] etc]# mount-a
Mount:/dev/sr0 write protection, will be mounted as read-only

#查看挂载目录
[Email protected] etc]# ll/mnt/cdrom/
Total dosage 636
-r--r--r--. 1 root root 14 December Centos_buildtag
Dr-xr-xr-x. 3 root root 2048 December EFI
-r--r--r--. 1 root root 215 December EULA
-r--r--r--. 1 root root 18009 December GPL
Dr-xr-xr-x. 3 root root 2048 December images
Dr-xr-xr-x. 2 root root 2048 December Isolinux
Dr-xr-xr-x. 2 root root 2048 December LiveOS
Dr-xr-xr-x. 2 root root 612352 December Packages
Dr-xr-xr-x. 2 root root 4096 December Repodata
-r--r--r--. 1 root root 1690 December rpm-gpg-key-centos-7
-r--r--r--. 1 root root 1690 December rpm-gpg-key-centos-testing-7
-r--r--r--. 1 root root 2883 TRANS. December TBL


#创建新yum源
[Email protected] etc]# cd/etc/yum.repos.d/
[Email protected] yum.repos.d]# VI Ops.repo
[CDROM]
Name=local-vcd
Baseurl=file:///mnt/cdrom
Enabled=1
Gpgcheck=0


#清除缓存
[email protected] yum.repos.d]# Yum Clean all
Loaded plugins: Fastestmirror
Cleaning up software Source: CDROM
Cleaning up everything


#查看yum源
[email protected] yum.repos.d]# Yum repolist
Loaded plugins: Fastestmirror
CDROM | 3.6 KB 00:00:00
(a): Cdrom/group_gz | 155 KB 00:00:00
(2/2): cdrom/primary_db | 2.8 MB 00:00:00
Determining fastest Mirrors
Source Identity Source Name status
CDROM LOCAL-VCD 3,723
repolist:3,723


#建立缓存
[email protected] yum.repos.d]# Yum Makecache
Loaded plugins: Fastestmirror
CDROM | 3.6 KB 00:00:00
(a): cdrom/other_db | 1.2 MB 00:00:00
(2/2): cdrom/filelists_db | 2.9 MB 00:00:00
Loading mirror speeds from cached hostfile
Metadata cache has been established


#安装常用软件
[email protected] yum.repos.d]# Yum install wget net-tools vim lrzsz tree screen lsof tcpdump-y


Close Firewalld
[Email protected] ~]# Systemctl stop Firewalld
[Email protected] ~]# systemctl disable FIREWALLD

Close Network Manager (Web management tools)
[Email protected] ~]# Systemctl stop NetworkManager
[Email protected] ~]# systemctl disable NetworkManager
Removed Symlink/etc/systemd/system/multi-user.target.wants/networkmanager.service.
Removed Symlink/etc/systemd/system/dbus-org.freedesktop.networkmanager.service.
Removed Symlink/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.

Turn off SELinux
[Email protected] ~]# Vi/etc/selinux/config
Selinux=disabled

Centos7.2 Environment Readiness _ Configure local Yum source off Firewalld and SELinux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.