欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

如何在Linux中将新的存储库添加到Apt?

程序员文章站 2022-06-26 17:12:50
...

Apt is a mainstream package management tool. Apt is used by Debian, Ubuntu and a lot of different distributions. Package administration job can be done with Apt very easily. Installing new packages, removing packages, updating packages, resolving dependency of packages, etc. Big distributions like Debian, Ubuntu provides repositories. There are a lot of 3 party repositories provides up to date and useful packages. How can we add these repositories to our Linux system?

Apt是主流的软件包管理工具。 Apt被Debian,Ubuntu和许多其他发行版使用。 使用Apt可以轻松完成软件包管理工作。 安装新软件包,删除软件包,更新软件包,解决软件包依赖性等。像Debian这样的大发行版中,Ubuntu提供了存储库。 3方存储库中提供了很多最新的实用软件包。 我们如何将这些存储库添加到我们Linux系统中?

将存储库添加到Sources.list (Add Repository To The Sources.list)

Sources.list hold repository information and configuration like repository package URL or path. Repository usage type etc.

Sources.list包含存储库信息和配置,例如存储库包URL或路径。 存储库使用类型等

如何在Linux中将新的存储库添加到Apt?
Add Repository To The Sources.list
将存储库添加到Sources.list

Add following line so the /etc/apt/sources.list file

添加以下行,以便/etc/apt/sources.list文件

deb http://us.archive.ubuntu.com/ubuntu/ yakkety universe
  • deb means we want to add only binary packages from URL

    deb表示我们只想从URL添加二进制包

  • saucy is the release of the distribution

    狡猾是发行版的发行

  • universe enables community provided free packages too

    Universe也使社区能够提供免费软件包

使用Add-apt-repository添加存储库(Add Repository With Add-apt-repository)

We have a more practical way to add a repository. Using add-apt-repository is easier.

我们有一种更实用的方法来添加存储库。 使用add-apt-repository更容易。

$ sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ yakkety universe"
  • Providing -y  will all questions yes

    提供-y将所有问题是

四个主要存储库(Four Main Repositories)

There are four main repository effects installation of packages. All repository type includes different type of packages as described below

软件包的安装主要有四个作用。 所有存储库类型都包括不同类型的软件包,如下所述

  • Main – Canonical-supported free and open-source software.

    主要-规范支持的免费和开源软件。

  • Universe – Community-maintained free and open-source software.

    Universe –社区维护的免费和开源软件。

  • Restricted – Proprietary drivers for devices.

    受限–设备的专有驱动程序。

  • Multiverse – Software restricted by copyright or legal issues.

    Multiverse –受版权或法律问题限制的软件。

.Update Apt缓存以获取新的软件包列表 (.Update Apt Cache To Get New Package List)

We will update our repository caches to get a new list of packages

我们将更新存储库缓存以获取新的软件包列表

$ apt-get update
了解更多信息如何使用Yum命令列出所有存储库软件包

翻译自: https://www.poftut.com/add-new-repository-apt-linux/