Chakra Linux local repository (Applicable to distros that use pacman)


Hi, here's another post, if you want "similar" to the one I did previously for Archlinux, this time we are going to do something very similar, with the difference that although I do it under Chakra Linux, It is applicable to all distros that use pacman as package manager


  • Packages to compile, it is usually groups ending in devel (for Arch would be base-devel)

Building the repository structure

For this it is necessary to create (to be ordered) 2 folders within our repository, in my case I will create my repo x11tete11x in: /home/x11tete11x/.repo/x11tete11x and the folders it will contain will be: pkgbuilds y pkgs-x86_64

Adding our repository to Pacman

We edit the file /etc/pacman.conf and we add our repo with the following information:

[RepoName] SigLevel = Server =

Example of how I have my repo configured:

[x11tete11x] SigLevel = Optional TrustAll Server = file: ///home/x11tete11x/.repo/x11tete11x/pkgs-x86_64

Manual Method

Creating the DB for the repository

Here we use the instruction repo-add to generate the repository database

repo-add / path / to / repo / folderDepkgs / /path/to/repo/Depkgsfolder/*.pkg.tar.xz
You must already have a package in the pkgs folder, because otherwise repo-add will not be able to create the DB

Compiling packages

Here more than the steps, I am interested in giving more "guidelines" or advice, the steps are:

  • Download or assemble the PKGBUILD of the desired package to the folder pkgbuilds, and enter the same
  • Adapt the PKGBUILD to fit your distro's dependency names
  • Run makepkg
  • Copy the binary to the folder pkgs
  • Regenerate the DB with repo-add
  • Refresh the pacman repositories with pacman -Sy

Considerations when compiling

Before starting to compile to fools and crazy check that you have all the dependencies in your repositories official, because if we start duplicate packages in our repositories and system, we can generate inconsistency, for example.

Later I will accompany this post, with a video tutorial showing everything that is exposed here, in particular in Chakra is the package «toluapp" and in Arch is called "tolua ++»Therefore if we want to compile a package in Chakra (which for example we brought from Arch) which has as dependency tolua ++, NO we have to compile tolua ++ we simply modify the PKGBUILD, so that dependence of the same happens to be toluapp.

That has to be the biggest consideration to contemplate, then, it is a matter of before any eventuality, googling a bit to modify the PKGBUILD so that it compiles (in the example that I show in the video, there are all these questions, even a compilation error , later fixed)

Pay attention to the considerations when compiling, since as explained, this way good packages are generated according to the distro

Automatic method

The "automatic" method consists of a simple script, which I did to automate the task of compiling and adding packages to the repository (it is not nearly as complete as the local-repo de Arch but it fulfills its mission) the code of the same is the following:

#! / bin / bash REPONAME = x11tete11x PATHPKG = / home / x11tete11x / .repo / x11tete11x / pkgs-x86_64 / makepkg && cp * .pkg.tar.xz $ {PATHPKG} && rm * .pkg.tar.xz && repo -add $ {PATHPKG} / $ {REPARE ME} .db.tar.gz $ {PATHPKG} *. pkg.tar.xz

as you will see it is extremely simple and to use it you have to do the following:

  • They save that code with the name they want (in my case I called it chakra-repo)
  • Set the variables REPLACE ME, with the name of your repository, it has to be the same as they put in the pacman.conf, and the variable PATHPKG with the directory where all the pkgs
  • They give you execution permissions:
    chmod + x scriptname
  • They copy it to / usr / bin /

To use it, after they downloaded or armed their PKGBUILD, instead of running makepkg they execute the script (in my case chakra-repo) This automatically compiles the program, copies the binary to the binaries folder, and updates the DB using repo-add, so after running the script, just make a pacman -Sy to install the package in question.

Next, I leave you a video tutorial where you can see all this that I exposed, in action (PS: if you listen to AC / DC the machine compiles better xD hahaha)

The content of the article adheres to our principles of editorial ethics. To report an error click here!.

14 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *



  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   truko22 said

    Interesting 😀

  2.   Fega said

    Very interesting!

  3.   elruiz1993 said

    It looks interesting, I wonder why Arch and Ubuntu can have all the packages in the universe and the other distros can't.

  4.   yerkorn said

    Very good theme, besides that everything is detailed when making the configuration,
    And the best detail, which in my opinion, was the best, was when you looked for the solution to the error that came out when completing, since one does not know what happens when encountering these types of errors and how to solve it, and here you demonstrate with the simple echo of looking for things comes out what to do.

  5.   cr0ss said


  6.   patodx said

    what a way to learn GNU / Linux on this page. thanks..

  7.   leftover72 said

    Very good entry, to see if someone is encouraged to put a similar one for the debianadictos.
    About the music…. AC / CD is fine, but the same with Marilyn Manson is going a bit better…: - /

  8.   Fega said

    Can a cloud hosting be used as a server? specifically Dropbox

    1.    x11tete11x said
    2.    Yoyo said

      Yes indeed, when I was on Pardus and Pisi Linux, we had the community repo on Dropbox.

    3.    Fega said

      Perfect! 😀

  9.   Yoyo said

    Now that I'm UniDistro, let's see if I dare to try it on KaOS 🙂

    Excellent contribution 😉

    1.    x11tete11x said

      try without fear, that initially the local repo "manual", I did it under KaOS xD

  10.   userarch said

    A very useful work for neophytes like me, and for that I thank you very much for the interest you had to publish it.
    Ok, I think I understand what you want to transmit, this "local repo" thing, saves time, if we consider installing archlinux or a derivative; since for example the server has recently been set to 56 kb / s for downloads. But if we have a local repo (local package server, I think?) The installation will be done without the dependency of being connected to the internet.