apt-get 源和常识

2023-05-16

本文内容:
1.apt-get的源换成阿里或163的
2.atp-get的源的常识

一、概述

安装好Ubuntu它自带源是国外的,访问较慢,经常会出现连接失败的情况。所以建议将它替换为国内的(如:阿里或163)。

二、替换方法

1、备份原始的Ubuntu源列表

# cp /etc/apt/sources.list /etc/apt/sources.list.backup

2、修改源列表文件

# gedit /etc/apt/sources.list

3、把里面的列表替换成下面的列表 

注意:各ubuntu的版本对应的atp-get的源不一样,不能填错,否则用apt-get安装软件报各种奇怪的错。

以下为Ubuntu12.04的atp-get源,如果是其它版本,请将版本名(precise )替换成正确的,对应关系如下:

ubuntu16.04 - xenial 
ubuntu15.10 - willy
ubuntu14.04 - trusty
ubuntu12.04 - precise

【阿里云】

deb http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse

【163源 http://mirrors.163.com/ 】

# deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]
deb http://mirrors.163.com/ubuntu/ precise main restricted
deb-src http://mirrors.163.com/ubuntu/ precise main restricted
deb http://mirrors.163.com/ubuntu/ precise-updates main restricted
deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted
deb http://mirrors.163.com/ubuntu/ precise universe
deb-src http://mirrors.163.com/ubuntu/ precise universe
deb http://mirrors.163.com/ubuntu/ precise-updates universe
deb-src http://mirrors.163.com/ubuntu/ precise-updates universe
deb http://mirrors.163.com/ubuntu/ precise multiverse
deb-src http://mirrors.163.com/ubuntu/ precise multiverse
deb http://mirrors.163.com/ubuntu/ precise-updates multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-updates multiverse
deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-security main restricted
deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted
deb http://mirrors.163.com/ubuntu/ precise-security universe
deb-src http://mirrors.163.com/ubuntu/ precise-security universe
deb http://mirrors.163.com/ubuntu/ precise-security multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-security multiverse
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main

4.更新软件源

# apt-get update


、atp-get源的常识

在 sources.list 文件中,我们看到很多“main,restricted,universe,multiverse”的字眼,这里顺便说一下它们的区别:

  • main —— 完全的自由软件。
  • restricted —— 不完全的自由软件。
  • universe —— ubuntu官方不提供支持与补丁,全靠社区支持。
  • muitiverse —— 非自由软件,完全不提供支持和补丁。

以及 precise 的字眼,其实 precise 是 Ubuntu 12.04 的 Code name,更多 Code name 如下所示:

  • Ubuntu 4.10 (Warty Warthog)
  • Ubuntu 5.04 (Hoary Hedgehog)
  • Ubuntu 5.10 (Breezy Badger)
  • Ubuntu 6.06 LTS (Dapper Drake)
  • Ubuntu 6.10 (Edgy Eft)
  • Ubuntu 7.04 (Feisty Fawn)
  • Ubuntu 7.10 (Gutsy Gibbon)
  • Ubuntu 8.04 LTS (Hardy Heron)
  • Ubuntu 8.10 (Intrepid Ibex)
  • Ubuntu 9.04 (Jaunty Jackalope)
  • Ubuntu 9.10 (Karmic Koala)
  • Ubuntu 10.04 LTS (Lucid Lynx)
  • Ubuntu 10.10 (Maverick Meerkat)
  • Ubuntu 11.04 (Natty Narwhal)
  • Ubuntu 11.10 (Oneiric Ocelot)
  • Ubuntu 12.04 LTS (Precise Pangolin)
  • Ubuntu 12.10 (Quantal Quetzal)
  • Ubuntu 13.04 (Raring Ringtail)
  • Ubuntu 13.10 (Saucy Salamander)
  • Ubuntu 14.04 LTS (Trusty Tahr)
  • Ubuntu 14.10 (Utopic Unicorn)
  • Ubuntu 15.04 (Vivid Vervet)
  • Ubuntu 15.10 (Wily Werewolf)
  • Ubuntu 16.04 LTS (Xenial Xerus)

那么,除了 apt-get update,我们平常还会看到 apt-get upgrade 以及 apt-get dist-upgrade,它们的区别是什么呢?查阅相关资料,有如下解释: 
An update should always be performed before an upgrade or dist-upgrade. upgrade is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list. Packages currently installed with new versions available are retrieved and upgraded. 
也就是说: 
apt-get update:是同步 /etc/apt/sources.list 和 /etc/apt/sources.list.d 中列出的源的索引,这样才能获取到最新的软件包。 
apt-get upgrade: 是升级已安装的所有软件包,升级之后的版本就是本地索引里的,因此,在执行 upgrade 之前一定要执行 update, 这样才能是最新的。由于包与包之间存在各种依赖关系,upgrade只是简单的更新包,不管这些依赖,它不和添加包,或是删除包。
apt-get dist-upgrade:可以根据依赖关系的变化,添加包,删除包。 

补充:Ubuntu 10.04 LTS (Lucid Lynx)

deb http://old-releases.ubuntu.com/ubuntu lucid main restricted universe multiverse   
deb http://old-releases.ubuntu.com/ubuntu lucid-security main restricted universe multiverse   
deb http://old-releases.ubuntu.com/ubuntu lucid-updates main restricted universe multiverse   
deb http://old-releases.ubuntu.com/ubuntu lucid-proposed main restricted universe multiverse   
deb http://old-releases.ubuntu.com/ubuntu lucid-backports main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid-security main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid-updates main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid-proposed main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid-backports main restricted universe multiverse  

 

 

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

apt-get 源和常识 的相关文章

随机推荐

  • 基于GEC6818的触摸屏

    1 输入子系统 连接操作系统的输入设备 xff0c 可不止一种 xff0c 也许是一个标准PS 2键盘 xff0c 也许是一个USB鼠标 xff0c 或者是一块触摸屏 xff0c 甚至是一个游戏机摇杆 xff0c Linux在处理这些纷繁各
  • c语言实现udp广播和组播

    目录 1 UDP广播通信 2 UDP组播通信 1 UDP广播通信 单播 xff1a 数据包发送方式只有一个接受方 广播 xff1a 同时发给局域网中的所有主机 只有用户数据报套接字 xff08 使用UDP协议 xff09 才能广播 以192
  • Odoo10 中常见的 Widget 整理

    Widget是什么 是odoo中字段的显示形式 Odoo内置的widget widget 61 34 mail thread 34 xff1a 消息标签 widget 61 34 html 34 xff1a html相关标签 widget
  • C语言入门篇——介绍篇

    目录 1 什么是C语言 1 C语言的优点 3 语言标准 4 使用C语言的步骤 5 第一个C语言程序 6 关键字 1 什么是C语言 1972年 xff0c 贝尔实验室的丹尼斯 里奇和肯 汤普逊在开发UNIX操作系统时设计了C语言 xff0c
  • 力扣刷题——双数之和

    很多人去力扣刷题都是数组的第一题 xff0c 也就是双数之和 xff0c 相信这也是很多人劝退题目 xff0c 甚至对自己学过的知识产生了怀疑 xff0c 这真的是我学完C语言 xff0c Java xff0c Python或C 43 43
  • C语言入门篇——自定义数据篇

    目录 1 结构体 1 2 匿名结构体 1 3 结构体的自引用 1 4 结构体的声明和初始化 1 5 结构体的内存对齐 1 6 修改默认对齐数 1 7 结构体传参 2 枚举 3 共用体 xff08 联合体 xff09 1 结构体 设计程序时
  • C语言入门篇——文件操作篇

    目录 1 为什么使用文件 2 什么是文件 2 1程序文件 2 2数据文件 2 3文件名 3 文件的打开和关闭 3 1文件指针 3 2文件的打开和关闭 4 文件的顺序读写 5 文件的随机读写 5 1fseek 5 2ftell 5 3rewi
  • 【C】模拟实现strlen,strcpy,strcat,strcmp,strncpy,syrcat,strnact,strncmp,strstr等字符串函数

    目录 字符串函数模拟实现 1 strlen模拟实现 2 strcpy模拟实现 3 strncpy模拟实现 4 strcat模拟实现 5 strncat模拟实现 6 strcmp模拟实现 7 strncmp模拟实现 8 strstr模拟实现
  • 【C】模拟实现memcpy,memmove内存函数

    目录 内存函数模拟实现 1 memcpy模拟实现 2 memmove模拟实现 3 测试案例代码 内存函数模拟实现 C 库函数 memcpy 从存储区 str2 复制 n 个字节到存储区 str1 这个函数在遇到 39 0 39 的时候并不会
  • 【C】模拟实现atoi,atof函数

    目录 atoi函数 atof函数 模拟实现atoi xff0c atof函数 1 atoi模拟实现 2 atof模拟实现 3 测试案例代码 atoi函数 atoi函数是将字符串转换成整数 函数头文件 xff1a include lt std
  • 英伟达JETSON XAVIER NX使用小记

    1 输入法问题 安装谷歌拼音 xff08 支持ARM64位系统 xff09 系统设置 gt 语言支持 gt 键盘输入法系统 gt 选择 fcitx gt 关闭 在终端中进行安装和部分卸载工作 xff1a sudo apt get insta
  • Spark | Stage进度条展示(showConsoleProgress)

    spark version 61 2 4 4 在执行Spark任务中 xff0c 经常会看到以下类似的Stage进度日志信息 xff0c 如下 xff1a Stage 0 gt 0 43 0 1753 Stage 0 gt 0 43 65
  • Ubuntu 安装odoo10 环境搭建

    安装时 xff0c 默认用户名为 odoo ubuntu 16开始 使用 systemd 管理服务 xff0c 但是systemd 兼容 sysv init 脚本 下载 odoo源码 从 http nightly odoo com 10 0
  • 无人机自动悬停的秘密

    无人机自动悬停的秘密 http www icpcw com Information Tech News 3244 324449 all htm 正文我来说两句 已有0 人参与 2014 11 11 10 36 18类型 xff1a 原创来源
  • ubuntu终端输入命令启动chrom浏览器

    文章目录 一 阻塞式打开 一 阻塞式打开 打开一个空白网页 google chrome 浏览指定网址 google chrome www baidu com google chrome https blog csdn net sandalp
  • C++之vector与指针

    文章目录 一 指向vector的指针1 amp xff1a 指向栈上的vector xff08 1 xff09 形式 xff08 2 xff09 局部变量自动释放 xff08 3 xff09 区分误区 2 new xff1a 指向堆上的ve
  • 《ROS机器人开发实践》第6.2.4节“在rviz中显示模型”问题总结

    输入 roslaunch mbot description display mbot base urdf launch后 xff0c 出现以下错误 解决方法 xff1a 在终端输入 source catkin ws devel setup
  • FreeRTOS堆栈溢出检查

    FreeRTOS堆栈溢出检查 RTOS任务都需要分配堆栈 xff0c 堆栈大小不合理 xff0c 会造成内存越界或者资源的浪费 如果在没有把握堆栈大小 xff0c 尽量将堆栈往大的方向设置 xff0c 这样能保证任务堆栈上下文切换不会溢出
  • PTZ云台开发过程中PELCO-D、PELCO-P协议遇到的问题

    最近学习了云台的一些东西 xff0c 比如云台的协议阿 xff0c 云台的调试什么 xff0c 通过这段时间努力终于把几个问题解决了 xff0c 一个是对于某个厂商 A 的云台出现的 pelco p 协议在波特率 2400 xff0c 48
  • apt-get 源和常识

    本文内容 xff1a 1 apt get的源换成阿里或163的 2 atp get的源的常识 一 概述 安装好Ubuntu它自带源是国外的 xff0c 访问较慢 xff0c 经常会出现连接失败的情况 所以建议将它替换为国内的 xff08 如