To install all programs from one Manjaro system on another, you can follow these steps:

Export Package List

On the source Manjaro system:

  1. Open a terminal
  2. Run the following command to export a list of explicitly installed packages:
pacman -Qqe > packages.txt

This will create a file called “packages.txt” containing the names of all explicitly installed packages[1].

Transfer the Package List

Transfer the “packages.txt” file to the target Manjaro system. You can use various methods like USB drive, network transfer, or cloud storage.

Install Packages on Target System

On the target Manjaro system:

  1. Open a terminal
  2. Navigate to the directory containing the “packages.txt” file
  3. Run the following command to install all packages from the list:
sudo pacman -S --needed - < packages.txt

This command will install all packages listed in the file, skipping any that are already installed[1].

Additional Considerations

  • AUR Packages: The above method only covers official repository packages. For AUR packages, you’ll need to install them manually or use an AUR helper like yay[2].

  • Configuration Files: Remember that this process only installs packages, not their configurations. You may need to transfer configuration files separately.

  • System Differences: Be aware that some packages might not be compatible if the two systems have different architectures or Manjaro versions.

  • Updates: After installation, run a system update:

sudo pacman -Syu
  • Cleaning Up: You might want to remove unnecessary packages on the target system:
sudo pacman -Rns $(pacman -Qtdq)

This process should help you replicate most of the software environment from one Manjaro system to another. However, always review the package list before installation to ensure it’s appropriate for the target system[1][2].

Citations: [1] https://www.reddit.com/r/ManjaroLinux/comments/ifowrz/how_to_install_software_in_manjaro/ [2] https://github.com/manzurahmed/manjaro-software-installation-guide [3] https://www.youtube.com/watch?v=82YinI2Cgbc [4] https://www.youtube.com/watch?v=VTE4vtrvIM4 [5] https://forum.manjaro.org/t/install-software-from-terminal-cd-downloads-in-manjaro/88674 [6] https://forum.manjaro.org/t/how-to-install-software-over-applications-in-manjaro-hello/110060 [7] https://forum.manjaro.org/t/how-to-install-apps-on-manjaro/84114 [8] https://forum.manjaro.org/t/how-to-install-new-software/141060

  • PumpkinDrama@reddthat.comOPM
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    17 days ago

    While yay doesn’t have a direct --needed option like pacman, you can still achieve a similar result using a loop. Here’s how you can install packages from a list, skipping those that are already installed:

    1. First, export the list of installed packages from the source system:
    yay -Qqe > installed_packages.txt
    
    1. Transfer the “installed_packages.txt” file to the new Manjaro system.

    2. On the new system, use the following bash script to install packages:

    #!/bin/bash
    
    # Function to print a separator line
    print_separator() {
        echo "========================================"
    }
    
    # Function to handle Ctrl+C
    ctrl_c() {
        echo
        echo "Skipping current package..."
        return 1
    }
    
    # Set up trap for Ctrl+C
    trap ctrl_c INT
    
    # Read the file line by line
    while IFS= read -r package; do
        print_separator
        echo "Processing package: $package"
        print_separator
    
        if ! yay -Qi "$package" &> /dev/null; then
            echo "Installing $package..."
            echo "Press Ctrl+C to skip this package."
            print_separator
            if yay -S --noconfirm "$package"; then
                echo "Installation of $package completed."
            else
                if [ $? -eq 130 ]; then
                    echo "Installation of $package skipped."
                else
                    echo "Installation of $package failed."
                fi
            fi
        else
            echo "$package is already installed. Skipping."
        fi
    
        echo  # Print an empty line for better readability
    done < installed_packages.txt
    
    # Remove the trap
    trap - INT
    
    print_separator
    echo "All packages processed."
    print_separator
    

    This script does the following:

    • It reads each package name from the “installed_packages.txt” file.
    • For each package, it checks if it’s already installed using yay -Qi.
    • If the package is not installed, it installs it using yay -S --noconfirm.
    • If the package is already installed, it skips it and prints a message.

    Save this script as “install_packages.sh” and make it executable:

    chmod +x install_packages.sh
    

    Then run the script:

    ./install_packages.sh
    

    Important considerations:

    • This method will install packages one by one, which may be slower than installing them all at once.
    • The --noconfirm option is used to avoid prompts, but be cautious as it will automatically accept all default options.
    • Some AUR packages might still require manual intervention during the build process.
    • Be aware that not all packages may be compatible with the new system, especially if there are significant differences in hardware or software versions.
    • This method only installs packages, not their configurations. You’ll need to transfer configuration files separately.

    By using this approach, you can replicate the functionality of the --needed option while using yay to install packages from both official repositories and the AUR[2].

    Citations: [1] https://www.hostzealot.com/blog/how-to/installing-yay-aur-helper-on-arch-linux-a-step-by-step-guide [2] https://www.reddit.com/r/archlinux/comments/jtaraj/is_there_a_way_to_automate_pkg_install_with_yay/ [3] https://linuxcommandlibrary.com/man/yay [4] https://stackoverflow.com/questions/53921707/loop-in-order-to-load-or-install-packages-does-not-work-what-am-i-doing-wrong [5] https://forum.manjaro.org/t/force-yay-to-rebuild-aur-package-s/141726 [6] https://es.hostzealot.com/blog/how-to/instalacion-de-yay-aur-helper-en-arch-linux-guia-paso-a-paso [7] https://xerolinux.xyz/posts/install-yay-paru/ [8] https://bbs.archlinux.org/viewtopic.php?id=281104