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方法/
步骤步骤1:在Vmware中,确保iso镜像已经正常连接到系统上,在虚拟机上右键-设置-虚拟机设置,按照如图勾选和设置。
步骤2:可以看到在linux桌面,已经出现了一个ISO镜像。
步骤3:建立挂载点,在root用户下mkdir /mnt/cdrom来创建目录。
步骤4:输入mount -t iso9660 /dev/cdrom /mnt/cdrom将光驱或者iso文件挂载到/mnt/cdrom目录下,使用df -h可以看到已经成功挂载。
步骤5:进入/etc/yum.repos.d目录,ls查看当前目录下的yum源配置文件,新建bak目录,将除CentOS-Media.repo之外的repo文件移动到bak文件夹备份
Linux配置本地yum源方法
步骤6:使用vi编辑文件CentOS-Media.repo,查看配置如下,
步骤7:按照如下配置修改
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///mnt/cdrom/ //路径需与你光驱或ISO挂载的路径相同
gpgcheck=1
enabled=1 //enable后面值必须修改为1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-CentOS-6,
步骤8:输入“yum clean all”命令清理,
步骤9:可以使用yum -y install vim进行安装测试。
评论列表(0条)