我正在尝试安装一些软件包。我已经将 s 下载.deb
到我的本地存储库,并且apt
由于显示了该软件包,因此我知道这apt-cache policy
一点,但是在尝试安装该软件包时,它会再次尝试下载 s .deb
。请告诉我如何防止这种情况发生?
请注意我已经看到了https://askubuntu.com/questions/347913/why-apt-get-doesnt-download-from-local-repository和为我的本地存储库分配最高优先级(前一个提到的)。但即使在使用之后/etc/apt/preferences
,尽管本地包被显示为第一个项目apt-cache policy
,我的问题仍然存在。请参阅下面的示例:
$ sudo apt-get -y install --print-uris clang | grep "http://"
'http://in.archive.ubuntu.com/pool/main/b/binfmt-support/binfmt-support_2.1.4-1_amd64.deb' binfmt-support_2.1.4-1_amd64.deb 49048 MD5Sum:fd7c64c41dc4633a7b4e02e8e9246bcd
'http://in.archive.ubuntu.com/pool/universe/l/llvm-toolchain-3.4/clang-3.4_3.4-1ubuntu3_amd64.deb' clang-3.4_1%3a3.4-1ubuntu3_amd64.deb 8921842 MD5Sum:45c1b69f8daecd1060f65e1595b03e88
'http://in.archive.ubuntu.com/pool/universe/l/llvm-defaults/clang_3.4-0ubuntu1_amd64.deb' clang_1%3a3.4-0ubuntu1_amd64.deb 2476 MD5Sum:76820e828365b314d85a28e4b174c62e
$ apt-cache policy binfmt-support clang clang-3.4
binfmt-support:
Installed: (none)
Candidate: 2.1.4-1
Version table:
2.1.4-1 0
999 file:/home/samjnaa/ab/trusty/orig_amd64_a-g/ Packages
500 http://in.archive.ubuntu.com/ trusty/main amd64 Packages
clang:
Installed: (none)
Candidate: 1:3.4-0ubuntu1
Version table:
1:3.4-0ubuntu1 0
999 file:/home/samjnaa/ab/trusty/orig_amd64_a-g/ Packages
500 http://in.archive.ubuntu.com/ trusty/universe amd64 Packages
clang-3.4:
Installed: (none)
Candidate: 1:3.4-1ubuntu3
Version table:
1:3.4-1ubuntu3 0
999 file:/home/samjnaa/ab/trusty/orig_amd64_a-g/ Packages
500 http://in.archive.ubuntu.com/ trusty/universe amd64 Packages
$ cat /etc/apt/preferences
Package: *
Pin: origin ""
Pin-Priority: 999
$
我正在使用 Trusty LTS 14.04.2。请注意,我没有使用,/etc/apt/sources.list
但我有四个文件1-local.list
,,2-net-orig.list
和3-net-thirdparty.list
,4-net-ppas.list
并且/etc/apt/sources.list.d/
它们按所需的优先级顺序编号。