I needed to update drush to 7.x in order to use with drupal 8. Drush is now on github and directions to update have changed some.

1. Create a github account (if you don't already have one)
2. Add your ssh key to github profile
3. Go to home>drush folder and remove all contents including hidden files
4. cd ~/drush
5. git clone git@github.com:drush-ops/drush.git .
6. drush cc drush

You can check the version with
drush version

Thanks Mike for your help in irc!

Comments

mike stewart’s picture

Ok, I looked at this post, and think the following is easier and slightly more correct:

Open a terminal, (F4 key) or CTRL-ALT-T, and then type (think you can cut & paste -- but no time to test at the moment):

cd ~                                                          # Ensure in home folder
mv -t ~/.local/share/Trash/files --backup=t drush             # Poorman method to move drush to Gnome Trash, delete as desired
git clone https://github.com/drush-ops/drush.git drush        # Get drush from new home repo
cd drush                                                      # Change to new repo
rm -rf ~/.drush/cache                                         # Remove drush cache

You've now cloned, and are on the latest commit of drush. It is compatible with Drupal8, and this might be all you need. The rest is optional / informational.

#git tag                                                      # list releases, then checkout a tag, examples:
                                                              # To checkout a stable version of drush do one of these:
#git checkout 7.x-5.9                                         # checkout latest stable (Drupal 7), currently 7.x-5.9
#git checkout 8.x-6.0-rc4                                     # current Release Canidate, potentially more stable than master; compatible with Drupal8 (or Drupal7)
# Note: to run a command above, remove the hash at the beginning

Also note, as of this writing there is a bit of a bug with drush dl ... I think clearing drush (not drupal) cache will fix (in a terminal run this: rm -rf ~/.drush/cache). Also, using an altered ~/.drush/d7.make makefile is also a (temporary) solution.

C13L0’s picture

Thanks so much! I haven't tested this method but will try to spin up a new vm in a few days and give it a go.

niccolox’s picture

sorry to say I get errors on this

its a clean Drupalpro image

12:58:12 ~/websites$ drush qc --domain=d8git2.dev --makefile=d8git.make
                                                                                                                                                                            [ok]
Creating dns config (add d8git2.dev to /etc/hosts) ...                                                                                                                      [ok]
                                                ... done.                                                                                                                   [ok]
Creating database: d8git2_dev                                                                                                                                               [ok]
                                                ... done.                                                                                                                   [ok]
Downloading code to /home/drupalpro/websites/d8git2.dev (takes a minute, check network activity) ...                                                                        [ok]
Beginning to build /home/drupalpro/.drush/d8git.make.                                                                                                                       [ok]
Unable to clone drupal from git://git.drupal.org/project/drupal.git.                                                                                                        [error]
Source directory /tmp/make_tmp_1385499513_52950b79d2f7c/__build__/sites/default/default.settings.php is not readable or does not exist.                                     [error]
chmod(): No such file or directory make.utilities.inc:387                                                                                                                   [warning]

Fatal error: Uncaught exception 'Exception' with message ' in /home/drupalpro/drupalpro/drush_addons/quickstart/quickstart.inc on line 30

Exception: 
  chown: cannot access `/home/drupalpro/websites/d8git2.dev': No such file or directory in /home/drupalpro/drupalpro/drush_addons/quickstart/quickstart.inc on line 30

Call Stack:
    0.0004     373716   1. {main}() /home/drupalpro/drush/drush.php:0
    0.0209    3528652   2. drush_main() /home/drupalpro/drush/drush.php:16
    0.3216    9072248   3. _drush_bootstrap_and_dispatch() /home/drupalpro/drush/drush.php:61
    0.5720    9078272   4. drush_dispatch() /home/drupalpro/drush/drush.php:92
    1.0747    9086344   5. call_user_func_array() /home/drupalpro/drush/includes/command.inc:182
    1.0747    9086536   6. drush_command() /home/drupalpro/drush/includes/command.inc:0
    1.0750    9086700   7. _drush_invoke_hooks() /home/drupalpro/drush/includes/command.inc:214
    1.0770    9111084   8. call_user_func_array() /home/drupalpro/drush/includes/command.inc:362
    1.0770    9111276   9. drush_quickstart_fixperms() /home/drupalpro/drush/includes/command.inc:0
    1.0901    9116048  10. quickstart_shell_exec() /home/drupalpro/drupalpro/drush_addons/quickstart/quickstart.drush.inc:205

Drush command terminated abnormally due to an unrecoverable error.                                                                                                          [error]
Error: Uncaught exception 'Exception' with message '
  chown: cannot access `/home/drupalpro/websites/d8git2.dev': No such file or directory' in /home/drupalpro/drupalpro/drush_addons/quickstart/quickstart.inc:30
Stack trace:
#0 /home/drupalpro/drupalpro/drush_addons/quickstart/quickstart.drush.inc(205): quickstart_shell_exec('sudo chown -R :...')
#1 [internal function]: drush_quickstart_fixperms()
#2 /home/drupalpro/drush/includes/command.inc(362): call_user_func_array('drush_quickstar...', Array)
#3 /home/drupalpro/drush/includes/command.inc(214): _drush_invoke_hooks(Array, Array)
#4 [internal function]: drush_command()
#5 /home/drupalpro/drush/includes/command.inc(182): call_user_func_array('drush_command', Array)
#6 /home/drupalpro/drush/drush.php(92): drush_dispatch(Array)
#7 /home/drupalpro/drush/drush.php(61): _drush_bootstrap_and_dispatch()
#8 /home/drupalpro/drush/drush.php(16): drush_main()
#9 {main}
  thrown in /home/drupalpro/drupalpro/drush_addons/quickstart/quickstart.inc, line 30
                                                ... done.                                                                                                                   [ok]
Creating apache config (/etc/apache2/sites-enabled/d8git2.dev)                                                                                                              [ok]
                                                ... done.                                                                                                                   [ok]
Running installer (takes a minute, check cpu activity) ...                                                                                                                  [ok]
file_get_contents(/home/drupalpro/websites/d8git2.dev/CHANGELOG.txt): failed to open stream: No such file or directory quickstart.inc:285                                   [warning]
Command site-install needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command.                   [error]
The drush command 'site-install standard' could not be executed.                                                                                                            [error]
The directory /home/drupalpro/websites/d8git2.dev does not contain a valid Drupal installation                                                                              [error]
                                                                                                                                                                            [ok]
URL:  http://d8git2.dev
Admin user:  admin
Admin password: admin
                                                ... done.                                                                                                                   [ok]
Command completed successfully.             
niccolox’s picture

I worked around it by doing git clone of latest d8 into another folder, copying across and have install Drupal 8 :>

haven't tried Drush yet

niccolox’s picture

Drush works fine, using head

note, there seems to be permissions problems in general after updating Drush with above method

patoshi’s picture

Issue summary: View changes

using a fresh vm of drupalpro and i just did a "git pull" in the directory: ~/drush and then did a git checkout 7.x-5.9 ---- and thats it.

sirtet’s picture

I got from Drush 5.8 to 8.0.0-rc3 like this:

First i copy-pasted the first block of commands in comment #1.

After that i tried drush version, which brought an error:

Unable to load autoload.php. Drush now requires Composer in order to install its dependencies and autoload classes. Please see README.md

Next i did composer install

And there i was.
Thanks Mike.

sirtet’s picture

I could now also upgrade to 8.0.1 the same way.
8.0.2 did not work, it needs PHP 5.5.9.
i am on 5.4.45, As going to 5.5 breaks things in my drupalpro VM...