| |
|
开发:
C++知识库
Java知识库
JavaScript
Python
PHP知识库
人工智能
区块链
大数据
移动开发
嵌入式
开发工具
数据结构与算法
开发测试
游戏开发
网络协议
系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程 数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁 |
-> 系统运维 -> Ubuntu apt sources.list -> 正文阅读 |
|
[系统运维]Ubuntu apt sources.list |
目录 Understanding sources.list File: The operating system needs a mechanism to install packages easily as needed. Packages can be hosted on a webserver or FTP server of the Linux distribution from where users can download and install it. These webservers or FTP servers are called package repository. You also need a way to manage (install, remove, download) these packages from the package repository. So a package manager is included on your favorite Linux distribution.? Ubuntu is based on Debian GNU/Linux distribution. Ubuntu uses the APT (Advanced Package Tool) package manager to manage packages. The APT package manager and all the graphical front ends (Ubuntu Software Center, Muon, aptitude etc) uses the sources.list file to learn about which package repository or repositories to use. The APT package manager and all its graphical frontends gets the package repository information from /etc/apt/sources.list file and files from the /etc/apt/sources.list.d directory. Understanding sources.list File:The contents of the /etc/apt/sources.list file looks something like this. An APT line starts with deb, which means this package repository distributes software packages as pre compiled binaries in deb file format. An APT line may also start with deb-src, which means the package repository distributes software packages as source codes, which you will have to compile in your own computer in order to use. By default, all the deb-src package repositories are disabled on Ubuntu. you have to type in the short codename of your Ubuntu operating system. It is different for each version of Ubuntu. For example, in Ubuntu 18.04 LTS, it is bionic. You can find out what it is for your distribution with the following command: lsb_release -cs ?It may be? bionic-updates, bionic-security, bionic-backports,bionic-proposed。 The Ubuntu package repository is divided into main, restricted, universe and multiverse sections. Update sources.list File:You can chage? /etc/apt/sources.list file. After this, you must run 'sudo apt update' to make it effective. Chinese aliyun source:
分析下阿里的源:
其中,比较重要的就是 进入 各组文件夹都是以下格式命名的:
其中xxx就是Ubuntu不同版本的代号. e.g., ?他们文件夹的差别在于:
进入bionic目录: ? 有main, multiverse, restricted, universe文件夹,对应sources.list中的: 这些文件夹里面包含了不同软件包索引,区别在于:
如果我们打开main目录下的binary-i386子目录下的Packages.gz文件,可以看到里面是对一个个Package的描述:
说明: Packages.gz这个文件是一个“索引”文件,里面记录了各种包的包名Package、运行平台(Architecture)、版本号(Version)、依赖关系(Depends)、deb包地址(Filename)等 。注意到Filename指向的是源服务器pool目录下的某个deb。因此可以猜测,apt-get install 某个软件时,其实就是基于这些Packages.gz来计算依赖关系,然后根据其中的Filename地址来下载所需的deb,然后再执行dpkg -i xxx.deb来完成软件包的安装。 Installing with apt-getAfter you’ve edited and updated sources.list , all you need to do is log in as root and type:
For example, to install the GIMP, you would enter:
Notice that no version number is needed. Instead, apt-get installs the latest version of the package in all the available sources. If none of the versions is newer than what is already installed, then nothing is installed. If you choose, however, you can choose a particular version number. For example, to install version 2.2 of the GIMP, type:
|
apt 命令 | 取代的命令 | 命令的功能 |
---|---|---|
apt install | apt-get install | 安装软件包 |
apt remove | apt-get remove | 移除软件包 |
apt purge | apt-get purge | 移除软件包及配置文件 |
apt update | apt-get update | 刷新存储库索引 |
apt upgrade | apt-get upgrade | 升级所有可升级的软件包 |
apt autoremove | apt-get autoremove | 自动删除不需要的包 |
apt full-upgrade | apt-get dist-upgrade | 在升级软件包时自动处理依赖关系 |
apt search | apt-cache search | 搜索应用程序 |
apt show | apt-cache show | 显示安装细节 |
当然,apt 还有一些自己的命令:
新的apt命令 | 命令的功能 |
---|---|
apt list | 列出包含条件的包(已安装,可升级等) |
apt edit-sources | 编辑源列表 |
?
REF:
详解Ubuntu的source.list文件_VinQin的博客-CSDN博客_sourcelist
Ubuntu 20.04系统更改apt源为阿里源_孤寒者的博客-CSDN博客_apt淘宝源
Understanding and Using sources.list for Ubuntu
|
|
上一篇文章 下一篇文章 查看所有文章 |
|
开发:
C++知识库
Java知识库
JavaScript
Python
PHP知识库
人工智能
区块链
大数据
移动开发
嵌入式
开发工具
数据结构与算法
开发测试
游戏开发
网络协议
系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程 数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁 |
360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 | -2024/11/15 20:23:55- |
|
网站联系: qq:121756557 email:121756557@qq.com IT数码 |