从 sources.list.d 获取包源

Get package source from sources.list.d

我想下载 suricata 包的源代码

我确实添加了以下 repo

sudo add-apt-repository ppa:oisf/suricata-stable

如果我安装包我得到最新版本

$ suricata -V
This is Suricata version 6.0.4 RELEASE

但是当我尝试下载源代码时

$ apt source suricata
Reading package lists... Done
NOTICE: 'suricata' packaging is maintained in the 'Git' version control system at:
https://alioth.debian.org/anonscm/git/pkg-suricata/pkg-suricata.git
Please use:
git clone https://alioth.debian.org/anonscm/git/pkg-suricata/pkg-suricata.git
to retrieve the latest (possibly unreleased) updates to the package.
Need to get 11.8 MB of source archives.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (dsc) [2,768 B]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (tar) [11.7 MB]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (diff) [20.3 kB]
Fetched 11.8 MB in 1s (10.3 MB/s)   
dpkg-source: info: extracting suricata in suricata-3.2
dpkg-source: info: unpacking suricata_3.2.orig.tar.gz
dpkg-source: info: unpacking suricata_3.2-2ubuntu3.debian.tar.xz
dpkg-source: info: applying reproducible.patch
dpkg-source: info: applying debian-default-cfg.patch
dpkg-source: info: applying optional-hyperscan.patch
$ ls
suricata-3.2  suricata_3.2-2ubuntu3.debian.tar.xz  suricata_3.2-2ubuntu3.dsc  
suricata_3.2.orig.tar.gz

我得到旧版本。

有没有办法从新添加的 repo 中获取源代码?

我确实已经查看了 git 回购协议,但我对 apt source 或类似内容的实际命令更感兴趣。

这一行:

Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (dsc) [2,768 B]

会告诉您包是从哪里下载的,它来自 universe 存储库。

您需要为添加的PPA启用源码包:

echo "deb-src http://ppa.launchpad.net/oisf/suricata-stable/ubuntu bionic main" |
sudo tee -a /etc/apt/sources.list.d/oisf-suricata-stable-bionic.list
sudo apt update
apt source suricata