Boot to any [Manjaro] live GUI disk. Use manjaro-chroot 1. Start by identifying the partition where your Manjaro installation controlling the active Grub menu resides and needs repairing. If you are in Graphical mode you can use an application called GPartEd , which should be in Menu > System > GPartEd. This will provide a simple visual illustration of the partitions on your hard drive(s). To do the same thing from terminal or TTY you can use this command lsblk -f 2. manjaro-chroot is a tool to easily setup a functional chroot into an installed Linux installation from a live boot of a Manjaro Installation Media. To setup the chroot use the command sudo manjaro-chroot -a You will be presented with a terminal. Wait until it shows a list with the available system partitions on your computer and choose the one you want to repair. 1.) First of all check the partition for the ESP (EFI System Partition). An ESP is a fat32 partition and contains .efi ...
To unpack the package, create an empty directory and switch to it, then run dpkg-deb to extract its control information and the package files.
Use dpkg-deb -b to rebuild the package.mkdir tmp
dpkg-deb -R original.deb tmp
# edit DEBIAN/postinst
dpkg-deb -b tmp fixed.deb
Beware that unless your script is running as root, the files' permissions and ownership will be corrupted at the extraction stage. One way to avoid this is to run your script under fakeroot. Note that you need to run the whole sequence under fakeroot, not each dpkg-deb individually, since it's the fakeroot process that keeps the memory of the permissions of the files that can't be created as they are.
fakeroot sh -c '
mkdir tmp
dpkg-deb -R original.deb tmp
# edit DEBIAN/postinst
dpkg-deb -b tmp fixed.deb '
Rather than mess with permissions, you can keep the data archive intact and modify only the control archive. dpkg-deb doesn't provide a way to do that. Fortunately, deb packges are in a standard format: they're ar archives.
So you can use ar to extract the control archive, modify its files, and use ar again to replace the control archive by a new version.
mkdir tmp
cd tmp
ar p ../original.deb control.tar.gz | tar -xz
# edit postinst
cp ../original.deb ../fixed.deb
tar czf control.tar.gz *[!z]
ar r ../fixed.deb control.tar.gz
Comments
Post a Comment