从本地 Apt Repo 安装软件包时遇到问题

从本地 Apt Repo 安装软件包时遇到问题

我在从本地 apt-repo 安装软件包时遇到了一些问题。我按照以下指南设置了 apt repo,它似乎运行正常。当我运行 update-debs 命令和 apt-get update 时,它​​似乎将附加软件包添加到 Packages.gz 文件中。

https://help.ubuntu.com/community/Repositories/Personal

问题是,当我尝试安装该软件包时,系统提示我找不到该软件包。如果我运行apt-cache search $package_name

我收到的具体错误信息是E: Unable to locate package

附加信息

apt-get update 的输出

ops@ops-repo:~$ sudo apt-get update
Ign file: ./ InRelease
Ign file: ./ Release.gpg
Ign file: ./ Release
Ign http://mirrors.linode.com trusty InRelease
Ign http://mirrors.linode.com trusty-updates InRelease
Ign file: ./ Translation-en_US
Ign http://mirrors.linode.com trusty-backports InRelease
Ign file: ./ Translation-en
Hit http://mirrors.linode.com trusty Release.gpg
Hit http://mirrors.linode.com trusty-updates Release.gpg
Hit http://mirrors.linode.com trusty-backports Release.gpg
Hit http://mirrors.linode.com trusty Release
Hit http://mirrors.linode.com trusty-updates Release
Hit http://mirrors.linode.com trusty-backports Release
Hit http://mirrors.linode.com trusty/main Sources
Hit http://mirrors.linode.com trusty/restricted Sources
Hit http://mirrors.linode.com trusty/universe Sources
Hit http://mirrors.linode.com trusty/multiverse Sources
Hit http://mirrors.linode.com trusty/main amd64 Packages
Hit http://mirrors.linode.com trusty/restricted amd64 Packages
Hit http://mirrors.linode.com trusty/universe amd64 Packages
Hit http://mirrors.linode.com trusty/multiverse amd64 Packages
Hit http://mirrors.linode.com trusty/main i386 Packages
Hit http://mirrors.linode.com trusty/restricted i386 Packages
Ign http://security.ubuntu.com trusty-security InRelease
Hit http://mirrors.linode.com trusty/universe i386 Packages
Hit http://mirrors.linode.com trusty/multiverse i386 Packages
Hit http://mirrors.linode.com trusty/main Translation-en
Hit http://mirrors.linode.com trusty/multiverse Translation-en
Hit http://mirrors.linode.com trusty/restricted Translation-en
Hit http://mirrors.linode.com trusty/universe Translation-en
Hit http://security.ubuntu.com trusty-security Release.gpg
Hit http://mirrors.linode.com trusty-updates/main Sources
Hit http://mirrors.linode.com trusty-updates/restricted Sources
Hit http://mirrors.linode.com trusty-updates/universe Sources
Hit http://mirrors.linode.com trusty-updates/multiverse Sources
Hit http://mirrors.linode.com trusty-updates/main amd64 Packages
Hit http://mirrors.linode.com trusty-updates/restricted amd64 Packages
Hit http://mirrors.linode.com trusty-updates/universe amd64 Packages
Hit http://mirrors.linode.com trusty-updates/multiverse amd64 Packages
Hit http://mirrors.linode.com trusty-updates/main i386 Packages
Hit http://security.ubuntu.com trusty-security Release
Hit http://mirrors.linode.com trusty-updates/restricted i386 Packages
Hit http://mirrors.linode.com trusty-updates/universe i386 Packages
Hit http://mirrors.linode.com trusty-updates/multiverse i386 Packages
Hit http://mirrors.linode.com trusty-updates/main Translation-en
Hit http://mirrors.linode.com trusty-updates/multiverse Translation-en
Hit http://mirrors.linode.com trusty-updates/restricted Translation-en
Hit http://mirrors.linode.com trusty-updates/universe Translation-en
Hit http://mirrors.linode.com trusty-backports/main Sources
Hit http://mirrors.linode.com trusty-backports/restricted Sources
Hit http://mirrors.linode.com trusty-backports/universe Sources
Hit http://mirrors.linode.com trusty-backports/multiverse Sources
Hit http://mirrors.linode.com trusty-backports/main amd64 Packages
Hit http://mirrors.linode.com trusty-backports/restricted amd64 Packages
Hit http://mirrors.linode.com trusty-backports/universe amd64 Packages
Hit http://mirrors.linode.com trusty-backports/multiverse amd64 Packages
Hit http://mirrors.linode.com trusty-backports/main i386 Packages
Hit http://mirrors.linode.com trusty-backports/restricted i386 Packages
Hit http://mirrors.linode.com trusty-backports/universe i386 Packages
Hit http://security.ubuntu.com trusty-security/main Sources
Hit http://mirrors.linode.com trusty-backports/multiverse i386 Packages
Hit http://mirrors.linode.com trusty-backports/main Translation-en
Hit http://mirrors.linode.com trusty-backports/multiverse Translation-en
Hit http://mirrors.linode.com trusty-backports/restricted Translation-en
Hit http://mirrors.linode.com trusty-backports/universe Translation-en
Ign http://mirrors.linode.com trusty/main Translation-en_US
Hit http://security.ubuntu.com trusty-security/restricted Sources
Ign http://mirrors.linode.com trusty/multiverse Translation-en_US
Ign http://mirrors.linode.com trusty/restricted Translation-en_US
Ign http://mirrors.linode.com trusty/universe Translation-en_US
Hit http://security.ubuntu.com trusty-security/universe Sources
Hit http://security.ubuntu.com trusty-security/multiverse Sources
Hit http://security.ubuntu.com trusty-security/main amd64 Packages
Hit http://security.ubuntu.com trusty-security/restricted amd64 Packages
Hit http://security.ubuntu.com trusty-security/universe amd64 Packages
Hit http://security.ubuntu.com trusty-security/multiverse amd64 Packages
Hit http://security.ubuntu.com trusty-security/main i386 Packages
Hit http://security.ubuntu.com trusty-security/restricted i386 Packages
Hit http://security.ubuntu.com trusty-security/universe i386 Packages
Hit http://security.ubuntu.com trusty-security/multiverse i386 Packages
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/multiverse Translation-en
Hit http://security.ubuntu.com trusty-security/restricted Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Reading package lists... Done

我添加了一个ops.list目录,其中/etc/apt/sources.d/包含以下行:

deb file:/usr/local/debs ./

我相信这就是 apt-get update 顶部谈到时所引用的内容Ign file:

答案1

我经历过类似的事情,最后发现安装软件包可以正常工作,即使apt-cache policy package说它不可用,并抛出了您报告的错误消息,但是用 而N:不是E:。 (但是,apt-cache search package为我返回空输出,而不是错误消息。)

运行straceapt-cache发现,它只打开了其中的一部分文件/var/lib/apt/lists——具体来说,它似乎绕过了我的私人仓库,可能是因为它的文件名有点搞笑(myserver.internal_%7etripleee_repo_Packages)。

相关内容