Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    A universial update script, need some help

    So, I dicided to make a script that would update your machine, no matter what linux distro you are using. The trouble is, I don't know all the different distros, and it is hard to actually finish it. I have added the two I used and know so far. Debian-base and Arch-based. I'll go ahead and post the code I have:

    # This script serves as a universal updater that should be compatible with all 
    # Linux distros. v0.2 (unfinished)
    cd /etc
    # Test if the local host Arch-based
    if [ -d /etc/pacman.d ]; then
    	# Run the Arch version of the update command
    	sudo pacman -Syu
    # Test if the local host is Debian-based
    if [ -d /etc/apt ]; then
    	# Run the Debian version of the update command
    	sudo apt-get update && sudo apt-get dist-upgrade
    So, as you can tell, first the script checks for a file that is only found in that specific distro branch, and wouldn't exist elsewhere in other distros. After that it runs the distros update command. Its that simple.

    My intention is to have it include as many distros as possible, but I don't have enough information to add anymore, since these are the only ones I'm familiar with.

    I suppose I could start by adding RPM-based distros, and Gentoo based. So, could someone give me info on those first. All I need is a file that would only exist in the specific branch, and not found in any other distro, and that distros update command. I'll let you know if others come to mind.


  2. #2
    Linux Guru
    Join Date
    Dec 2013
    Victoria, B.C. Canada

  3. #3
    Linux Engineer docbop's Avatar
    Join Date
    Nov 2009
    Woodshed, CA
    Going to be a big task since the differenct families of distro have different package manages. The two main families are Debian based, and RedHat like. Then you will have historical differents in each family different formats and tools have been used over the years. You probably want to limit your scope otherwise its a huge project.

  4. $spacer_open
  5. #4
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris

    One item to look at is the wrapper script:

    It handles many aspects of package management including updating for:
        pacman        by Arch Linux, ArchBang, Manjaro, etc.
        dpkg/apt-get  by Debian, Ubuntu, etc.
        homebrew      by Mac OS X
        macports      by Mac OS X
        yum/rpm       by Redhat, CentOS, Fedora, etc.
        portage       by Gentoo
        zypper        by OpenSUSE
    Best wishes ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts