Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How do I install a package in Debian via SSH? In my case I'm looking to install OpenSSL, but the instructions could be for installing any other package as well.

UPDATE: I did run into some issues while attempting to install OpenSSL (package dependencies). For an answer on how to (clear package dependency issues) while installing packages in Debian, please refer to this answer.

share|improve this question

closed as off topic by quanta, Michael Hampton, John Gardeniers, womble, Sirex Aug 7 '12 at 3:17

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Simple questions help people whose primary role is not system administration. It also helps the advanced users of this site by generating the search engine hits and page views required to sustain ServerFault. Not sure why the down votes. –  amateur barista Aug 6 '12 at 7:55
2  
Probably because the question doesn't display any research effort. If you had answered your own question you probably wouldn't have received any downvotes. –  Ladadadada Aug 6 '12 at 8:11
    
I did research and did find the answer on other sites. I just wanted to put a very simple QA question on SF, that's what this site is for. And I also wanted someone else to get the points for answering it. I don't see any problem with that? "Probably because the question doesn't display any research effort" is an assumption. But OK. Thanks for the comment. –  amateur barista Aug 6 '12 at 8:18

4 Answers 4

up vote 1 down vote accepted

You can use apt-get or dpkg

sudo apt-get install packagename

or

dpkg -i package-file-name    
share|improve this answer

sudo apt-get install packagename

In your case

sudo apt-get install openssl, if I remember correctly.

share|improve this answer

You might also look into Aptitude, a mildly more modern alternative. Or Synaptic, if you want a full GUI.

sudo aptitude install somepackage

Or for interactive mode:

sudo aptitude
share|improve this answer
PKGPATH="$(apt-cache show openssl |grep ^Filename: |sed 's/^Filename: //')"
TDIR="$(mktemp -d)"
wget -O ${TDIR}/pkg.deb http://cdn.debian.net/debian/${PKGPATH}
pushd $TDIR
ar x pkg.deb
[ -x preinst ] && ./preinst install
tar xzf -C / data.tar.gz
[ -x postinst ] && ./postinst configure
popd
rm -rf $TDIR

Missing error handling, cleanup, version management (including picking the correct version based on all the magic apt does and passing the correct args to maintainer scripts), but basically functional in the minimal case.

share|improve this answer
    
Nice script. Thanks @womble. –  amateur barista Aug 6 '12 at 8:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.