I follow the steps in this post to create a custom repository, but I want to rename it. I can't find any way to do it. Can you please help me?
Sounds like you want to know how to rename a package. There are two ways to do this. In this example, I'm going to change the name of
Download the debian (or ubuntu) source package, rename the files as appropriate, replace the old name with the new name in the
debian/* directory (that's what the
sed lines are doing, then build it with
Be a little careful, because some packages may have build rules which depend on the package name and may not be as trivial as cowsay. This is probably the toughest option.
apt source cowsay mv cowsay-3.03+dfsg2 mysay-3.03+dfsg2 mv cowsay_3.03+dfsg2-8.dsc mysay_3.03+dfsg2-8.dsc mv cowsay_3.03+dfsg2.orig.tar.gz mysay_3.03+dfsg2.orig.tar.gz cd mysay-3.03+dfsg2/ sed -i 's/\bcowsay\b/mysay/g' debian/changelog debian/control sed -i 's./debian/cowsay./debian/mysay.g' debian/rules dpkg-buildpackage -uc -us
Get the *.deb you want to manually split the archive up, edit the
control file and then put it back togeather.
apt download cowsay mkdir mysay && cd mysay # Split everything up ar -x ../cowsay_3.03+dfsg2-8_all.deb mkdir control tar -xf control.tar.xz -C control # CHange the package name sed -i 's/cowsay/mysay/' control/control # Put the control file back togeather cd control tar -cf control.tar.xz * mv control.tar.xz ../ cd .. rm -r control # Put the rest back togeather ar r ../mysay_3.03+dfsg2-8_all.deb debian-binary control.tar.xz data.tar.xz
From binary (method 2)
This one simplifies the re-combining process. This is probably the easiest method.
apt download cowsay ar x cowsay_3.03+dfsg2-8_all.deb mkdir -p mysay/DEBIAN tar -xf control.tar.xz -C mysay/DEBIAN tar -xf data.tar.xz -C mysay/ sed -i 's/cowsay/mysay/' mysay/DEBIAN/control dpkg-deb -b mysay
A few final notes:
If you try to install
mysayon the same machine, one of the packages will fail. That's because they both supply the same files, so it's impossible for your system to know which owns it. A way to make this foolproof is to add a
Conflicts: cowsayto the control file of
Renaming packages is a little strange. It is sure to cause the conflicts mentioned above. I not sure I can picture a case where this is necessary.