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

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或路径。 存储库使用类型等

Add Repository To The Sources.list
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
LEARN MORE  How To List All Repository Packages With Yum Command
了解更多信息如何使用Yum命令列出所有存储库软件包

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值