ISSUE:
apt-get update
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?
HOW TO FIX:
cd /usr/lib/apt/methods; ln -s http httpsTEST CONFIRM FIXED:
apt-get update
Tips for managing, administering Ubuntu servers. I have spent hundreds of hours working on Ubuntu serves. Some tasks are not very obvious to do and have wasted many hours of research and testing. I hope this guide can save time for other Ubuntu admins.
ISSUE:
apt-get update
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?
HOW TO FIX:
cd /usr/lib/apt/methods; ln -s http httpsTEST CONFIRM FIXED:
apt-get update
Are you getting these errors?
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/Packages 404 Not Found [IP: 91.189.88.142 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/restricted/binary-amd64/Packages 404 Not Found [IP: 91.189.88.142 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/universe/binary-amd64/Packages 404 Not Found [IP: 91.189.88.142 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/main/binary-i386/Packages 404 Not Found [IP: 91.189.88.142 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/restricted/binary-i386/Packages 404 Not Found [IP: 91.189.88.142 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/universe/binary-i386/Packages 404 Not Found [IP: 91.189.88.142 80]
SOLUTION
Try changing the domain names in /etc/apt/sources.list from
archive.ubuntu.com
security.ubuntu.com
to
old-releases.ubuntu.com
FINAL RESULT
Example content of /etc/apt/sources.list:
deb http://old-releases.ubuntu.com/ubuntu precise main restricted universe
deb http://old-releases.ubuntu.com/ubuntu precise-updates main restricted universe
deb http://old-releases.ubuntu.com/ubuntu precise-security main restricted universe multiverse
deb http://old-releases.canonical.com/ubuntu precise partner
sudo apt-get update
sudo apt-get dist-upgrade
reboot
nano /etc/ca-certificates.conf
find 'DST_Root_CA_X3.crt' then put an exclamation mark in front of the line, like this:
!mozilla/DST_Root_CA_X3.crt
sudo update-ca-certificates --fresh
Run these commands in the terminal:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32
This downloads the missing GPG keys (as mentioned in the original error message) from the Ubuntu GPG keyserver.
You can also add multiple keys with a single command:
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32 40976EAF437D05B5
This is a very quick and easy guide how to install SFTPGO on Ubuntu Server 18.xx or higher:
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:sftpgo/sftpgo
sudo apt install sftpgo
sudo systemctl status sftpgo
Then, you can access / use SFTP go from:
http://{whatever your IP}:8080
SFTP port is 2022
Are you getting the following error when executing 'sudo apt-get update'?
W: GPG error: http://security.ubuntu.com trusty-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://archive.ubuntu.com trusty-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://archive.canonical.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://archive.ubuntu.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
Here is how to fix it:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32
Then you can continue with:
sudo apt-get update
I encountered this error while trying to renew Let's Encrypt Certbot-Auto
/opt/eff.org/certbot/venv/bin/python: No module named pip.__main__; 'pip' is a package and cannot be directly executed
My webserver is using Ubuntu 12.04.3 LTS (precise).
My certbot-auto is located at /data_local/app/cron_shell/lets_encrypt (yours will be different)
I searched for a solution for 2 hours before finding this one that worked:
STEP 1 - MAKE COPY OF EXISTING CERTBOT-AUTO
cp /data_local/app/cron_shell/lets_encrypt/certbot-auto /data_local/app/cron_shell/lets_encrypt/certbot-auto-20201114
STEP 2 - EDIT THE CONTENTS OF CERTBOT-AUTO
pip_version = StrictVersion(check_output([python, '-m', 'pip', '--version'])
TO
pip_version = StrictVersion(check_output(['pip', '--version'])
- and -
command = [python, '-m', 'pip', 'install', '--no-index', '--no-deps', '-U']
TO
command = ['pip', 'install', '--no-index', '--no-deps', '-U']
STEP 3 - RETRY TO UPGRADE CERTBOT-AUTO
(a regular renew action without -no-upgrade will automatically do upgrade)
/data_local/app/cron_shell/lets_encrypt/certbot-auto renew