Ubuntu18.04更换国内源的方法示例

Ubuntu本身的源使用的是国内的源,下载速度比较慢,不像CentOS一样yum安装的时候对镜像站点进项选择,

所以选择了更换成国内的源。

以下内容整合自网络

备份/etc/apt/sources.list文件
mv /etc/apt/sources.list /etc/apt/sourses.list.backup

新建/etc/apt/sources.list文件并添加以下内容

#163源
deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse

更改完成之后执行以下命令

# apt update
# apt upgrade

其他的一些apt命令

sudo apt-get update 更新源
sudo apt-get install package 安装包
sudo apt-get remove package 删除包
sudo apt-cache search package 搜索软件包
sudo apt-cache show package 获取包的相关信息,如说明、大小、版本等
sudo apt-get install package --reinstall 重新安装包
sudo apt-get -f install 修复安装
sudo apt-get remove package --purge 删除包,包括配置文件等
sudo apt-get build-dep package 安装相关的编译环境
sudo apt-get upgrade 更新已安装的包
sudo apt-get dist-upgrade 升级系统
sudo apt-cache depends package 了解使用该包依赖那些包
sudo apt-cache rdepends package 查看该包被哪些包依赖
sudo apt-get source package 下载该包的源代码
sudo apt-get clean && sudo apt-get autoclean 清理无用的包
sudo apt-get check 检查是否有损坏的依赖

其他几个国内的源:

#中科大源
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

#阿里云源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

#清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持我们。

(0)

相关推荐

  • Ubuntu17.04配置更换国内源的方法

    ### 修改源命令: sudo vi /etc/apt/source.list ### 把source.list内容替换成下面其中一个源 ##阿里云 deb http://mirrors.aliyun.com/ubuntu/ zesty main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ zesty-security main restricted universe multiverse deb ht

  • Ubuntu使用国内源出现Hash Sum mismatch错误的解决

    我们在更新Ubuntu软件源为国内源(比如163)之后,update出现下面这样的错误: W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.163.com_ubuntu_dists_trusty-security_main_source_Sources  Hash Sum mismatch E: Some index files failed to download. They have been ignored, or ol

  • ubuntu16.10安装docker17.03.0-ce并配置国内源和加速器

    说明:这个针对docker-ce安装,ce和ee的区别是前者是社区版,后者是企业版 1.  配置Ubuntu的源,不然慢的去哭吧.参考https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/注意版本要对应.我的源配置见附件http://xiazai.jb51.net/201705/yuanma/sources_jb51.rar. 2. 安装docker,按照官方教程https://docs.docker.com/engine/installation/l

  • Ubuntu18.04更换国内源的方法示例

    Ubuntu本身的源使用的是国内的源,下载速度比较慢,不像CentOS一样yum安装的时候对镜像站点进项选择, 所以选择了更换成国内的源. 以下内容整合自网络 备份/etc/apt/sources.list文件 mv /etc/apt/sources.list /etc/apt/sourses.list.backup 新建/etc/apt/sources.list文件并添加以下内容 #163源 deb http://mirrors.163.com/ubuntu/ bionic main rest

  • Manjaro、pip、conda更换国内源的方法

    Manjaro 切换镜像源.执行以下命令,在稍后的弹窗中选择延迟最低的即可. sudo pacman-mirrors -i -c China -m rank 设置archlinuxcn源.在/etc/pacman.conf中添加以下命令,中科大源和清华源添加其中一个就可以了: [archlinuxcn] SigLevel = Optional TrustedOnly #中科大源 Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch #清华源

  • 将WSL系统更换国内源的方法(固定路径+国内镜像源+详细教程)

    目录 1.找到wsl镜像源 2.替换镜像源 2.1 可以直接用记事本打开 2.2 通过sudo进行修改 3.更新镜像源列表 1.找到wsl镜像源 首先,我们找到自己的wsl镜像源所在的地方,在cmd中输入**\wsl$** 按enter可以看到自己的wsl在这里了 如果不想以后难找,可以通过给一个网络映射添加网络位置,这样就可以直接进入啦 完成之后就在网络位置可以看见快捷进入的文件夹了 打开文件夹,进入etc/apt文件夹,可以看见sources.list这一个文件,里面就是WSL-Ubuntu

  • Ubuntu 20.04 apt 更换国内源的实现方法

    UPD 2020.2.26 目前 Ubuntu 20.04 LTS 还未发布, 教程仅适用于 development branch (不过这种教程应该是通用的) 图形界面操作 - 适用于 desktop 版本 在桌面右上角点击打开菜单,点击设置选项. 在设置选项右侧下拉找到"关于",点击 Software Updates. 在软件和更新界面里可以看到"下载自",我们可以进行修改. 推荐选择 mirros.aliyun.com 或者 mirrors.tuna.tsin

  • Ubuntu14.04和Ubuntu16.04更换阿里源的方法

    换成国内最快的阿里云源 第一步:备份原来的源文件 cd /etc/apt/ 然后会显示下面的源文件sources.list 输入命令 sudo cp sources.list sources.list.bak 就是将sources.list备份到sources.list.bak 第二步:替换源 阿里云源的文件 deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb http://mi

  • CentOS8 yum/dnf 配置国内源的方法

    CentOS 8更改了软件包的安装程序,取消了 yum 的配置方法,改而使用了dnf 作为安装程序.虽然改变了软件包的安装方式,但是 dnf 还是能兼容使用 yum 的配置文件的和命令的使用方法的.不过我并不知道这个兼容配置会持续多久和国内的镜像(这里使用的是阿里云镜像)路径是否会做修改,所以才在标题添加了临时标志. 这里也就不过多讲解了,直接上文件: # file: /etc/yum.repos.d/CentOS-AppStream.repo [AppStream] name=CentOS-$

  • Ubuntu20.04修改ip地址的方法示例

    说明: 今天在继续上次的办公协作平台实验的时候发现虚拟机因为之前是DHCP的方式获取的ip地址,而这次虚拟机开机后DHCP获取的地址变更了,因为网站上已经配置了固定ip地址访问,导致不能访问网页,所以需要修改ip地址为上次获取的ip地址才能访问,查了一下ubuntu怎么修改ip地址才发现"ubuntu从17.10开始,已放弃在/etc/network/interfaces里固定IP的配置,即使配置也不会生效,而是改成netplan方式 ,配置写在/etc/netplan/01-netcfg.ya

  • Python pip配置国内源的方法

    众所周知,Python使用pip方法安装第三方包时,需要从https://pypi.org/资源库中下载,但是会面临下载速度慢,甚至无法下载的尴尬,这时,你就需要知道配置一个国内源有多么重要了,通过一番摸索和尝试,总结了一些经验,分享给大家: 首先贴一下下载速度的对比图: 图1:国外官网下载 图2:国内镜像下载 给大家推荐几个值得拥有的国内镜像站 [ 个人推荐清华大学pypi镜像站(https://mirrors.tuna.tsinghua.edu.cn/help/pypi/),每五分钟同步一次

  • Ubuntu18.04(linux)安装MySQL的方法步骤

    安装 mysql sudo apt-get --purge remove mysql-server mysql-common mysql-client sudo apt-get install mysql-server mysql-common mysql-client mysqladmin -u root password your-new-password sudo /etc/init.d/mysql restart mariadb apt-get install mariadb-serve

随机推荐