HostOnNet Blog

APT error Some index files failed to download

When running apt update, i get error

root@git:~# apt update
Hit:1 xenial InRelease
Get:2 xenial-updates InRelease [102 kB]
Get:3 xenial-backports InRelease [102 kB]
Get:4 xenial-updates/main amd64 Packages [474 kB]
Get:5 xenial-updates/main i386 Packages [465 kB]
Get:6 xenial-updates/universe amd64 Packages [397 kB]
Get:7 xenial-updates/universe i386 Packages [392 kB]
Fetched 1,932 kB in 0s (3,107 kB/s)
Reading package lists... Done
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?
E: Failed to fetch
E: Some index files failed to download. They have been ignored, or old ones used instead.
root@git:~# apt get install apt-transport-https
E: Invalid operation get

This is fixed by installing package apt-transport-https

root@git:~# apt install apt-transport-https
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-21 linux-headers-4.4.0-21-generic linux-headers-4.4.0-57 linux-headers-4.4.0-57-generic linux-image-4.4.0-21-generic linux-image-4.4.0-57-generic
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 28 not upgraded.
Need to get 26.0 kB of archives.
After this operation, 213 kB of additional disk space will be used.
Get:1 xenial-updates/main amd64 apt-transport-https amd64 1.2.19 [26.0 kB]
Fetched 26.0 kB in 0s (252 kB/s)
Selecting previously unselected package apt-transport-https.
(Reading database ... 146453 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_1.2.19_amd64.deb ...
Unpacking apt-transport-https (1.2.19) ...
Setting up apt-transport-https (1.2.19) ...

Posted in Ubuntu