Is there a problem running Composer 2.x on Debian 10?

carlarogers

Member
Credits
315
I guess there must be a reason Debian 10 with latest updates installs Composer as version 1.8.6.

Is it safe to assume that means Composer 2.x on Debian 10 will have problems?
 


JasKinasis

Well-Known Member
Credits
5,977
Debian typically ships with older packages. So if you’re installing composer from the Debian repos, it wouldn’t surprise me if you ended up with an older version of it.

But if you install it manually, you should be able to install the latest version - I think.

I haven’t done anything with composer for years. It’s been a long time since I did any php.
But a quick bit of duckduckgo-fu seems to indicate that it is possible to install and run the latest version of composer on Debian 10:
 

captain-sensible

Well-Known Member
Credits
9,721
i've got composer 2.0.7 but latest seems to be 2.0.11 https://getcomposer.org/download/2.0.11/composer.phar

Since i'm on slackware normally i will install only software as a package(cleanly installs and can cleanly be removed) , using the appropriate slackbuild. However with composer i've never had a problem downloading and installing manually and it doesn't have any deps.


i will add tnat THERE IS a slackbuild for composer: https://slackbuilds.org/repository/14.2/development/composer/

However when i examined the slackbuild, all it does is what i do manually below, so whats the point of using the slackbuild ?

So basically just download the composer.phar file to where you normally do. I then give it chmod 777 permissions.

Then on a terminal cd to that location ; there are no deps so , its a simple case of :

Code:
# mv composer.phar  /usr/local/bin/composer
that renames composer.phar to "composer" and puts it in /usr/local/bin (for slackware) find your location where as a normal user you can evoke it , on a terminal with $ prompt.

a typical use then will not need to be $ php composer.phar but simply :

Code:
bash-5.0$ composer -V
Composer version 2.0.7 2020-11-13 17:31:06
bash-5.0$


on the options there is now :
self-update Updates composer.phar to the latest version.


The way i have apache set up i can for instance use composer to download CodeIgniter into one of several directories at /var/www/htdocs

in other words i use composer multiple times for different web apps.


i just tried the update; found i needed to do as root:

Code:
bash-5.0$ su
Password:
bash-5.0# composer self-update
Upgrading to version 2.0.11 (stable channel).
  
Use composer self-update --rollback to return to version 2.0.7
Code:
bash-5.0$ composer -V
Composer version 2.0.11 2021-02-24 14:57:23
bash-5.0$
 
Last edited:

carlarogers

Member
Credits
315
Since i'm on slackware normally i will install only software as a package(cleanly installs and can cleanly be removed) , using the appropriate slackbuild.
Tangential question: running slackware, do you have to install all the dependencies for packages by specifying them individually in conjunction with the command for installing a package?

However with composer i've never had a problem downloading and installing manually and it doesn't have any deps.
This is good information, succinctly stated. What more can a person hope to find? thank you! I feel safe following the path that is working for your slacker rig. Your mention of slackware led me my favorite search engine (Qwant), where I learned the concept behind slackware is to minimize changes to packages from upstream, and to generally minimize everything.
 

carlarogers

Member
Credits
315
I am confused by these alternatives. Composer is available as a package that can be installed with APT.

It surprises me when I look at instructions for installing Composer on Debian 10, usually the Composer installer is recommended instead of the package through the apt repo.

Can you possibly explain what is going on with this?
 

captain-sensible

Well-Known Member
Credits
9,721
Tangential question: running slackware, do you have to install all the dependencies for packages by specifying them individually in conjunction with the command for installing a package?
mmm probably should be another thread. For brevity will try to keep short. A slackbuild is a bash script that in essence is a more regulated and predictable way of using software source code; rather than:

configure
make
make install

it evokes another executable at : /sbin/makepkg and creates a package that is manually installed; maybe similar to dpkg -i somedebfile.deb

For deps you have to read all the info at slackbuilds.org and use another slackbuild for each dep, build the pkg and manually install it. Its a bit prehistoric , but i like it since you have to read about each package and the deps.

Also there is slpkg which from the command line can search for packages and on evoking install, will also get the deps and install them, a bit like apt or apt-get. So there is package management & dep resolution in slackware if you so choose
 

carlarogers

Member
Credits
315
mmm probably should be another thread. For brevity will try to keep short. A slackbuild is a bash script that in essence is a more regulated and predictable way of using software source code; rather than:

configure
make
make install

it evokes another executable at : /sbin/makepkg and creates a package that is manually installed; maybe similar to dpkg -i somedebfile.deb

For deps you have to read all the info at slackbuilds.org and use another slackbuild for each dep, build the pkg and manually install it. Its a bit prehistoric , but i like it since you have to read about each package and the deps.

Also there is slpkg which from the command line can search for packages and on evoking install, will also get the deps and install them, a bit like apt or apt-get. So there is package management & dep resolution in slackware if you so choose
Ok, this all makes sense. This explanation is just right for what I was looking for.
 

craigevil

Member
Credits
502

JasKinasis

Well-Known Member
Credits
5,977
I am confused by these alternatives. Composer is available as a package that can be installed with APT.

It surprises me when I look at instructions for installing Composer on Debian 10, usually the Composer installer is recommended instead of the package through the apt repo.

Can you possibly explain what is going on with this?
Once again - Debian stable uses older packages to ensure that your system is as stable and bug-free as possible. Security updates are back-ported to these older releases. So it would be expected for the Debian package for composer to be slightly older.

From a quick bit of duckduckgo-fu - Debian testing currently contains composer v2.09 and the latest version v2.11 is in the Debian unstable and experimental branches.
ref:

Eventually 2.11 will end up being moved from experimental and Unstable, before ending up in Debian testing.
So if you want to use apt to install composer - you either have to stick with the old version that is in stable, or enable one of the other repos (testing, unstable or experimental) in order to be able to use a slightly newer version.
That will allow you to install it using apt.

But it takes a long time for newer versions of packages to end up in apt in Debian Stable.
Software in stable usually only gets updated to a newer version when the "testing" branch is finally deemed ready for the next release - Then whatever is in testing ends up becoming the next release of Debian Stable.

So if you're using Debian stable, you're almost certainly not going to see a newer version of composer until the next version of Debian Stable is released. Again, typically the software in Debian stable just gets back-ported bug-fixes and security updates.

So if you want to install a newer version via apt, you will have to enable one or more of the repo's from Debian's other branches (testing, unstable, experimental). But the trade-off in using software from testing, unstable, or experimental is that you may occasionally experience breakages, bugs and/or instability.

However, composer is written entirely in php - so you could just as easily use composers install script to install it manually, on top of your existing system (as per the link in my previous post).
So that is another perfectly valid way to install the latest version.

Sure using apt is cleaner, from a system standpoint. But if you're using Debian you need to decide what is more important to you.

If you absolutely NEED the very latest bleeding edge features etc. in the latest version of a piece of software, and you don't want to wait for a newer version to be available in stable - then your only choice is to either enable the other repos, or install it a different way - like installing from source and building/installing manually, or using an installer like the one that composer uses.

So with composer - you have the following choices.
You can:
1. Make do with the version of composer in Stable until the next version of stable is released.
2. Add repositories from other Debian branches (testing, unstable, experimental) - to install a newer version and potentially risk instability/breakage.
3. Install composer via another official installation medium - like it's install script.

The choice is yours - the only correct answer is whatever is correct for you!
 

captain-sensible

Well-Known Member
Credits
9,721
Recent versions of composer have the flag
Code:
self-update          Updates composer.phar to the latest version.
So you might try installing via OS getting stable. Then from the command line run as root :
Code:
composer self-update.
i did it yesterday on slackware. There is also a role-back flag if it doesn't suit you , to go back to what you had. Would that be a 4) ?


there is also :

Code:
bash-5.0$ composer  check-platform-reqs
Checking platform requirements for packages in the vendor dir
ext-curl      7.4.1    success  
ext-intl      7.4.1    success  
ext-json      7.4.1    success  
ext-mbstring  7.4.1    success  
php           7.4.1    success  
bash-5.0$
 
Last edited:
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Latest posts

Top