练习1:插⼊优盘,读取优盘数据
[root@oneday ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 29.3G 0 disk
└─sda1 8:1 1 29.3G 0 part /mnt
sr0 11:0 1 8.8G 0 rom /mnt
nvme0n1 259:0 0 20G 0 disk
├─nvme0n1p1 259:1 0 1G 0 part /boot
└─nvme0n1p2 259:2 0 19G 0 part
├─centos-root 253:0 0 17G 0 lvm /
└─centos-swap 253:1 0 2G 0 lvm [SWAP]
[root@oneday ~]# mount /dev/sda1 /mnt
[root@oneday ~]# ls -l /mnt
总用量 6611216
drwxr-xr-x. 2 root 0 16384 3月 22 06:26 ??
drwxr-xr-x. 2 root 0 16384 7月 3 20:44 ?????
drwxr-xr-x. 3 root 0 16384 3月 10 01:43 ??????
drwxr-xr-x. 2 root 0 16384 8月 28 2023 ??1.????
-rwxr-xr-x. 1 root 0 1328863 12月 24 2023 ???+2021531236 MySQL????.docx
-rwxr-xr-x. 1 root 0 939302 10月 23 2023 ????_20231022202213.jpg
-rwxr-xr-x. 1 root 0 5296705 12月 11 2021 21?????2????2021531236.zip
drwxr-xr-x. 10 root 0 16384 4月 8 2022 c??
drwxr-xr-x. 2 root 0 16384 5月 30 2023 Debug
-rwxr-xr-x. 1 root 0 1985698 12月 19 2023 ???????.docx
-rwxr-xr-x. 1 root 0 1985698 12月 19 2023 ???????.docx
-rwxr-xr-x. 1 root 0 63516 12月 20 2023 ????.docx
drwxr-xr-x. 2 root 0 16384 6月 11 2023 ????Java
-rwxr-xr-x. 1 root 0 1365740 6月 3 2023 jd-gui-windows-1.6.6.zip
drwxr-xr-x. 3 root 0 16384 12月 25 2023 KingsoftData
-rwxr-xr-x. 1 root 0 1 5月 24 17:54 ~$??.pptx
-rwxr-xr-x. 1 root 0 27211305 7月 10 17:43 Python-3.12.4.tgz
-rwxr-xr-x. 1 root 0 177152000 5月 22 2018 RHEL7-extras.iso
-rwxr-xr-x. 1 root 0 3183450112 5月 22 2018 RHEL7OSP-10.iso
drwxr-xr-x. 2 root 0 16384 3月 12 17:59 System Volume Information
-rwxr-xr-x. 1 root 0 3368839168 5月 21 09:12 windows_server_2008_r2.iso
练习2:在vmware配置光盘iso⽂件,在linux系统中读取光盘⽂件
[root@oneday ~]# mount -o ro /dev/sr0 /mnt/
[root@oneday ~]# ls /mnt/
练习3:配置阿⾥云yum仓库
[root@oneday ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
[root@oneday ~]# yum clean all[root@oneday ~]# yum makecache
[root@oneday ~]# ls /etc/yum.repos.d/
CentOS-Base.repo[root@oneday ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d
/CentOS-Base.repo.aly
练习4:配置清华镜像仓库
[root@oneday ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tuna.tsinghua.edu.cn/centos/7/readme
[root@oneday ~]# yum clean all
[root@oneday ~]# yum makecache
练习5:配置腾讯镜像仓库
[root@oneday ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
[root@oneday ~]# yum clean all
[root@oneday ~]# yum makecache
[root@oneday ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.tecent
练习6:⾃建仓库 包含 tree net-tools bash-completion nginx tree等包
[root@oneday ~]# cp /etc/yum.repos.d/CentOS-Base.repo.tecent /etc/yum.repos.d/CentOS-Base.repo
[root@oneday ~]# yum -y install epel-release
[root@oneday ~]# yum install --downloadonly --downloaddir=./soft/nginx nginx.x86_64
[root@oneday ~]# yum install --downloadonly --downloaddir=./soft/tree tree.x86_64
[root@oneday ~]# yum install --downloadonly --downloaddir=./soft/net-tools net-tools.x86_64
[root@oneday ~]# yum install --downloadonly --downloaddir=./soft/bash-completion bash-completion.noarch
[root@oneday ~]# ls soft/bash-completion net-tools nginx tree
[root@oneday ~]# ls soft/bash-completion/
bash-completion-2.1-8.el7.noarch.rpm
[root@oneday ~]# ls soft/net-tools/
[root@oneday ~]# ls soft/nginx/
[root@oneday ~]# ls soft/tree/[root@oneday ~]# yum -y install createrepo
[root@oneday ~]# createrepo soft/
[root@oneday ~]# ls soft/[root@oneday ~]# vim /etc/yum.repos.d/soft.repo
[root@oneday ~]# rm -rf /etc/yum.repos.d/CentOS-Base.repo
[root@oneday ~]# yum clean all
[root@oneday ~]# yum makecache
[root@oneday ~]# ls /etc/yum.repos.d/
soft.repo
[root@oneday ~]# yum -y install nginx //测试