Advertisement
13minutes-yt

create-local-repo

Aug 8th, 2022
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.56 KB | None | 0 0
  1. First create repo local location using
  2.  
  3. createrepo /mnt/home/artix/fedoralocal
  4.  
  5.  
  6. you need to install
  7. sudo dnf install dnf-plugins-extras-local
  8.  
  9.  
  10. Go to /etc/dnf/plugins/local.conf and point the repo directory location
  11. whenever you update fedora, the rpm files go to the local repo directory. and if the files are in local, then they will not be downloaded!!!
  12.  
  13. [main]
  14. enabled = true
  15. # Path to the local repository.
  16. # repodir = /var/lib/dnf/plugins/local
  17. repodir= /mnt/home/artix/fedoralocal
  18. # Createrepo options. See man createrepo_c
  19. [createrepo]
  20. enabled = true
  21. # If you want to speedup createrepo with the --cachedir option. Eg.
  22. # cachedir = /tmp/createrepo-local-plugin-cachedir
  23. # quiet = true
  24. # verbose = false
  25.  
  26.  
  27.  
  28.  
  29. This repo will be the backup of the other repos meaning the system will search the other repos for the package. Afterwards it will look in the folder for the local download. If you want it to search the repo first, you need the following.
  30.  
  31. create a file in /etc/yum.repos.d/mylocal.repo
  32. put in the file the following:
  33.  
  34. [Mylocal]
  35. name=RPM Sphere - Basearch
  36. baseurl=file:///media/sf_fedoralocal
  37. skip_if_unavailable=True
  38. #repo_gpgcheck=0
  39. gpgcheck=0
  40. #sslverify=False
  41. enabled=1
  42.  
  43.  
  44.  
  45. repomanage will print information of the old packages or the new packages
  46.  
  47. dnf repomanage /mnt/home/artix/fedoralocal --old
  48.  
  49. will print all the old packaes. you can pipe the results to a file and use rm to delete them for example
  50.  
  51. dnf repomanage /mnt/home/artix/fedoralocal --new
  52.  
  53. this will give all the updated packages installed.
  54. Dnf repomanage
  55.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement