{"id":6096,"date":"2021-05-02T21:43:24","date_gmt":"2021-05-02T21:43:24","guid":{"rendered":"https:\/\/linuxways.net\/?p=6096"},"modified":"2021-05-02T21:43:24","modified_gmt":"2021-05-02T21:43:24","slug":"install-composer-on-linux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/mint\/install-composer-on-linux\/","title":{"rendered":"Install Composer on Linux"},"content":{"rendered":"<h2>Introduction:<\/h2>\n<p>Composer is a tool that acts as a package manager for PHP. It is used to gracefully manage all the packages and dependencies for this programming language hence offloading the developers from the responsibility of doing this manually. Today, we will see how we can install Composer on a Linux system.<\/p>\n<p><strong>Note: We have performed the method described in this article on a Linux Mint 20 system. <\/strong><\/p>\n<h2>Pre-Requisites:<\/h2>\n<p>Before proceeding with the method shown below, you need to have \u201cPHP\u201d installed on your Linux system with \u201csudo\u201d privileges.<\/p>\n<h2>The procedure of Installing Composer on Linux:<\/h2>\n<p>For installing Composer on your Linux system, you will have to follow the steps described below in the specified order:<\/p>\n<h3>Step # 1: Download Composer from its Official Website:<\/h3>\n<p>First, you need to download Composer from its official website by executing the following command:<\/p>\n<pre><strong>$ wget https:\/\/getcomposer.org\/composer.phar<\/strong><\/pre>\n<p>You can also mention the exact version of Composer in this command that you want to download. However, running this command as it is will ensure that you download the latest available version of Composer on your system.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"585\" height=\"26\" class=\"wp-image-6097\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-348.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-348.png 585w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-348-300x13.png 300w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/p>\n<p>This download will literally complete within the blink of an eye after which your terminal window will look something like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"642\" height=\"244\" class=\"wp-image-6098\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-349.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-349.png 642w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-349-300x114.png 300w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><\/p>\n<h3>Step # 2: Make the Downloaded Composer File Executable:<\/h3>\n<p>Now, you need to make the downloaded file executable with the command shown below:<\/p>\n<pre><strong>$ chmod +x .\/composer.phar<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"441\" height=\"24\" class=\"wp-image-6099\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-350.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-350.png 441w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-350-300x16.png 300w\" sizes=\"auto, (max-width: 441px) 100vw, 441px\" \/><\/strong><\/p>\n<p>This command will not render any messages on your terminal if it is executed without any errors.<\/p>\n<h3>Step # 3: Change the Path of the Executable Composer File to make it easily accessible:<\/h3>\n<p>After performing the above-mentioned step, you need to move your executable Composer file to the \/usr\/bin\/composer directory for making it easily accessible. You can do this by executing the following command:<\/p>\n<pre><strong>$ sudo mv .\/composer.phar \/usr\/bin\/composer<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"576\" height=\"23\" class=\"wp-image-6100\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-351.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-351.png 576w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-351-300x12.png 300w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/strong><\/p>\n<p>You should run the above-mentioned command as it is because omitting the \u201csudo\u201d keyword from this command will not let you change the path of the executable Composer file. Again, if this command will execute without any errors, then it will not produce any messages on your terminal.<\/p>\n<h3>Step # 4: Verify the Installation of Composer on your Linux System:<\/h3>\n<p>Finally, you can verify the successful installation of Composer on your Linux system by checking its location with the command shown below:<\/p>\n<pre><strong>$ which composer<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"360\" height=\"22\" class=\"wp-image-6101\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-352.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-352.png 360w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-352-300x18.png 300w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/strong><\/p>\n<p>The location of Composer on our Linux system is shown in the following image which indicates that Composer has been successfully installed on our Linux system.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"370\" height=\"58\" class=\"wp-image-6102\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-353.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-353.png 370w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-353-300x47.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n<h2>Uninstallation Procedure of Composer on Linux:<\/h2>\n<p>You can easily uninstall Composer from your Linux machine by first executing the command shown below:<\/p>\n<pre><strong>$ sudo apt-get purge composer<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"463\" height=\"24\" class=\"wp-image-6103\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-354.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-354.png 463w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-354-300x16.png 300w\" sizes=\"auto, (max-width: 463px) 100vw, 463px\" \/><\/strong><\/p>\n<p>After executing this command, you can run the following command in your terminal to free up more space on your Linux system:<\/p>\n<pre><strong>$ sudo apt-get autoremove<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"436\" height=\"24\" class=\"wp-image-6104\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-355.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-355.png 436w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/04\/word-image-355-300x17.png 300w\" sizes=\"auto, (max-width: 436px) 100vw, 436px\" \/><\/strong><\/p>\n<h2>Conclusion:<\/h2>\n<p>After following this tutorial, you will be able to install Composer on your Linux system and use it for handling the packages and dependencies of the PHP programming language. The method that you have learned in this article can also be implemented on a Ubuntu 20.04 or a Debian 10 system.<\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction: Composer is a tool that acts as a package manager for PHP. It is used to gracefully manage all the packages and dependencies for this programming language&hellip;<\/p>","protected":false},"author":1,"featured_media":6229,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[297,129],"class_list":["post-6096","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mint","tag-composer","tag-linux-mint-20"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/6096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=6096"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/6096\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/6229"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=6096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=6096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=6096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}