Debian – debian lenny patch to allow apt-get to work with sftp


I would like to write things like this in /etc/apt/sources.list:

deb s other stuff

When I try this, apt-get complains that there is no sftp method for apt:

# apt-get update
E: The method driver /usr/lib/apt/methods/sftp could not be found.

Has anyone written a patch to add the sftp method for apt? All I could find in Google was this spec for Ubuntu.

Thanks for your help.

edit: I forgot to mention that I currently use the ssh method, and it works fine. The reason why I'm looking for an sftp method is that I want to setup the repository in a chrooted environment on the server, for more security. I find it difficult to setup and maintain a chrooted environment usable with ssh (because you need binaries and their dependencies inside the chrooted environment, and you need to maintain those in case they need security updates), as opposed to a chrooted environment for sftp (simply using the appropriate sshd_config options).

Best Answer

This line will need to be in your /etc/apt/sources.list

deb ssh:// /path/to/packages/on_the_server/

You'll probably want to setup auto key login and things of that nature. You'll also need to mirror the packages down to a server you control in order to install them this way. Because you'll need an account on the server.