|
| 1 | +# Introduction to Unix (continued) |
| 2 | + |
| 3 | +In this part of the tutorial, we'll learn how to install programs in a Unix system |
| 4 | + |
| 5 | +## Using a package manager |
| 6 | + |
| 7 | +This is the most straight-forward way, and the way used by most of the people using unix at home, |
| 8 | +or administrating their own machine. |
| 9 | + |
| 10 | +This course is aimed at giving you a working knowledge of linux for bioinformatics, and in that setting, you will rarely, if ever, be the administrator of your own machine. The methods below are here as an information |
| 11 | + |
| 12 | +### On Ubuntu and Debian: Apt |
| 13 | + |
| 14 | +To install a software: |
| 15 | + |
| 16 | +`apt-get install name_of_the_software` |
| 17 | + |
| 18 | +to uninstall: |
| 19 | + |
| 20 | +`apt-get remove name_of_the_software` |
| 21 | + |
| 22 | +to update all installed softwares: |
| 23 | + |
| 24 | +``` |
| 25 | +apt-get update |
| 26 | +apt-get upgrade |
| 27 | +``` |
| 28 | + |
| 29 | +### On Fedora, CentOS and RedHat: yum |
| 30 | + |
| 31 | +To install a software: |
| 32 | + |
| 33 | +`yum install name_of_the_software` |
| 34 | + |
| 35 | +to uninstall: |
| 36 | + |
| 37 | +`yum remove name_of_the_software` |
| 38 | + |
| 39 | +to update: |
| 40 | + |
| 41 | +`yum update` |
| 42 | + |
| 43 | +### MacOS: brew |
| 44 | + |
| 45 | +Although there are no official package managers on MacOS, two popular, community-driven alternatives exist: macports and brew. |
| 46 | + |
| 47 | +Brew is particularly pupular within the bioinformatics community, and allows easy installation of many bioinformatics softwares on MacOS |
| 48 | + |
| 49 | +To install brew on your mac: |
| 50 | + |
| 51 | +`/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"` |
| 52 | + |
| 53 | +To install a software: |
| 54 | + |
| 55 | +`brew install name_of_the_software` |
| 56 | + |
| 57 | +To uninstall: |
| 58 | + |
| 59 | +`brew uninstall name_of_the_software` |
| 60 | + |
| 61 | +To update all brew-installed softwares: |
| 62 | + |
| 63 | +``` |
| 64 | +brew update |
| 65 | +brew upgrade |
| 66 | +``` |
| 67 | + |
| 68 | +More info on [brew.sh](http://brew.sh) and [brew.sh/homebrew-science/](http://brew.sh/homebrew-science/) |
| 69 | + |
| 70 | +## Downloading binaries |
| 71 | + |
| 72 | +In a university setting, you will rarely by administrator of your own machine. This is a very good thing for one reason: it's harder for you to break something! |
| 73 | + |
| 74 | +The downside is that it makes installing softwares more complicated. We'll start wit simply downloading the software and executing it, then we'll learn how to obtain packages from source code. |
| 75 | + |
| 76 | +for example, we'll install the blast binaries: |
| 77 | + |
| 78 | +First, download the archive: |
| 79 | +`wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ncbi-blast-2.6.0+-x64-linux.tar.gz` |
| 80 | + |
| 81 | +then unpack it and go to the newly created directory |
| 82 | + |
| 83 | +``` |
| 84 | +tar xzf ncbi-blast-2.6.0+-x64-linux.tar.gz |
| 85 | +cd ncbi-blast-2.6.0+ |
| 86 | +``` |
| 87 | + |
| 88 | +you should have a `bin` directory, go inside and look at the files. You have a bunch of executable files. |
| 89 | + |
| 90 | +### Execute a file |
0 commit comments