2

I currently have ownCloud installed via apt-get. I followed a guide a while back to get later versions than the official Raspbian repository. /etc/apt/sources.list.d/owncloud.list contains the following.

deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_7.0/ /

(I'm actually running Raspbian Jessie 8, but I never updated the link to 8. Both seem to have the same contents though.)

This installs ownCloud 8.1.8-12.1. I'd like to install a later version, preferably the latest 9.0.2. I know I can install later versions manually, but I'd prefer to let apt-get take care of it for me. Is there a more up-to-date repository for ownCloud and Raspbian? I can't find any information at all on the official ownCloud site about Raspbian packages.

  • Owncloud uses their own upgrade system triggered in browser as indicated in the link you named "manually" I do not understand why you wish to use apt-get. Either way I do not believe that it is possible as own cloud is using a proprietary system. – Mohammad Ali May 28 '16 at 2:03
  • @MohammadAli Owncloud is described in wikipedia as a FOSS system, not proprietary; it appears to be written in PHP and the server code is available for download. Further, Debian does package it which they will not do for non-FOSS software, period. Perhaps you are thinking of Dropbox. – goldilocks May 28 '16 at 3:54
  • @goldilocks debian packages own cloud now? damn i must be a little out of date either way, i was saying that the packages are not as up to date as their web interface based updater. – Mohammad Ali May 28 '16 at 3:56
  • Oh I am sure they aren't as up to date, but generally as a matter of policy (i.e., intentionally, not out of laziness or incompetence) they are never up to date with the sources. This stems from a philosophy which asserts the newest releases are the most likely to cause problems (even though they include bug fixes :/, but I do think they make a sort of exception for security issues, "sort of" meaning some kind of patch is used). – goldilocks May 28 '16 at 4:06
  • @MohammadAli In fact, ownCloud recommends updating using your package manager. – Sparhawk May 28 '16 at 4:18
2

The latest version upstream from Rasbian 8 -- "upstream" being Debian, not the owncloud direct releases -- is 7.0.4. I don't know if that is the client, the server, or both.

I'm not an Owncloud user but it looks at first glance to be pure PHP, meaning you don't need to dig around for a version compiled for ARM. I could easily be wrong about that though. Of course, WRT apt this doesn't matter anyway; the version in the repo is the version in the repo.

Debian has an official policy of being fairly conservative with version upgrades, meaning they rarely offer the latest version of anything in their stable branch. In this case there doesn't appear to be a corresponding package in the "unstable" branch, so that's pretty much that.

  • Sorry, perhaps I was unclear in the question, but I'm currently not even using the official Raspbian repositories, because (as you say) they are so outdated. I'm currently using the download.opensuse.org repo, but I'd like to find an even more up-to-date repo. Actually, can I just use ownCloud's Debian repository on Raspbian, or will that not work? – Sparhawk May 28 '16 at 4:24
  • 1
    That's where the issue of it being pure PHP or not becomes relevant. If you' ve used their own updater and it worked, then that's the case and it's okay. Actually since that suse repo probably isn't ARM, then Debain non ARM repos would fine too (although they actually have them anyway). – goldilocks May 28 '16 at 4:47
  • In case it's not something you're aware of, the issue is that PHP itself is portable across architectures, as long as a PHP interpreter is installed on the system. However, some PHP components may include bits that need to be compiled, and those need to be compiled for the platform (and x86 != ARMv6, etc.); "pure PHP" would refer to applications that don't. But I think that is common even for complex things, e.g., I believe mediawiki (wikipedia) is pure PHP. – goldilocks May 28 '16 at 4:52
  • Thanks for the clarification. By "their own updater", did you mean ownCloud's? If so, then I haven't used it. Good point with the OpenSuse repo, though. I guess that does suggest the ownCloud Debian repo should work for Raspbian here… I'll suppose I just have to try and see if it works. I'll report back here either way. Thanks again (+1). – Sparhawk May 28 '16 at 4:56
  • Well -- I just checked and opensuse does have an ARM branch, so beware... I couldn't find out whether owncloud is pure php or not. If you have a good idea of where stuff is or you could just copy it into another temporary directory, tback up your content, and try it to see what happens. dpkg -L [package] will give you a list of all the installed files. – goldilocks May 28 '16 at 5:03
0

Firstly, I had been using the OpenSuse OwnCloud repositories, but in any case the official Debian repositories no longer ship OwnCloud.

Testing the install

As per comments by goldilocks, I wanted to test OwnCloud's repo for Debian. At first, I wanted to manually unpack it alongside my previous package install.

$ wget https://download.owncloud.org/download/repositories/stable/Debian_8.0/all/owncloud-files_9.0.2-1.1_all.deb
$ dpkg-deb -R owncloud-files_9.0.2-1.1_all.deb owncloud-files_9.0.2-1.1_all
$ sudo cp -r owncloud-files_9.0.2-1.1_all/var/www/owncloud /var/www/owncloud-9

I was buoyed by the fact that the url had any in it, instead of amd64 or i386 (which elements of my original OpenSuse repositories had). However, after installing and navigating to the new webpage, I got the error:

Can't write into config directory!

This can usually be fixed by giving the webserver write access to the config directory.

This was probably because I installed manually rather than using apt-get. I gave write permission to the files that had it in my previous install.

sudo chown -R www-data: owncloud-9/{apps,assets,config,data}

This now worked fine!

Installing via the package manager

I now attempted to upgrade using the package manager. I was upgrading from 8.1.8 to 9.0.2. OwnCloud suggests that

it is best to update your ownCloud installation with every new point release, and to never skip any major releases.

so I was happy enough to directly upgrade. I backed up /var/www/owncloud and my data directories, then ran the following.

$ wget -nv https://download.owncloud.org/download/repositories/stable/Debian_8.0/Release.key -O Release.key
$ sudo apt-key add - < Release.key

I edited /etc/apt/sources.list.d/owncloud.list, removing the OpenSuse repository and adding

deb http://download.owncloud.org/download/repositories/stable/Debian_8.0/ /

I crossed my fingers and ran

$ sudo apt-get update
$ sudo apt-get dist-upgrade

This had the following warnings

dpkg: warning: while removing owncloud-server, directory '/var/www/owncloud/config' not empty so not removed
dpkg: warning: while removing owncloud-server, directory '/var/www/owncloud/apps' not empty so not removed
Configuration file '/etc/apache2/conf-available/owncloud.conf.distrib'
 ==> Deleted (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versio

I selected yes. I then attempted to complete my upgrade.

$ sudo -u www-data php occ upgrade
ownCloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed
Maintenance mode is kept active
Reset log level

Ugh. I understood "major release" to mean 8.x.x to 9.x.x. However it appears the devs use "major release" as equivalent to "point release"… which is confusing because they use two different phrases for the one thing.

Fixing the upgrade

I manually downloaded OwnCloud 8.2.5, and extracted it alongside the package installation.

$ wget https://download.owncloud.org/community/owncloud-8.2.5.tar.bz2
$ tar -xjf owncloud-8.2.5.tar.bz2
$ sudo mv owncloud /var/www/owncloud-8.2.5
$ sudo chown -R www-data: owncloud-8.2.5
$ sudo cp /var/www/owncloud{,-8.2.5}/config/config.php
$ cd /var/www/owncloud-8.2.5
$ sudo -u www-data php /var/www/owncloud-8.2.5/occ upgrade
PHP Warning:  flock() expects parameter 1 to be resource, boolean given in /var/www/owncloud-8.2.5/lib/private/config.php on line 198
An unhandled exception has been thrown:
exception 'Exception' with message 'Could not acquire a shared lock on the config file /var/www/owncloud-8.2.5/config/config.php' in /var/www/owncloud-8.2.5/lib/private/config.php:199
Stack trace:
#0 /var/www/owncloud-8.2.5/lib/private/config.php(59): OC\Config->readData()
#1 /var/www/owncloud-8.2.5/lib/base.php(133): OC\Config->__construct('/var/www/ownclo...')
#2 /var/www/owncloud-8.2.5/lib/base.php(495): OC::initPaths()
#3 /var/www/owncloud-8.2.5/lib/base.php(1083): OC::init()
#4 /var/www/owncloud-8.2.5/console.php(42): require_once('/var/www/ownclo...')
#5 /var/www/owncloud-8.2.5/occ(11): require_once('/var/www/ownclo...')
#6 {main}

The "shared lock" part made me think that this was related to having multiple versions installed, so I removed the other versions temporarily. However, I had just forgotten to chown on the config file.

$ sudo chown -R www-data: /var/www/owncloud-8.2.5/config/config.php

I ran occ upgrade successfully, then moved the original OwnCloud install back, making sure to copy config/config.php from the intermediate to newest install. I completed the upgrade again.

$ sudo -u www-data php /var/www/owncloud/occ upgrade
$ sudo -u www-data php /var/www/owncloud/occ maintenance:mode --off

This worked fine, and I now have a working, up-to-date OwnCloud!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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