Deepin: FSLint, fakeroot, dpkg-repack, rdepends, etc.

  1. FSLint http://www.pixelbeat.org/fslint/
FSlint is a utility to find and clean various forms of lint on a filesystem.
I.E. unwanted or problematic cruft in your files or file names.
For example, one form of lint it finds is duplicate files.
It has both GUI and command line modes.
For more info please see the FAQ.

sudo apt-get install fslint

2. Fakeroot

source: https://wiki.debian.org/FakeRoot

Gives a fake root environment , to remove the need to become root for a package build.

fakeroot runs a command in an environment where it appears to have root privileges for file manipulation. This is useful for allowing users to create archives (tar, ar, .deb etc.) with files in them with root permissions/ownership. Without fakeroot one would have to have root privileges to create the constituent files of the archives with the correct permissions and ownership, and then pack them up, or one would have to construct the archives directly, without using the archiver

Debian

This package is intended to enable something like:

  dpkg-buildpackage -rfakeroot

i.e. to remove the need to become root for a package build. This is done by setting LD_PRELOAD to libfakeroot.so, which provides wrappers around getuid, chown, chmod, mknod, stat, and so on, thereby creating a fake root environment.

fakeroot requires SYSV IPC to operate.

Why?

Source: http://unix.stackexchange.com/questions/9714/what-is-the-need-for-fakeroot-command-in-linux

it is a good idea, for security reason, to avoid doing as root everything that could be done as normal user, even if you can run sudo or su because it is your machine. fakeroot has two usages

1) it fools programs into believing you are indeed root user, which some badly written proprietary software may require even if not needed (usually Windows developer gone Linux) and

2) it allow emulating file mode and ownership changes which you wouldn’t otherwise be able to do, mainly to create a tar file with correct permissions and ownership, useful for example when packaging software

also,

 

Imagine that you are a developer/package maintainer, etc. working on a remote server. You want to update the contents of a package and rebuild it, download and customize a kernel from kernel.org and build it, etc. While trying to do those things, you’ll find out that some steps require you to have rootrights (UID and GID 0) for different reasons (security, overlooked permissions, etc). But it is not possible to get root rights, since you are working on a remote machine (and many other users have the same problem as you). This is what exactly fakeroot does: it pretends an effective UID and GID of 0 to the environment which requires them.

3. dpkg-repack

Source: https://ubuntuforums.org/showthread.php?t=819396&page=7&s=3a36d3fe288bac8b60044f388b0ab1d5

Creating the .deb packages

Code:
sudo apt-get install dpkg-repack fakeroot
mkdir ~/dpkg-repack; cd ~/dpkg-repack
fakeroot -u dpkg-repack `dpkg --get-selections | grep install | cut -f1`

Re-Install

Code:
sudo dpkg -i *.deb

4. apt-cache rdepends

source: https://mandeep7.wordpress.com/tag/dpkg-repack/

‘apt-cache rdepends‘ is used for checking dependencies of a particular package

Eg,

apt-cache rdepends application_name

It will show a long list of packages on which it depends.

You can redirect output to a file:

apt-cache rdepends texlive-base >dependencies

Remove some of top entries from the file ‘dependencies’ as it will create error.

To make the process easier you can use a do-while loop to read the list of packages from a file ‘dependencies’ and repack using dpkg-repack.

while read line

do

sudo dpkg-repack $line;

done <dependencies

It will start packaging the .deb files into the current directory.

Go to the directory containing the packages through terminal and use the command to install:

sudo dpkg -i *.deb

After completion it may result into some errors that some packages could not be installed. You may try to repack those specific packages again by checking their dependencies.

5. apt-get -f install

Sometimes packages have unmet dependencies and to correct these you can run ‘apt-get -f install’ with no packages.

also see: http://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s