CentOS 7搭建本地yum源
问题
CentOS7.1安装rpm包时提示缺失包,有些包iso里面也没有,只能从外网yum,这种情况下,可以提前yum好所需的依赖包,做成一个本地yum源。将这些文件拷贝到没联网的机器就可以使用了。
[root@localhost ~]# rpm -ivh leofs_mond-20110411-74.i386.rpm
error: Failed dependencies:
libc.so.6 is needed by leofs_mond-20110411-74.i386
libc.so.6(GLIBC_2.0) is needed by leofs_mond-20110411-74.i386
libc.so.6(GLIBC_2.1) is needed by leofs_mond-20110411-74.i386
libc.so.6(GLIBC_2.1.3) is needed by leofs_mond-20110411-74.i386
libc.so.6(GLIBC_2.2) is needed by leofs_mond-20110411-74.i386
libc.so.6(GLIBC_2.3) is needed by leofs_mond-20110411-74.i386
libc.so.6(GLIBC_2.3.3) is needed by leofs_mond-20110411-74.i386
libc.so.6(GLIBC_2.3.4) is needed by leofs_mond-20110411-74.i386
libc.so.6(GLIBC_2.4) is needed by leofs_mond-20110411-74.i386
libcrypt.so.1 is needed by leofs_mond-20110411-74.i386
libdl.so.2 is needed by leofs_mond-20110411-74.i386
libm.so.6 is needed by leofs_mond-20110411-74.i386
libm.so.6(GLIBC_2.0) is needed by leofs_mond-20110411-74.i386
libnsl.so.1 is needed by leofs_mond-20110411-74.i386
libpthread.so.0 is needed by leofs_mond-20110411-74.i386
libpthread.so.0(GLIBC_2.0) is needed by leofs_mond-20110411-74.i386
libpthread.so.0(GLIBC_2.1) is needed by leofs_mond-20110411-74.i386
libpthread.so.0(GLIBC_2.1.1) is needed by leofs_mond-20110411-74.i386
libpthread.so.0(GLIBC_2.2) is needed by leofs_mond-20110411-74.i386
libpthread.so.0(GLIBC_2.3.2) is needed by leofs_mond-20110411-74.i386
libpthread.so.0(GLIBC_2.4) is needed by leofs_mond-20110411-74.i386
libresolv.so.2 is needed by leofs_mond-20110411-74.i386
librt.so.1 is needed by leofs_mond-20110411-74.i386
[root@localhost ~]#
安装createrepo
[root@localhost ~]# yum -y install createrepo
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/4): extras/7/x86_64/primary_db | 117 kB 00:00:00
(2/4): base/7/x86_64/group_gz | 155 kB 00:00:01
(3/4): updates/7/x86_64/primary_db | 4.1 MB 00:00:04
(4/4): base/7/x86_64/primary_db | 5.3 MB 00:00:08
Determining fastest mirrors
* base: mirrors.skyshe.cn
* extras: mirrors.neusoft.edu.cn
* updates: mirrors.zju.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package createrepo.noarch 0:0.9.9-25.el7_2 will be installed
--> Processing Dependency: python-deltarpm for package: createrepo-0.9.9-25.el7_2.noarch
--> Processing Dependency: libxml2-python for package: createrepo-0.9.9-25.el7_2.noarch
--> Processing Dependency: deltarpm for package: createrepo-0.9.9-25.el7_2.noarch
--> Running transaction check
---> Package deltarpm.x86_64 0:3.6-3.el7 will be installed
---> Package libxml2-python.x86_64 0:2.9.1-6.el7_2.2 will be installed
--> Processing Dependency: libxml2 = 2.9.1-6.el7_2.2 for package: libxml2-python-2.9.1-6.el7_2.2.x86_64
---> Package python-deltarpm.x86_64 0:3.6-3.el7 will be installed
--> Running transaction check
---> Package libxml2.x86_64 0:2.9.1-5.el7_0.1 will be updated
---> Package libxml2.x86_64 0:2.9.1-6.el7_2.2 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================================================================
Installing:
createrepo noarch 0.9.9-25.el7_2 updates 92 k
Installing for dependencies:
deltarpm x86_64 3.6-3.el7 base 82 k
libxml2-python x86_64 2.9.1-6.el7_2.2 updates 245 k
python-deltarpm x86_64 3.6-3.el7 base 31 k
Updating for dependencies:
libxml2 x86_64 2.9.1-6.el7_2.2 updates 666 k
Transaction Summary
=======================================================================================================================================================================
Install 1 Package (+3 Dependent packages)
Upgrade ( 1 Dependent package)
Total download size: 1.1 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
warning: /var/cache/yum/x86_64/7/updates/packages/createrepo-0.9.9-25.el7_2.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEYs | 0 B --:--:-- ETA
Public key for createrepo-0.9.9-25.el7_2.noarch.rpm is not installed
(1/5): createrepo-0.9.9-25.el7_2.noarch.rpm | 92 kB 00:00:00
Public key for deltarpm-3.6-3.el7.x86_64.rpm is not installed
(2/5): deltarpm-3.6-3.el7.x86_64.rpm | 82 kB 00:00:00
(3/5): python-deltarpm-3.6-3.el7.x86_64.rpm | 31 kB 00:00:00
(4/5): libxml2-python-2.9.1-6.el7_2.2.x86_64.rpm | 245 kB 00:00:00
(5/5): libxml2-2.9.1-6.el7_2.2.x86_64.rpm | 666 kB 00:00:01
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 768 kB/s | 1.1 MB 00:00:01
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-1.1503.el7.centos.2.8.x86_64 (@anaconda)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : deltarpm-3.6-3.el7.x86_64 1/6
Installing : python-deltarpm-3.6-3.el7.x86_64 2/6
Updating : libxml2-2.9.1-6.el7_2.2.x86_64 3/6
Installing : libxml2-python-2.9.1-6.el7_2.2.x86_64 4/6
Installing : createrepo-0.9.9-25.el7_2.noarch 5/6
Cleanup : libxml2-2.9.1-5.el7_0.1.x86_64 6/6
Verifying : createrepo-0.9.9-25.el7_2.noarch 1/6
Verifying : python-deltarpm-3.6-3.el7.x86_64 2/6
Verifying : deltarpm-3.6-3.el7.x86_64 3/6
Verifying : libxml2-2.9.1-6.el7_2.2.x86_64 4/6
Verifying : libxml2-python-2.9.1-6.el7_2.2.x86_64 5/6
Verifying : libxml2-2.9.1-5.el7_0.1.x86_64 6/6
Installed:
createrepo.noarch 0:0.9.9-25.el7_2
Dependency Installed:
deltarpm.x86_64 0:3.6-3.el7 libxml2-python.x86_64 0:2.9.1-6.el7_2.2 python-deltarpm.x86_64 0:3.6-3.el7
Dependency Updated:
libxml2.x86_64 0:2.9.1-6.el7_2.2
Complete!
[root@localhost ~]#
下载所需的包上传至/opt/rpm目录
[root@localhost ~]# /usr/bin/yum install --downloaddir=/opt/rpm --downloadonly libc.so.6
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.skyshe.cn
* extras: mirrors.neusoft.edu.cn
* updates: mirrors.zju.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package glibc.i686 0:2.17-106.el7_2.4 will be installed
--> Processing Dependency: glibc-common = 2.17-106.el7_2.4 for package: glibc-2.17-106.el7_2.4.i686
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.17-106.el7_2.4.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.17-106.el7_2.4.i686
--> Running transaction check
---> Package glibc-common.x86_64 0:2.17-78.el7 will be updated
--> Processing Dependency: glibc-common = 2.17-78.el7 for package: glibc-2.17-78.el7.x86_64
---> Package glibc-common.x86_64 0:2.17-106.el7_2.4 will be an update
---> Package nss-softokn-freebl.x86_64 0:3.16.2.3-9.el7 will be updated
---> Package nss-softokn-freebl.i686 0:3.16.2.3-14.2.el7_2 will be installed
---> Package nss-softokn-freebl.x86_64 0:3.16.2.3-14.2.el7_2 will be an update
--> Running transaction check
---> Package glibc.x86_64 0:2.17-78.el7 will be updated
---> Package glibc.x86_64 0:2.17-106.el7_2.4 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================================================================
Installing:
glibc i686 2.17-106.el7_2.4 updates 4.2 M
Installing for dependencies:
nss-softokn-freebl i686 3.16.2.3-14.2.el7_2 updates 187 k
Updating for dependencies:
glibc x86_64 2.17-106.el7_2.4 updates 3.6 M
glibc-common x86_64 2.17-106.el7_2.4 updates 11 M
nss-softokn-freebl x86_64 3.16.2.3-14.2.el7_2 updates 204 k
Transaction Summary
=======================================================================================================================================================================
Install 1 Package (+1 Dependent package)
Upgrade ( 3 Dependent packages)
Total download size: 20 M
Background downloading packages, then exiting:
Delta RPMs reduced 3.8 M of updates to 842 k (78% saved)
(1/5): nss-softokn-freebl-3.16.2.3-14.2.el7_2.i686.rpm | 187 kB 00:00:00
(2/5): nss-softokn-freebl-3.16.2.3-9.el7_3.16.2.3-14.2.el7_2.x86_64.drpm | 44 kB 00:00:00
(3/5): glibc-2.17-78.el7_2.17-106.el7_2.4.x86_64.drpm | 798 kB 00:00:00
(4/5): glibc-2.17-106.el7_2.4.i686.rpm | 4.2 MB 00:00:04
(5/5): glibc-common-2.17-106.el7_2.4.x86_64.rpm | 11 MB 00:00:35
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 483 kB/s | 17 MB 00:00:35
exiting because "Download Only" specified
[root@localhost ~]#
创建repo元数据
[root@localhost ~]# createrepo -p -d -o /opt/rpm/ /opt/rpm/
Spawning worker 0 with 5 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@localhost ~]#
更新repo元数据(可选操作)
[root@localhost ~]# createrepo --update /opt/rpm/
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@localhost ~]#
确认repo元数据
[root@localhost rpm]# ls
glibc-2.17-106.el7_2.4.i686.rpm glibc-common-2.17-106.el7_2.4.x86_64.rpm nss-softokn-freebl-3.16.2.3-14.2.el7_2.x86_64.rpm
glibc-2.17-106.el7_2.4.x86_64.rpm nss-softokn-freebl-3.16.2.3-14.2.el7_2.i686.rpm repodata
[root@localhost rpm]# cd repodata/
[root@localhost repodata]# ls
041cca5c43f978a01b7aa183d437b2f208629512ad7c39e618b7d252c2c8dc92-primary.sqlite.bz2
3c112b1ac138d54957b4333ce830986196e64121ca97add7dc0b077b44a02868-other.xml.gz
762a63333594c82421ddf6abc7e94f76538a3fc74a2c72c691c47449a5251f26-other.sqlite.bz2
9ced1af354247835727999f8dd9566ac67259e375ebe321fbc627d32243918e8-filelists.xml.gz
ae83cc34b4f68138398c2bc2bb7de716bdf459c5064a0c6f86e1ee80b36410e2-primary.xml.gz
ff9c201de18d66af38f838314419114402666926f2eb03c0008be6cd0737e41a-filelists.sqlite.bz2
repomd.xml
[root@localhost repodata]# pwd
/opt/rpm/repodata
[root@localhost repodata]#
编辑repo文件
[root@localhost yum.repos.d]# ls
CentOS-CR.repo yumback
[root@localhost yum.repos.d]# cat CentOS-CR.repo
# CentOS-CR.repo
#
# The Continuous Release ( CR ) repository contains rpms that are due in the next
# release for a specific CentOS Version ( eg. next release in CentOS-7 ); these rpms
# are far less tested, with no integration checking or update path testing having
# taken place. They are still built from the upstream sources, but might not map
# to an exact upstream distro release.
#
# These packages are made available soon after they are built, for people willing
# to test their environments, provide feedback on content for the next release, and
# for people looking for early-access to next release content.
#
# The CR repo is shipped in a disabled state by default; its important that users
# understand the implications of turning this on.
#
# NOTE: We do not use a mirrorlist for the CR repos, to ensure content is available
# to everyone as soon as possible, and not need to wait for the external
# mirror network to seed first. However, many local mirrors will carry CR repos
# and if desired you can use one of these local mirrors by editing the baseurl
# line in the repo config below.
#
[cr]
name=CentOS-$releasever - cr
baseurl=file:///opt/rpm
#http://mirror.centos.org/centos/$releasever/cr/$basearch/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[root@localhost yum.repos.d]#
验证repo
[root@localhost yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: cr
Cleaning up everything
Cleaning up list of fastest mirrors
[root@localhost yum.repos.d]# yum repolist
Loaded plugins: fastestmirror
cr | 2.9 kB 00:00:00
cr/primary_db | 9.4 kB 00:00:00
Determining fastest mirrors
repo id repo name status
cr CentOS-7 - cr
5
repolist: 5
[root@localhost yum.repos.d]#
从做好的repo源中安装缺失包
[root@localhost ~]# yum install libc.so.6
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package glibc.i686 0:2.17-106.el7_2.4 will be installed
--> Processing Dependency: glibc-common = 2.17-106.el7_2.4 for package: glibc-2.17-106.el7_2.4.i686
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.17-106.el7_2.4.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.17-106.el7_2.4.i686
--> Running transaction check
---> Package glibc-common.x86_64 0:2.17-78.el7 will be updated
--> Processing Dependency: glibc-common = 2.17-78.el7 for package: glibc-2.17-78.el7.x86_64
---> Package glibc-common.x86_64 0:2.17-106.el7_2.4 will be an update
---> Package nss-softokn-freebl.x86_64 0:3.16.2.3-9.el7 will be updated
---> Package nss-softokn-freebl.i686 0:3.16.2.3-14.2.el7_2 will be installed
---> Package nss-softokn-freebl.x86_64 0:3.16.2.3-14.2.el7_2 will be an update
--> Running transaction check
---> Package glibc.x86_64 0:2.17-78.el7 will be updated
---> Package glibc.x86_64 0:2.17-106.el7_2.4 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================================================================
Installing:
glibc i686 2.17-106.el7_2.4 cr 4.2 M
Installing for dependencies:
nss-softokn-freebl i686 3.16.2.3-14.2.el7_2 cr 187 k
Updating for dependencies:
glibc x86_64 2.17-106.el7_2.4 cr 3.6 M
glibc-common x86_64 2.17-106.el7_2.4 cr 11 M
nss-softokn-freebl x86_64 3.16.2.3-14.2.el7_2 cr 204 k
Transaction Summary
=======================================================================================================================================================================
Install 1 Package (+1 Dependent package)
Upgrade ( 3 Dependent packages)
Total download size: 20 M
Is this ok [y/d/N]: y
Downloading packages:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 138 MB/s | 20 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : glibc-common-2.17-106.el7_2.4.x86_64 1/8
Updating : glibc-2.17-106.el7_2.4.x86_64 2/8
Updating : nss-softokn-freebl-3.16.2.3-14.2.el7_2.x86_64 3/8
Installing : nss-softokn-freebl-3.16.2.3-14.2.el7_2.i686 4/8
Installing : glibc-2.17-106.el7_2.4.i686 5/8
Cleanup : glibc-common-2.17-78.el7.x86_64 6/8
Cleanup : glibc-2.17-78.el7.x86_64 7/8
Cleanup : nss-softokn-freebl-3.16.2.3-9.el7.x86_64 8/8
Verifying : nss-softokn-freebl-3.16.2.3-14.2.el7_2.x86_64 1/8
Verifying : glibc-2.17-106.el7_2.4.i686 2/8
Verifying : glibc-common-2.17-106.el7_2.4.x86_64 3/8
Verifying : nss-softokn-freebl-3.16.2.3-14.2.el7_2.i686 4/8
Verifying : glibc-2.17-106.el7_2.4.x86_64 5/8
Verifying : glibc-2.17-78.el7.x86_64 6/8
Verifying : nss-softokn-freebl-3.16.2.3-9.el7.x86_64 7/8
Verifying : glibc-common-2.17-78.el7.x86_64 8/8
Installed:
glibc.i686 0:2.17-106.el7_2.4
Dependency Installed:
nss-softokn-freebl.i686 0:3.16.2.3-14.2.el7_2
Dependency Updated:
glibc.x86_64 0:2.17-106.el7_2.4 glibc-common.x86_64 0:2.17-106.el7_2.4 nss-softokn-freebl.x86_64 0:3.16.2.3-14.2.el7_2
Complete!
正常安装
[root@localhost ~]# rpm -ivh leofs_mond-20110411-74.i386.rpm
Preparing... ################################# [100%]
Updating / installing...
1:leofs_mond-20110411-74 ################################# [100%]
[root@localhost ~]# service leofs_mond status
leofs_mond.service - SYSV: leofs_mond startup script
Loaded: loaded (/etc/rc.d/init.d/leofs_mond)
Active: active (running) since Thu 2016-05-12 21:03:39 CST; 4s ago
Process: 12502 ExecStart=/etc/rc.d/init.d/leofs_mond start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/leofs_mond.service
├─12514 /LeoCluster/bin/leofs_mond -c /LeoCluster/conf/leofs_mond.conf
└─12515 /LeoCluster/bin/leofs_mond -c /LeoCluster/conf/leofs_mond.conf
May 12 21:03:39 localhost.localdomain systemd[1]: Starting SYSV: leofs_mond startup script...
May 12 21:03:39 localhost.localdomain leofs_mond[12502]: Starting leofs_mond: [ OK ]
May 12 21:03:39 localhost.localdomain systemd[1]: Started SYSV: leofs_mond startup script.
May 12 21:03:39 localhost.localdomain leofs_mond[12514]: leofs_mond master 12514 start.
May 12 21:03:39 localhost.localdomain leofs_mond[12515]: leofs_mond worker 12515 start.
[root@localhost ~]#
CentOS 7搭建本地yum源的更多相关文章
- CentOS 7搭建本地yum源和局域网yum源
这两天在部署公司的测试环境,在安装各种中间件的时候,发现各种依赖都没有:后来一检查,发现安装的操作系统是CentOS Mini版,好吧,我认了:为了完成测试环境的搭建,我就搭建了一个局域网的yum源. ...
- centos 搭建本地YUM源并使用apache共享YUM源
搭建本地YUM源 1.挂载镜像 2.搭建本地YUM源 删除多余repo文件保留一个就行 本地YUM源就搭建好了 yum repolist 查看yum源 3.使用apache共享YUM源 YUM服务器配 ...
- 搭建本地yum源并定时同步
在生产中内网的机器都是不能访问外网,所以需要搭建本地yum源.以中国科学科技大学的yum源为基准.http://mirrors.ustc.edu.cn/ 有些模块会同步失败,可以wget下载至指定位置 ...
- [转载]CentOS 7 创建本地YUM源
本文中的"本地YUM源"包括三种类型:一是直接使用CentOS光盘作为本地yum源,优点是简单便捷,缺点是光盘软件包可能不完整(centos 7 Everything 总共才6.5 ...
- 为CentOS 6 配置本地YUM源
在网上找了很多为CentOS 6配置本地YUM源的方法,其中有很多是与网络相关的,我只想配个自己用的,结果就发现这个方法比较简单实用,就转过来了. 环境:CentOS 6.0 默认的yum是以网络来安 ...
- CentOS 6.x 本地yum源配置与使用
系统默认已经安装了可使用yum的软件包,所以可以直接配置: # mount /dev/cdrom /mnt 挂载镜像,可以写到配置文件 ...
- 使用光盘搭建本地yum源
刚装好的系统,想安装一些常用软件和一些包组的时候,就可以使用安装光盘搭建本地yum 第一步:挂载安装光盘 mount /dev/cdrom /mnt 第二步:编辑repo yum源文件 [root@l ...
- CENTOS 6-7的本地YUM源配置
本文档适合CENTOS 6-7的本地YUM源配置 cd /media cd CentOS_6.8_Final/ cd Packages 创建目录拷贝文件 mkdir /yum cp * /yum 配置 ...
- 【转载】搭建本地yum源:以下是以centos7为例子
搭建本地yum源:以下是以centos7为例子 1)首先需要安装 createrepo(需要一个可以使用源的机器,可以访问互联网)安装方法可以使用yum安装epel源 1 yum -y instal ...
随机推荐
- 热部署只知道devtools吗?JRebel不香吗?
持续原创输出,点击上方蓝字关注我 目录 前言 JRebel收费怎么破? 什么是本地热部署? 什么是远程热部署? JRebel和devtools的区别 如何安装JRebel? 如何本地热部署? 如何远程 ...
- Java中的微信支付(3):API V3对微信服务器响应进行签名验证
1. 前言 牢记一句话:公钥加密,私钥解密:私钥加签,公钥验签. 微信支付V3版本前两篇分别讲了如何对请求做签名和如何获取并刷新微信平台公钥,本篇将继续展开如何对微信支付响应结果的验签. 2. 为什么 ...
- [Luogu P3959] 宝藏 (状压DP+枚举子集)
题面 传送门:https://www.luogu.org/problemnew/show/P3959 Solution 这道题的是一道很巧妙的状压DP题. 首先,看到数据范围,应该状压DP没错了. 根 ...
- P3065 [USACO12DEC]First! G
题意描述 [USACO12DEC]First! G 不错的一道题. 给你 \(N\) 个字符串,要求你求出可能的字典序最小的字符串. 对于 可能的最小的字符串,你可以任意排列 \(26\) 个字母,使 ...
- CF1108E2 Array and Segments (Hard version)
线段树 对于$Easy$ $version$可以枚举极大值和极小值的位置,然后判断即可 但对于$Hard$ $version$明显暴力同时枚举极大值和极小值会超时 那么,考虑只枚举极小值 对于数轴上每 ...
- NOIP 2012 P1081 开车旅行
倍增 这道题最难的应该是预处理... 首先用$set$从后往前预处理出每一个点海拔差绝对值得最大值和次大值 因为当前城市的下标只能变大,对于点$i$,在$set$中二分找出与其值最接近的下标 然后再$ ...
- c++11-17 模板核心知识(一)—— 函数模板
1.1 定义函数模板 1.2 使用函数模板 1.3 两阶段翻译 Two-Phase Translation 1.3.1 模板的编译和链接问题 1.4 多模板参数 1.4.1 引入额外模板参数作为返回值 ...
- leetcode70word-search
题目描述 给出一个二维字符数组和一个单词,判断单词是否在数组中出现, 单词由相邻单元格的字母连接而成,相邻单元指的是上下左右相邻.同一单元格的字母不能多次使用. 例如: 给出的字符数组= [↵ [&q ...
- python爬虫07BeautifulSoup
有一个高效的网页解析库 它的名字叫做 BeautifulSoup 它 是一个可以从 HTML 或 XML 文件中提取数据的 Python 库 首先我们要安装一下这个库 pip install be ...
- mysql优化之2--索引优化
1. 创建联合索引时,要注意,离散度大的列前置. 可以通过 select count(distinct(A)),count(distinct(B)) from tb; 看哪个列离散度大. 2. 索引列 ...