To answer your main question, you are missing one line before calling get_plugins()
. Without it, the list of plugins will come from cache. You can use the following sequence:
delete_plugins( array( 'akismet/akismet.php' ) );
wp_clean_plugins_cache( false );
get_plugins();
WARNING:
it is not recommended using delete_plugins()
in scripts, unless it is a part of complete procedure consisting of deactivation, uninstallation, and then deletion.