佳豪哥哥教你学Linux的第二十三天
原创
©著作权归作者所有:来自51CTO博客作者佳豪哥哥的原创作品,请联系作者获取转载授权,否则将追究法律责任
自制YUM仓库
YUM仓库配置文件
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
YUM仓库类型
http:// 端口:80
https:// 端口:443
ftp:// 端口:21
file:// 没有端口(本地协议)
http:// 端口:80
https:// 端口:443
ftp:// 端口:21
file:// 没有端口(本地协议)
本地YUM仓库(file://)
1)创建仓库的命令
- createrepo
2)还要有rpm包
- 网站获取
- 镜像获取
- yum源获取
3)yum源的配置文件
[root@localhost <sub>]
[root@localhost </sub>]
mount: /dev/sr0 is write-protected, mounting read-only
[root@localhost <sub>]
[root@localhost </sub>]
[root@localhost <sub>]
Spawning worker 0 with 4021 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@localhost </sub>]
drwxr-xr-x 2 root root 4096 Apr 25 10:10 /local_yum_repo/repodata/
[root@localhost <sub>]
[root@localhost </sub>]
[wjh_local]
name=Local Repository By wjh
baseurl=file:///local_yum_repo
gpgcheck=0
enabled=1
[root@localhost ~]
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
wjh_local
| 2.9 kB 00:00:00
wjh_local/primary_db
| 3.1 MB 00:00:00
repo id repo name status
wjh_local Local Repository By wjh enabled: 4,02
远程yum仓库
1)创建仓库的命令
- createrepo
2)还要有rpm包
- 网站获取
- 镜像获取
- yum源获取
3)yum源的配置文件
[root@localhost <sub>]
[root@localhost </sub>]
mount: /dev/sr0 is write-protected, mounting read-only
[root@localhost <sub>]
[root@localhost </sub>]
如果没有netstat 命令,则需要安装
[root@localhost <sub>]
[root@localhost </sub>]
[root@localhost <sub>]
tcp6 0 0 :::21 :::* LISTEN 7763/vsftpd
ftp://IP
[root@localhost </sub>]
[root@localhost <sub>]
[root@localhost </sub>]
[root@localhost <sub>]
drwxr-xr-x 2 root root 6 Apr 25 11:13 base
drwxr-xr-x 2 root root 6 Apr 25 11:13 epel
[root@localhost </sub>]
[root@localhost <sub>]
total 616
-rw-r--r--. 1 root root 313032 Apr 25 17:50 net-tools-2.0-0.24.20131004git.el7.x86_64.rpm
-rw-r--r--. 1 root root 47508 Apr 25 17:50 tree-1.6.0-10.el7.x86_64.rpm
-rw-r--r--. 1 root root 266160 Apr 25 17:50 zip-3.0-11.el7.x86_64.rpm
[root@localhost </sub>]
[root@localhost epel]
[root@localhost epel]
total 588
-rw-r--r--. 1 root root 601193 Oct 19 2021 nginx-1.20.1-9.el7.x86_64.rpm
[root@localhost epel]
[root@localhost epel]
total 660
-rw-r--r--. 1 root root 601193 Oct 19 2021 nginx-1.20.1-9.el7.x86_64.rpm
-rw-r--r--. 1 root root 70428 Aug 11 2016 vim-go-1.8-3.el7.x86_64.rpm
[root@localhost <sub>]
[root@localhost </sub>]
[root@localhost yum.repos.d]
[wjh_local_epel]
name=Local Repository By wjh
baseurl=ftp://10.0.0.185/pub/epel/
gpgcheck=0
enabled=1
[wjh_local_base]
name=Local Repository By wjh
baseurl=ftp://10.0.0.185/pub/base/
gpgcheck=0
enabled=1
[root@localhost yum.repos.d]
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
wjh_local_base | 2.9 kB 00:00:00
wjh_local_epel | 2.9 kB 00:00:00
(1/2): wjh_local_base/primary_db | 3.2 kB 00:00:00
(2/2): wjh_local_epel/primary_db | 3.7 kB 00:00:00
repo id repo name status wjh_local_base Local Repository By wjh enabled: 3 wjh_local_epel Local Repository By wjh enabled: 2 repolist: 5
[root@localhost yum.repos.d]
..................................
Installed:
tree.x86_64 0:1.6.0-10.el7
Complete!
[root@localhost yum.repos.d]
..................................
Installed:
zip.x86_64 0:3.0-11.el7
Complete!