Apt sources linux mint

How to Add a Package Repository to Debian, Ubuntu and Mint

A package repository (repo in short) is a location where software packages are stored and can be retrieved from. It is organized in a special directory tree, and usually contains an index file and the metadata needed by Linux package managers to access the packages in the repo and their dependencies.

Package managers such as APT (Advanced Packaging Tool – the default on Debian-like systems) enable you to automatically install and upgrade packages from a configured repo.

They also feature dependency resolution capabilities and software update checking. Besides, all package managers if not most, enable removing a package that is no longer needed.

Attention: Before we proceed, remember to only add software repositories from sources that you trust!

This guide shows how to add a package repository in Debian and Ubuntu Linux, as well as their derivatives such as Linux Mint.

Understanding APT Repository on Debian and Ubuntu

The APT package manager fetches packages from various repositories. A repository can be binary or source, and automatic or trivial. It can also be online or offline (for example on a CD-ROM) but the former is the more common use. Additionally, a repo can be official (maintained by Debian or Ubuntu/Canonical) or unofficial (third party).

A repository is defined in the /etc/apt/sources.list configuration file or in a file stored under the /etc/apt/sources.list.d directory. Every repo file must end with the .list extension.

List All APT Repositories

In a repository file, each line has the following syntax.

deb URI distribution component1 component2 … componentN OR deb-src URI distribution component1 component2 … componentN

The first parameter specifies the archive type (deb – for binary or deb-src – for source files), next is the URI – the root of the repository, then the distribution, and one or more components.

APT Repository File

Automatic APT Repositories

To define an automatic repository, you must specify one distribution and one or more components and the distribution must not end with a slash.

The following are examples of automatic repo definitions:

deb http://repository.spotify.com stable non-free deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 main deb https://download.mono-project.com/repo/ubuntu stable-focal main

Non-Automatic or Trivial APT Repositories

For non-automatic repos, the distribution specifies the relative path to the index files and it must end with a slash. Besides, no components may be specified.

deb http://cloud.r-project.org/bin/linux/debian bullseye-cran40/ deb file:///home/tecmint/rep-exact binary/

Importantly, APT relies on the local package index, a database of available packages from the repositories defined in the /etc/apt/sources.list file and files under the /etc/apt/sources.list.d directory. You can find the package index files under the /var/lib/apt/lists/ directory.

Читайте также:  Настройка web сервера linux mint

After making changes to the repo configurations, you must always update the local package index before installing or updating packages.

$ sudo apt update OR $ sudo apt-get update

Note: Usually, software owners or maintainers will provide a means either manually or automatically to add the required repository from which you can install their package(s) on your Linux system.

Let’s look at how to add the apt repository, as explained below.

Manually Adding APT Repository on Debian and Ubuntu

To add a repository manually, simply create the repo file under the /etc/apt/sources.list.d directory. We don’t recommend adding all repositories in the /etc/apt/sources.list file.

This example shows how to add the R software environment packages repository.

$ sudo vim /etc/apt/sources.list.d/r-packages.list

Copy and paste the repo configuration into the file and make sure that the parameters such as URI and distribution and components match what is defined in the repository:

deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/

Manually Add APT Repository

Then add the repository key using the following wget command.

$ wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc

Alternatively, you can also add the repo using the echo and tee commands as follows:

$ echo "deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/" | sudo tee /etc/apt/sources.list.d/r-packages.list $ wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc

Next, you need to update the local package index with the latest changes made in the repositories and then install a package from the repository, as follows:

$ sudo apt update $ sudo apt install --no-install-recommends r-base

To disable an apt repository, simply comment it out in the repository configuration file as shown in the following screenshot.

Disable APT Repository

Adding APT Repository Using apt-add-repository Command

The add-apt-repository command-line utility is used to add a repository into the /etc/apt/sources.list file or /etc/apt/sources.list.d directory. If a repository already exists, it can remove it using the -r flag.

If the add-apt-repository utility is not available on your system, you can install the software-properties-common package which provides it:

$ sudo apt update $ sudo apt install software-properties-common

Let’s look at the following example. The first command adds the repo and the second one retrieves the repo key using the wget utility and saves it to the specified file using the tee utility:

$ sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" $ wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc

If you try to add a repo that already exists, the add-apt-repository command will show the message “Repository already exists” as shown in the following screenshot.

Читайте также:  Установка python на astra linux

Repository Already Exists

The next step is to update the apt package index and install a package from the repository, as shown before:

$ sudo apt update $ sudo apt install --no-install-recommends r-base

Adding Personal Package Archives (PPAs)

PPAs are software repositories for publishing user-contributed software packages via Launchpad. This example shows how to add the Shutter screenshot tool’s official PPA.

$ sudo add-apt-repository ppa:shutter/ppa $ sudo apt-get update $ sudo apt install shutter

Removing a PPA Repository

To remove a repo using the apt-add-repository utility, use its -r or —remove flag as mentioned earlier:

$ sudo add-apt-repository -r "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"

Adding a Package Repository Using GUI Utilities

Last but not least, you can also add a repo to your system using a GUI application. On Ubuntu, open Software & Updates via the Activities search bar.

Then switch to the Other Software tab as highlighted in the following screenshot. Next, click Add and enter the repo configuration and follow the prompts.

Software & Updates Window

On Linux Mint, open your system menu and search for Software Sources, then open it. When asked to authenticate, enter your password to invoke the application with root privileges.

Next, click on the Additional Repositories tab, then click the Add button.

Additional Repositories

In the pop window, add the repo and click OK.

Add APT Repository

Once the repo has been added successfully, a message will display at the bottom of the window. Click OK to proceed.

APT Repository Added

Then wait for the local package index to update. Once it is OK, you can proceed to install packages from the just added repo.

Updating APT Cache

That’s it for now! In this guide, we have shown different ways to add a package repository in Debian and Ubuntu Linux, and their derivatives such as Linux Mint. For any comments or questions, reach us via the feedback form below.

Источник

Репозитории Linux Mint

Если вы только начали знакомиться с операционной системой Linux Mint, то вы впервые услышите слово репозиторий. Это слово вам будет встречаться в советах на форумах, в инструкциях по установке программ и в данной статье мы рассмотрим что это такое.

Репозиторий — это место, где хранятся и поддерживаются в актуальном состоянии данные. Применительно к Линукс Минт там хранятся файлы самой системы и всего доступного софта. Если совсем просто выразиться, то это сервер с обновлениями и файлами программ. В установленной системе имеется список стандартных репозиториев, но вы можете добавлять и новые. Как это можно сделать мы рассмотрим чуть позже, а пока что давайте рассмотрим стандартные.

linux_mint_Репозитории-Linux-Mint

Список репозиториев Linux Mint 17

deb http://packages.linuxmint.com qiana main upstream import
deb http://extra.linuxmint.com qiana main

deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ trusty partner

Список репозиториев Linux Mint 17.1

deb http://packages.linuxmint.com rebecca main upstream import
deb http://extra.linuxmint.com rebecca main

deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ trusty partner

Список репозиториев Linux Mint 17.2

deb http://packages.linuxmint.com rafaela main upstream import
deb http://extra.linuxmint.com rafaela main

deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ trusty partner

Читайте также:  Filezilla astra linux orel

Список репозиториев Linux Mint 17.3

deb http://packages.linuxmint.com rosa main upstream import
deb http://extra.linuxmint.com rosa main

deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ trusty partner

Список репозиториев Linux Mint 18

deb http://packages.linuxmint.com sarah main upstream import backport

deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ xenial partner

Как можно добавить и удалить новый репозиторий

Новый репозитории Linux Mint можно добавить несколькими способами:

1.С помощью терминала:

Любой ppa репозиторий можно добавить с помощью команды из терминала. Давайте рассмотрим в качестве примера репозиторий программы Simple Screen Recorder. Он имеет вид ppa:maarten-baert/simplescreenrecorder. Открываем терминал и вводим команду

sudo add-apt-repository ppa:maarten-baert/simplescreenrecorder

2. С помощью утилиты «Источники приложений»

Зайдите в Меню — Администрирование — Источники приложений и запустите утилиту.

Репозитории Linux Mint

На первой вкладке вы увидите официальные репозитории, их не трогаем и переходим на вкладку ppa-репозитории

Репозитории Linux Mint

Здесь можно добавлять, редактировать и удалять новые ppa репозитории (то, что мы делали с помощью терминала).

Переходим во вкладку Дополнительные репозитории.

Репозитории Linux Mint

Сюда добавляются все остальные репозитории, которые начинаются с deb (например, deb http://packages.linuxmint.com sarah main upstream import backport)

3. Редактирование репозиториев в текстовом редакторе

основные репозитории хранятся в файле /etc/apt/sources.list.d/official-package-repositories.list

дополнительные в файле /etc/apt/sources.list

Список полезных репозиториев для Linux Mint:

1) Для русификации архивов zip и rar

sudo add-apt-repository ppa:frol/zip-i18n

sudo apt-get update

sudo apt-get install libnatspec0 p7zip p7zip-full p7zip-rar

2) Программа с информацией об оборудовании

sudo add-apt-repository ppa:i-nex-development-team/stable

sudo apt-get update

sudo apt-get install i-nex

3) Последняя версия WINE

sudo add-apt-repository -y ppa:ubuntu-wine/ppa

4) Эмулятор оптических дисков

sudo add-apt-repository -y ppa:cdemu/ppa

sudo apt-get update

sudo apt-get install cdemu-client gcdemu

5) Программа для записи видео с рабочего стола

sudo add-apt-repository ppa:maarten-baert/simplescreenrecorder

sudo apt-get update

sudo apt-get install simplescreenrecorder

После добавления нового репозитория вам необходимо обновить список пакетов. Это делается при помощи команды:

Мы рассмотрели в статье основные репозитории, но если у вас есть дополнения, то пишем их в комментариях и мы дополним информацию. Удачи вам в освоении Linux Mint.

Источник

Оцените статью
Adblock
detector