Homestead: Reducing installed packages the clean way?

Created on 14 Jun 2018  路  4Comments  路  Source: laravel/homestead

vagrant 2.1.1
Homestead 7.7.0

I have noticed that a lot things are installed by default that are really not needed (for my specific use). PHP 7.1 is okay, but the rest is really not needed. Also PostgreSQL is never used (on any of my systems).

I _could_ SSH into the box and do a sudo apt-get install aptitude mc and then sudo aptitude purge postgresql-10 php-x.y but that breaks provision script.

So this is clearly the wrong way. Is there then a clean way to have only a specific version of PHP installed, "custom" (aptitude and mc in my case) packages installed and some uninstalled? These extra daemons are really filling up the virtualbox' RAM which is wasteful.

Most helpful comment

To turn off Postgres and FPM services add this to after.sh:

sudo service postgresql stop
sudo service php5.6-fpm stop
sudo service php7.0-fpm stop
sudo service php7.2-fpm stop

All 4 comments

The best way would be to disable any daemons you don't want running in your after.sh script.

How do I do so? I don't find any documentation about it? Maybe you can include an example (commented out, of course) in it?

To turn off Postgres and FPM services add this to after.sh:

sudo service postgresql stop
sudo service php5.6-fpm stop
sudo service php7.0-fpm stop
sudo service php7.2-fpm stop

Ah, easy. :-) Thank you.

Was this page helpful?
0 / 5 - 0 ratings