我无法从互联网获取更新。我想到我的防火墙,但我不知道需要允许哪些协议或端口通过防火墙才能使其正常工作。
答案1
Apt 支持一些协议,列在man sources.list
。默认通常为 HTTP,但 FTP 和 HTTPS 存储库也可用。请检查您的/etc/apt/sources.list
以确保无误。由于您可以在 URI 中指定端口(如deb http://foo.bar:9090/xyz ...
),因此也可以使用非标准端口。
URI SPECIFICATION
The currently recognized URI types are:
http (apt-transport-http(1))
The http scheme specifies an HTTP server for an archive and is the
most commonly used method. The URI can directly include login
information if the archive requires it, but the use of
apt_auth.conf(5) should be preferred. The method also supports
SOCKS5 and HTTP(S) proxies either configured via apt-specific
configuration or specified by the environment variable http_proxy
in the format (assuming an HTTP proxy requiring authentication)
http://user:pass@server:port/. The authentication details for
proxies can also be supplied via apt_auth.conf(5).
Note that these forms of authentication are insecure as the whole
communication with the remote server (or proxy) is not encrypted so
a sufficiently capable attacker can observe and record login as
well as all other interactions. The attacker can not modify the
communication through as APTs data security model is independent of
the chosen transport method. See apt-secure(8) for details.
https (apt-transport-https(1))
The https scheme specifies an HTTPS server for an archive and is
very similar in use and available options to the http scheme. The
main difference is that the communication between apt and server
(or proxy) is encrypted. Note that the encryption does not prevent
an attacker from knowing which server (or proxy) apt is
communicating with and deeper analyses can potentially still reveal
which data was downloaded. If this is a concern the Tor-based
schemes mentioned further below might be a suitable alternative.
file
The file scheme allows an arbitrary directory in the file system to
be considered an archive. This is useful for NFS mounts and local
mirrors or archives.
cdrom
The cdrom scheme allows APT to use a local CD-ROM, DVD or USB drive
with media swapping. Use the apt-cdrom(8) program to create cdrom
entries in the source list.
ftp
The ftp scheme specifies an FTP server for an archive. Use of FTP
is on the decline in favour of http and https and many archives
either never offered or are retiring FTP access. If you still need
this method many configuration options for it are available in the
Acquire::ftp scope and detailed in apt.conf(5).
Please note that an FTP proxy can be specified by using the
ftp_proxy environment variable. It is possible to specify an HTTP
proxy (HTTP proxy servers often understand FTP URLs) using this
environment variable and only this environment variable. Proxies
using HTTP specified in the configuration file will be ignored.
copy
The copy scheme is identical to the file scheme except that
packages are copied into the cache directory instead of used
directly at their location. This is useful for people using
removable media to copy files around with APT.
rsh, ssh
The rsh/ssh method invokes RSH/SSH to connect to a remote host and
access the files as a given user. Prior configuration of rhosts or
RSA keys is recommended. The standard find and dd commands are used
to perform the file transfers from the remote host.
adding more recognizable URI types
APT can be extended with more methods shipped in other optional
packages, which should follow the naming scheme
apt-transport-method. For instance, the APT team also maintains the
package apt-transport-tor, which provides access methods for HTTP
and HTTPS URIs routed via the Tor network.
答案2
Apt-get 使用 http、https 或 ftp(取决于您的 source.list)。