[clug] Can dpkg install from a url?

Scott Ferguson scott.ferguson.clug at gmail.com
Thu Feb 28 20:50:58 MST 2013

On 01/03/13 14:06, Carlo Hamalainen wrote:
> On Fri, Mar 1, 2013 at 12:36 PM, Scott Ferguson <
> scott.ferguson.clug at gmail.com> wrote:
>> Um, maybe a Ubuntu users forum isn't always the best indicator of what
>> Debian package management can do.
> What about CLUG? :)

Though you jest, I'll answer the question seriously. For the most part -
in over a decade of reading the CLUG lists I'd rate it as more reliable
than anywhere other than Debian development lists (for Debian related

> No need to re-invent the wheel, both wget and curl can download from a
>> url, and dpkg will install. eg:-
>> $ wget $url;su -c "dpkg -i $DownloadedPackage"
> I've done that in some scripts and there are annoying corner cases, e.g. if
> the file exists you end up with blah.deb.1, blah.deb.2, etc, and you have
> to remove the file afterwards. 

Corner cases? dunno about curl because I don't use it as often (and I
don't have time to search the man).

If the file already exists then it will be downloaded to a differently
named instance unless you have noclobber set in wgetrc.
1. wget http://somewhere/somethingIveAlreadyGot-versionEtc.deb
will leave the original somethingIveAlreadyGot-versionEtc.deb intact
2. su -c "dpkg -i somethingIveAlreadyGot-versionEtc.deb" will install
the original copy.... so I don't see the problem.

If you're on a tight download budget and unable to check for the
existence (grep mlocate) of an existing copy - just use the -r switch
for wget

I'm not sure why you'd need to remove the file afterwards.

> RPM deals with this.
> You could script it properly as a one liner in .bash_aliases (%1 to get
>> $url and sed that for $DownloadedPackage) or a module in .bashrc.
>> I'd be *very* wary of installing packages from a url. Better to use a
>> signed, trusted repostitory - or check out the source and make a package
>> from that.
>> You could maybe also create a little script that did "su -c "dpkg -i %1"
>> and associate the script with the .deb extension in Iceweasel/whatever
>> browser...
> I'll take this all as a 'no' to my original question :)

Yes. Using wget or curl.
And *no* because wget and curl already exist.

Why isn't there an approved wrapper? (probably) For the same reasons
it's recommended to use holster not underpants for carrying handguns. :)

Your question was *"Can dpkg install from a url?"* (not can dpkg install
from a url without any other packages involved, though rpm can't, and
it's not the Unix way) :D

The body of your post then described using rpm to install a package
signature, and download a package from a rpm repository.

Which is like asking if you can sweeten an unripe pineapple with vinegar
like you can with seawater... the answer is no. But you can with salt.

A Debian equivalent of the scenario you described uses apt, not dpkg.
And that can be done in the same manner

apt-get -d/i/s install some package

, or with fuse, or p2p/torrent.

Kind regards

More information about the linux mailing list