ubuntu更换软件源方法和实验成功软件源地址

ubuntu更换软件源方法

转载部分内容

这些bionic、main、restricted、universe、multiverse是什么意思呢,该怎么修改才对,实在是让人头大。简单了解一下:

bionic是指你的ubuntu版本代号,可以用 lsb_release -c 命令查看:
ubuntu 12.04 代号为precise
ubuntu 14.04 代号为trusty
ubuntu 15.04 代号为vivid
ubuntu 15.10 代号为wily
ubuntu 16.04 代号为xenial
ubuntu18.04 代号为bionic
如果不注意这个,可能拷贝别人的sources.list文件对应的ubuntu版本和你的不一样,就出错了

main、restricted、universe、multiverse的意义是:
main 即“基本”组件,其中只包含符合Ubuntu的协议要求并由Ubuntu团队维护支持的软件。
restricted 即“受限”组件,其中包含了非常重要的,但并不具有合适的自由协议的软件,如显卡驱动,同样有 ubuntu团队维护支持。
universe 即“社区维护”组件,其中包含的软件种类繁多,它们可能采用受限于协议,可能不是,但都不为ubuntu 团队维护。
multiverse 即“非自由”组件,其中包括了不符合自由软体要求而且不被Ubuntu团队支援的软件,通常为商业公司编写的软件。

其实不必了解他们的具体含义,最好的方法就是不改动它们,保持原样,只改动url部分,观察到我的sources.list中,url均为:http://ports.ubuntu.com/ubuntu-ports
那么改为阿里云的镜像节点URL就行了:
http://mirrors.aliyun.com/ubuntu/

可是改了以后,apt update仍然出现了很多404错误,查看错误信息才发现阿里云的镜像节点 http://mirrors.aliyun.com/ubuntu/ 只包含x86 x64的bin,并不包含arm的bin,怎么会这样呢,难道阿里云偷懒了吗?只拷贝了PC版ubuntu需要的包?
后来才发现不是这样的,是URL路径不对,应该改为 http://mirrors.aliyun.com/ubuntu-ports

重点
所以,直接生搬硬套copy网上的资料,是有可能会出问题的,最好,最简单,最靠谱的办法,就是打开你原本的/etc/apt/sources.list 只替换其中的host部分,其它部分一个字符都不要动
sudo vim /etc/apt/sources.list
:%s/ports.ubuntu.com/mirrors.aliyun.com/g
:wq
sudo apt update

perfect !

实验总结

实验成功的ubuntu软件源地址

装过完好ROS Kinetic 的ubuntu1604的软件源【http://mirrors.aliyun.com/ubuntu/电脑格式】

# deb cdrom:[Ubuntu 16.04.7 LTS _Xenial Xerus_ - Release amd64 (20200806)]/ xenial main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner

deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

树莓派ubuntu mate软件源【http://mirrors.aliyun.com/ubuntu-ports 其余不要动】

原始软件源地址未变的情况下更换方法

sudo vim /etc/apt/sources.list
:%s/ports.ubuntu.com/mirrors.aliyun.com/g
:wq
sudo apt update

换源更新成功

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-cwvBMkAu-1642925665035)(f:\Typora资源文件\1634483400101.jpg)]
在这里插入图片描述

成功安装gedit
在这里插入图片描述

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
回答: 要更换Ubuntu软件,你可以按照以下步骤进行操作。首先,根据你所使用的Ubuntu版本,找到对应的软件源地址。不同版本的Ubuntu有不同的源地址,每个版本都有自己专属的。默认情况下,Ubuntu使用的官方服务器位于欧洲,从国内访问速度较慢。因此,最好将官方更换为国内的。你可以选择阿里云或清华大学等其他。将原有的软件源地址替换为国内的镜像源地址,例如将默认的http://archive.ubuntu.com/ubuntu/替换为http://mirrors.aliyun.com/ubuntu/。你也可以使用命令sudo sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list来进行替换。另外,你还可以选择阿里云(http://mirrors.aliyun.com/ubuntu/)或清华(http://mirrors.tuna.tsinghua.edu.cn/ubuntu/)作为新的软件。这样就完成了Ubuntu软件更换。\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* *3* [Ubuntu更换软件](https://blog.csdn.net/m0_37564426/article/details/126809597)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Ubuntu更换软件的详细步骤](https://blog.csdn.net/qq_43577613/article/details/130892494)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值