After the installation, use apt-get clean or the appropriate package manager command to remove unnecessary files and dependencies.