Oct 14, 2018

Updating a Fedora Standalone System (without internet connectvity)

Installing the latest updates of fedora on a standalone system which has not internet connection.
 I. Create a Fedora Update Repository:-
1) Take a System with Freshly installed Fedora OS connected to the internet for downloading the updates. The Fedora release versions should be the same as of the standalone system.
2) Create a folder to save to downloaded update.
            # mkdir /yumdownloader/
3) Execute the below command to download the latest packages with dependencies:
             # yum check-update | grep -v "anaconda\|Obsoleting" | awk '(NR >=2)' | cut -d " " -f 1 | tr "\n" " " | xargs -r yumdownloader --resolve --destdir /yumdownloader/
4) After completing the download, create an ISO image of the folder.
  
         # genisoimage -o fedora-updatesdeps.iso /yumdownloader
II. Installing updates on standalone system:-
         METHOD 1:-
      1. Mount the iso fedora-updatesdeps.iso on the standalone System which is required to be updated.
  
         # mkdir /mnt/iso/updates
       
       # mount -o loop /dev/sr0 /mnt/iso/updates
       # cd /mnt/iso
  
       # createrepo  .
       (install createrepo package if not present).
        # yum clean all

Then create a cdrepo.repo config file in /etc/yum.repos.d/
        # vi cdupdates.repo
 Add the below entries and save in the file:
        
         [cdupdates]
         name=CD REPOSITORY
     baseurl=file:///mnt/iso
     enabled=1
If required disable the other repos in the /etc/yum.repos.d/. In each file, change the setting enable=1 to enable=0
Once the above is done, execute the below command:
      # yum check-update
This should show the updates in the cdrepo. Then execute:
      # yum update
       Method 2:
    1.  The below method can also be followed:  
     # cd /mnt/iso/updates
        
         # rpm -Uvh *.rpm
NOTE:-
Method 1 shall keep a backup of the previous kernel version and can be seen in the GRUB menu, while Method 2 shall remove the previous kernel after upgrading.