Monday, April 25, 2022

How to fix "The method driver /usr/lib/apt/methods/https could not be found."

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 https



TEST CONFIRM FIXED:

apt-get update



Saturday, January 8, 2022

How to fix missing files / packages during apt-get for Ubuntu 12.04 LTS

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

Wednesday, October 20, 2021

How to fix 'certificate, issued by ‘/C=US/O=Let's Encrypt/CN=R3’: Issued certificate has expired.'

How to fix 'certificate, issued by ‘/C=US/O=Let's Encrypt/CN=R3’:   Issued certificate has expired.'

This how-to has been tested on Ubuntu 14.xx and higher and may also work on some older Debian OS.

Step 1 - You have to update your operating system to latest minor version:

sudo apt-get update

sudo apt-get dist-upgrade

reboot


Step 2 - Comment out DST_Root_CA_X3.crt

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


Step 3 - Force Update Certificates

sudo update-ca-certificates --fresh


Step 4 - Retest

Your expired Root CA X3 certificate has now been updated!




How to fix NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32

 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

How to install SFTPGO on Ubuntu 18.xx and higher

 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


Monday, October 11, 2021

How to fix apt-get update GPG "NO PUBKEY" error?

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

 

Saturday, November 14, 2020

/opt/eff.org/certbot/venv/bin/python: No module named pip.__main__; 'pip' is a package and cannot be directly executed

 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