Linux посмотреть подключенные репозитории

How do I find out which repository a package comes from?

This is ambiguous. Do you mean: which currently enabled repositories provide a package with the given name, or: which repository was used to install the package with that name that is currently installed? (Both are useful. I’m looking for the latter, not the former.)

@ReinierPost If you know which enabled repositories provide the package, you can determine which one was used based on the version of the package that is provided by each repository. If you are unsure which version is installed, run dpkg -l | awk ‘/^ii/’

7 Answers 7

Use following command. It has better output:

For Ubuntu 16.04 and later there is a shorter way to do that:

This is the correct answer! The commands in the answer by mac9416 need tedious interpretation + guessing based on their output. For more information about apt-cache policy see also superuser.com/a/236605/61370

apt-cache policy is good but some times you need apt-cache showpkg to compare MD5 sums from package. See also debsums —changed

This should be the accepted answer! @pabouk is right. This answer’s more relevant to the question than the currently accepted one.

Like @pablo-bianchi pointed out in his answer, an even simpler apt policy can be used, from 16.04LTS onwards. Once 14.04LTS becomes EOL’d in 2018, this answer maybe edited to use the newer command.

Читайте также:  Linux change password all users

Edit:

Check out SuB’s answer. Looks a bit simpler!

Original:

Commands Needed:

  • dpkg -s — allows you to find the version of that you have installed. (source)
  • apt-cache showpkg — will show a list of Versions of the package available. For each version, the source of the package, in the form of an index file name, will be given.

If you want to find the source of the package that’s currently installed, you’ll need the output of dpkg -s . Otherwise, you can simply look at the newest version output by apt-cache showpkg .

Example:

$ dpkg -s liferea Package: liferea Status: install ok installed Priority: optional Section: web Installed-Size: 760 Maintainer: Ubuntu Developers Architecture: i386 Version: 1.6.2-1ubuntu6 . $ apt-cache showpkg liferea Package: liferea Versions: 1.6.2-1ubuntu6.1 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid-updates_main_binary-i386_Packages) Description Language: File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid-updates_main_binary-i386_Packages MD5: 557b0b803b7ed864e6d14df4b02e3d26 1.6.2-1ubuntu6 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages) (/var/lib/dpkg/status) Description Language: File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages MD5: 557b0b803b7ed864e6d14df4b02e3d26 . 

From the first command, I can see that Liferea version 1.6.2-1ubuntu6 is installed. From the second command, I can see that that version is listed in /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-i386_Packages .

Without too much effort, I can deduce that the source line contains archive.ubuntu.com , ubuntu , lucid , and main .

And, sure enough, my /etc/apt/sources.list contains the following line.

deb http://archive.ubuntu.com/ubuntu lucid main universe restricted multiverse 

Источник

How to List Installed Repositories In Ubuntu & Debian

A repository is the collection of packages for a Linux operating system. You can create a central repository containing the actual packages. Then configure your other systems to connect with the main repository. From where, you can install, update packages.

The Ubuntu and other Debian based systems uses APT (Advanced Packages Tool) as package manager. Apt keeps all the configuration files under /etc/apt directory.

Читайте также:  Logitech 960 usb headset linux

This tutorial will help you to list all installed repositories under a Ubuntu or Debian based system via command line.

List Installed Repositories In Ubuntu

The remote repository references are configured in /etc/apt/sources.list file and all files under /etc/apt/sources.list.d/ directory.

Use the following command to list all the configured repositories on apt based system:

sudo grep -rhE ^deb /etc/apt/sources.list* 

You will see the output like below:

deb http://mirrors.digitalocean.com/ubuntu/ xenial main restricted deb-src http://mirrors.digitalocean.com/ubuntu/ xenial main restricted deb http://mirrors.digitalocean.com/ubuntu/ xenial-updates main restricted deb-src http://mirrors.digitalocean.com/ubuntu/ xenial-updates main restricted deb http://mirrors.digitalocean.com/ubuntu/ xenial universe deb-src http://mirrors.digitalocean.com/ubuntu/ xenial universe . . . deb http://security.ubuntu.com/ubuntu xenial-security universe deb-src http://security.ubuntu.com/ubuntu xenial-security universe deb http://security.ubuntu.com/ubuntu xenial-security multiverse deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

Alternatively, you can use apt-cache command to list all repositories. This command will provide also provide more details about the repository.

Package files: 100 /var/lib/dpkg/status release a=now 500 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 Packages release v=16.04,o=LP-PPA-ondrej-php,a=xenial,n=xenial,l=***** The main PPA for supported PHP versions with many PECL extensions *****,c=main,b=amd64 origin ppa.launchpad.net 500 https://deb.nodesource.com/node_13.x xenial/main amd64 Packages release o=Node Source,n=xenial,l=Node Source,c=main,b=amd64 origin deb.nodesource.com . . . 500 http://mirrors.digitalocean.com/ubuntu xenial/main amd64 Packages release v=16.04,o=Ubuntu,a=xenial,n=xenial,l=Ubuntu,c=main,b=amd64 origin mirrors.digitalocean.com Pinned packages:

Conclusion

In this tutorial, you have learned to find all the repositories configured on Ubuntu or Debian based system.

Источник

🐧 Как вывести список установленных репозиториев в Ubuntu и Debian

Репозиторий – это набор пакетов для операционной системы Linux.

Оттуда вы можете устанавливать, обновлять пакеты.

Ubuntu и другие системы на основе Debian используют APT (Advanced Packages Tool) в качестве диспетчера пакетов.

Apt хранит все файлы конфигурации в каталоге /etc/apt.

Это руководство поможет вам составить список всех установленных репозиториев в системе на основе Ubuntu или Debian через командную строку.

Читайте также:  Mint linux based on ubuntu

Список установленных репозиториев в Ubuntu

Ссылки на удаленные репозитории настраиваются в файле /etc/apt/sources.list и во всех файлах в каталоге /etc/apt/sources.list.d/.

Используйте следующую команду, чтобы вывести список всех настроенных репозиториев в системе на основе apt:

sudo grep -rhE ^deb /etc/apt/sources.list* 

Вы увидите результат, как показано ниже:

deb http://mirrors.digitalocean.com/ubuntu/ xenial main restricted deb-src http://mirrors.digitalocean.com/ubuntu/ xenial main restricted deb http://mirrors.digitalocean.com/ubuntu/ xenial-updates main restricted deb-src http://mirrors.digitalocean.com/ubuntu/ xenial-updates main restricted deb http://mirrors.digitalocean.com/ubuntu/ xenial universe deb-src http://mirrors.digitalocean.com/ubuntu/ xenial universe . . . deb http://security.ubuntu.com/ubuntu xenial-security universe deb-src http://security.ubuntu.com/ubuntu xenial-security universe deb http://security.ubuntu.com/ubuntu xenial-security multiverse deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

Кроме того, вы можете использовать команду apt-cache для вывода списка всех репозиториев.

Эта команда также предоставит более подробную информацию о репозитории.

Давайте попробуем следующую команду:

Package files: 100 /var/lib/dpkg/status release a=now 500 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 Packages release v=16.04,o=LP-PPA-ondrej-php,a=xenial,n=xenial,l=***** The main PPA for supported PHP versions with many PECL extensions *****,c=main,b=amd64 origin ppa.launchpad.net 500 https://deb.nodesource.com/node_13.x xenial/main amd64 Packages release o=Node Source,n=xenial,l=Node Source,c=main,b=amd64 origin deb.nodesource.com . . . 500 http://mirrors.digitalocean.com/ubuntu xenial/main amd64 Packages release v=16.04,o=Ubuntu,a=xenial,n=xenial,l=Ubuntu,c=main,b=amd64 origin mirrors.digitalocean.com Pinned packages:

Заключение

В этом руководстве вы научились находить все репозитории, настроенные в системе на основе Ubuntu или Debian.

Источник

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