FastNetMon

Wednesday, 28 July 2021

createrepo on Ubuntu 24.04

Unfortunately, createrepo command which can create RPM repositories was removed in Ubuntu 24.04 LTS.

Let's try building C based version of createrepo from: https://github.com/rpm-software-management/createrepo_c 

First of all, install all dependencies:

sudo apt install -y libcurl4-openssl-dev libbz2-dev libxml2-dev libssl-dev zlib1g-dev pkg-config libglib2.0-dev liblzma-dev libsqlite3-dev librpm-dev libzstd-dev python3-dev cmake

Then build it:

mkdir createrepo_folder; cd createrepo_folder

git clone https://github.com/rpm-software-management/createrepo_c

cd createrepo_c;

mkdir build

cd build

cmake .. -DWITH_ZCHUNK=NO -DWITH_LIBMODULEMD=NO

make -j 

cp src/createrepo_c /opt/createrepo

cp src/libcreaterepo_c.so /opt 

cp src/libcreaterepo_c.so.1 /opt 

cp src/libcreaterepo_c.so.1.1.4 /opt

Then we need to override RPATH to use libraries from /opt:

sudo apt install chrpath

chrpath /opt/createrepo -r /opt

 Do test run:

/opt/createrepo /var/public_repositories/
Directory walk started
Directory walk done - 18 packages
Temporary output repo path: /var/public_repositories/.repodata/
Preparing sqlite DBs
Pool started (with 5 workers)
Pool finished
Please do not remove original folder "createrepo_folder" because it has dynamic library needed for app itself. 

No comments :

Post a Comment

Note: only a member of this blog may post a comment.