快速是没办法,只是可以借鉴理解后才能快速
repo文件理解为地图,里面是寻找rpm包的导游
多个repo的时候可以使用优先级来选择先听哪个导游去哪取rpm包;
建议使用以下两种源
163、epel
163源安装例子
cd /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
yum clean all
yum makecache
epel源安装例子
yum -y install epel-release
3.repo源设置下优先级
yum -y install yum-priorities
sed -i '/gpgkey=/a priority=1' /etc/yum.repos.d/CentOS-Base.repo
sed -i '/gpgkey =/a priority=2' /etc/yum.repos.d/CentOS6-Base-163.repo
sed -i '/gpgkey=/a priority=3' /etc/yum.repos.d/epel.repo
sed -i 's/\#baseurl/baseurl/g' /etc/yum.repos.d/epel.repo
sed -i 's/mirrorlist/\#mirrorlist/g' /etc/yum.repos.d/epel.repo
yum clean all
yum makecache
至此大体的服务安装都可以通过yum安装了。
1、配置163yum源
[root@localhost iso]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
rhel-source.repo
[root@localhost yum.repos.d]# cp rhel-source.repo iso.repo
[163]
name=163
baseurl=http:/****************
gpgcheck=0
enabled=1
[163] --------------->必须写的,中括号的内容可以随便写,但一定要有中括号
name = 163r ----------->可写可不写,内容随便,主要是个提示作用
baseurl=http://mirrors.163.com/centos/7/os/x86_64/ --------------->你要到http://mirrors.163.com/centos这里,去找到你对应的redhat版本的目录,然后点os、再点x86_64(一般都有),然后用你地址栏上显示的网址替换上面的baseurl就行了,保存退出。
enabled=1 --------------------->数字1为启用当前yum源,0为禁用,默认为1。
gpgcheck=0 ----------------------->是否检查rpm包的数字签名,数字1为检查,0为不检查,可以不写。
安装软件进行测试,“yum -y install mysql”,成功安装后会在结尾出现“Complete!”.安装成功
具体参考:网页链接
centos配置yum源 网络yum源配置 1.把默认yum源备份(可选)#mkdir /opt/centos-yum.bak #mv /etc/yum.repos.d/* /opt/centos-yum.bak/2.查看系统版本cat /etc/redhat-release //查看系统的版本CentOS Linux release 7.2.1511 (Core) 3.下载aliyun yum源repo文件(对应自己的系统版本下载即可)CentOS 5wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo CentOS 6wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo CentOS 7wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget http://mirrors.163.com/.help/CentOS7-Base-163.repo wget http://mirrors.aliyun.com/repo/Centos-7.repo4. 清除缓存#yum clean all#yum makecache //把yum源缓存到本地,加快软件的搜索好安装速度#yum list //总共列出了9954个包centos镜像源配置 上传镜像到服务器cd /mntmkdir cdrom //新建挂在目录mount 镜像名称 /mnt/cdrom //挂载镜像cd /etc/yum.repos.dcp -r yum.repos.d yum.repos.d.bak //备份repos.d文件rm -rf /etc/yum.repos.d/* //清空repos.d目录下文件touch local.repo//新建repo文件vi local.repo//编辑repo文件 [yum]name=centos7.6baseurl = file:///mnt/cdrom //镜像挂载目录gpgcheck =0enabled =1 退出:wqyum clean allYum makecache局域网yum源配置 1.备份yum源rm -f /etc/yum.repos.d/*cat>/etc/yum.repos.d/local.repo 2.查看系统版本cat /etc/redhat-release //查看系统的版本CentOS Linux release 7.2.1511 (Core) 3.编辑yum配置文件vi /etc/yum.repos.d/local.repo 【yum】name= centos7.5baseurl=http://ip地址/yum/centos7.2gpgcheck =0enabled =1 4.清楚缓存yum clean allyum makecachedeepin系统配置apt-get 1.备份source.list文件cp /etc/apt/source.list /etc/apt/source.list.bak 2、编辑源列表文件(网络源把网址换成ali或163地址即可) vim /etc/apt/source.listdeb http://ip地址:/yum/deepin kui main contrib non-free3.更新apt缓存4.apt-get updatemain由符合DFSG标准的软件包组成,不依赖于main外的软件来运行。这是debian发行时默认启用的仓库组成。contrib 软件包包含符合DFSG标准的软件,但依赖项不在main中(可能是非自由的Debian打包)。non-free非自由,包含不符合DFSG的软件。lion、panda 是发行版的仓库代号 通过apt命令已安装软件apt list --installeddpkg -lubuntu配置网络apt源1.备份源文件备份 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak2.查看新版本信息lsb_release -c得到系统的系统代号:我们可以看到新版本的Ubuntu系统代号为bionic同样的我们也可以得到之前任意版本的系统代号:Ubuntu 12.04 (LTS)代号为precise。Ubuntu 14.04 (LTS)代号为trusty。Ubuntu 15.04 代号为vivid。Ubuntu 15.10 代号为wily。Ubuntu 16.04 (LTS)代号为xenial。3.编辑源列表文件sudo vi /etc/apt/sources.list 4.将原有的内容注释掉,添加以下内容 (src-源码)deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse5.更新软件列表运行如下命令:sudo apt-get update 6.更新软件包运行如下命令:sudo apt-get upgrade银河麒麟系统配置apt网络源 1、查看系统版本cat /proc/version 2、备份原list文件cd /etc/aptsudo cp sources.list sources.list.bak3、编辑新list文件vi sources.listdeb http://mirrors.163.com/debian/ jessie main non-free contrib deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib deb-src http://mirrors.163.com/debian/ jessie main non-free contrib deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib4、更新apt源 sudo apt-get clean apt-get update 5、安装软件包 apt-get install ant欢迎分享,转载请注明来源:内存溢出
评论列表(0条)