linux换源_Centos换源教程
因为在线安装需要在服务器上下载需要软件和依赖关系⽂件,所以下载的速度很影响使⽤体验。⼀般来说,Linux默认的源安装和更新速度很慢,所以安装好系统⼀般会选择换源。-来⾃CSDN
为了让我们的linux更加快速的更新内核,软件等等,我们⼀般在安装完成后会进⾏换源操作(题主半个⽉前⽤gentoo忘记换源到时sync了⼀天也没完成)以获得更快的下载速度。
这篇⽂章以centos为例展⽰下换源基本操作。
sudo cp /pos.po /pos.po.bak
//备份数据
下⾯正式换源
nano /pos.po
把⾥⾯内容直接改为
# po
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[BaseOS]
name=CentOS-$releasever - Base
baseurl=mirror.lzu.edu/centos/$releasever/BaseOS/$basearch/os/
#mirrorlist=/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[AppStream]
name=CentOS-$releasever - AppStream
baseurl=mirror.lzu.edu/centos/$releasever/AppStream/$basearch/os/
#mirrorlist=/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[PowerTools]
name=CentOS-$releasever - PowerTools
baseurl=mirror.lzu.edu/centos/$releasever/PowerTools/$basearch/os/
#mirrorlist=/?release=$releasever&arch=$basearch&repo=PowerTools&infra=$infra enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=mirror.lzu.edu/centos/$releasever/extras/$basearch/os/
#mirrorlist=/?release=$releasever&arch=$basearch&repo=extras
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=mirror.lzu.edu/centos/$releasever/centosplus/$basearch/os/
#mirrorlist=/?release=$releasever&arch=$basearch&repo=centospluslinux系统安装步骤csdn
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
国际惯例我们使⽤兰州⼤学开源社区提供的镜像站点mirror.lzu.edu
LZUOSS yes!
改完直接Ctrl x退出保存
sudo yum makecache //重建缓存
到此换源完成,我们可以试着运⾏下更新指令:yum -y update
发现可以正常更新,即可以使⽤
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论