我尝试过使用sudo apt-get install apt-transport-https
,但对我来说不起作用。
sudo apt-get update
E: The method driver /usr/lib/apt/methods/https could not be found.
sudo apt-get install apt-transport-https
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package apt-transport-https is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'apt-transport-https' has no installation candidate
我的etc/apt/sources.list
# deb cdrom:[Ubuntu 13.04 _Raring Ringtail_ - Release amd64 (20130424)]/ raring main restricted
deb http://ubuntu.mirror.atratoip.net/ubuntu/ raring main restricted
deb-src http://ubuntu.mirror.atratoip.net/ubuntu/ raring restricted universe multiverse main #Added by software-properties
## Major bug fix updates produced after the final release of the
## distribution.
deb http://ubuntu.mirror.atratoip.net/ubuntu/ raring-updates main restricted
deb-src http://ubuntu.mirror.atratoip.net/ubuntu/ raring-updates restricted main multiverse universe #Added by software-properties
deb http://ubuntu.mirror.atratoip.net/ubuntu/ raring universe
deb http://ubuntu.mirror.atratoip.net/ubuntu/ raring-updates universe
deb http://ubuntu.mirror.atratoip.net/ubuntu/ raring multiverse
deb http://ubuntu.mirror.atratoip.net/ubuntu/ raring-updates multiverse
deb http://ubuntu.mirror.atratoip.net/ubuntu/ raring-backports main restricted universe multiverse
deb-src http://ubuntu.mirror.atratoip.net/ubuntu/ raring-backports main restricted universe multiverse #Added by software-properties
deb http://ubuntu.mirror.atratoip.net/ubuntu/ raring-security main restricted
deb-src http://ubuntu.mirror.atratoip.net/ubuntu/ raring-security restricted main multiverse universe #Added by software-properties
deb http://ubuntu.mirror.atratoip.net/ubuntu/ raring-security universe
deb http://ubuntu.mirror.atratoip.net/ubuntu/ raring-security multiverse
## Uncomment the following two lines to add software from Canonical\'s
## \'partner\' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu raring partner
deb-src http://archive.canonical.com/ubuntu raring partner
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu raring main
deb http://archive.canonical.com/ raring partner
deb-src http://archive.canonical.com/ raring partner
deb-src http://extras.ubuntu.com/ubuntu raring main
答案1
我无法让确切的命令行变体工作,但我可以浏览到
http://ubuntu.mirror.atratoip.net/ubuntu/pool/main/a/apt/
我在哪里找到最新版本的 apt-transport-https,在我的例子中是
apt-transport-https_0.9.7.7ubuntu6_i386.deb
然后我下载了它,双击 deb 文件并安装它。现在一切似乎又正常工作了。
答案2
看了您的 sources.list 之后,我仍然不太明白为什么apt
需要https
(也许是一些额外的来源/etc/apt/sources.list.d
?),但要apt-transport-https
安装,您可以这样做:
sudo wget http://ubuntu.mirror.atratoip.net/ubuntu/pool/main/a/apt/apt-transport-https_0.9.7.7ubuntu5_$(dpkg-architecture -qDEB_HOST_ARCH).deb && sudo dpkg -i apt-transport-https_0.9.7.7ubuntu5_$(dpkg-architecture -qDEB_HOST_ARCH).deb
该dpkg-architecture
命令用于确定系统的体系结构。您也可以将其替换为i386
或amd64
。