Remove string 'packages' from filepath