Is there a way to install a deb package directly from a URL, using a shell? Something like
dpkg -i http://domain.com/path/to/package.deb
(I know I could use wget and then dpkg, I'm just wondering if there's something that does it already)
|
|
|
Edit: I didn't see your previous statement about knowing you could wget so this is a bit awkward... I'll leave this here for anybody who wants to know how to do this. Additionally the previous version of my answer didn't work but this version (at the expense of being somewhat longer) does:
You just need to alter the URL at the beginning. This could be aliased or written as a bash function. I realise there are technical and security issues surrounding this (you don't get automatic updates, can the source be trusted, etc), but on a purely can-I-do-it basis, this might work. |
||||
|
|
|
The quickest method is like this. Click to start installing shutter URLs used for clicking on the name:
... and for the click on the icon:
And yes you need Ubuntu Software center to finish the installation of a .DEB. Otherwise you will have to execute the installation from Nautilus or command line. Complete text used for this is for AskUbuntu only so you need to reformat this into an anchor:
More info can be found on the apturl wiki page:
So if the software is not in a default enabled repository you should add a 'section=' to it. Otherwise you can not use this method and need the user to download it and install themself. |
|||||||||||
|
|
I actually have a script that does something similar: Just copy and paste this script into
Then add this to the last line in
The script is just a wrapper for The script will just pass the arguments to
|
|||||||
|
|
Normally you would do this like
or maybe
but dpkg uses mmap to access the file so neither works (you have to manually create and remove a temporary file). There is a bug report about this: #367297 |
||||
|
|
|
You can append it to /etc/bash.bashrc as follows (it's an upgrade from Chen's script):
'dpkg-url'() {
COUNT=0
for package in "${urls[@]}"; do
if [[ $package = *http* ]]; then
urls+=("$package")
fi
dpkg_url="$dpkg_url "$package""
done
# Remove beginning and trailing spaces #
url=$(echo "$url" | sed -e 's/^ //g' -e 's/ $//g')
if [[ ! -z "$url" ]]; then
directory=$(mktemp -d);
trap 'rm -rf "$directory"' EXIT
cd "$directory" || exit
for package in "$url"; do
wget ""$package""
done
dpkg $dpkg_url "$directory"/*.deb
else
dpkg $dpkg_url
fi
}
though i do not see why i get this error when calling it as follows: dpkg-url -i http://downloads.sourceforge.net/ldview/ldview-4.2-beta1.x64.deb dpkg: error: need an action option Type dpkg --help for help about installing and deinstalling packages [*]; Use `dselect' or `aptitude' for user-friendly package management; Type dpkg -Dhelp for a list of dpkg debug flag values; Type dpkg --force-help for a list of forcing options; Type dpkg-deb --help for help about manipulating *.deb files; Options marked [*] produce a lot of output - pipe it through `less' or `more' ! |
|||
|
|