Author: phuchungbhutia

rEFInd boot menu toolkit for UEFI

rEFInd presents a graphical menu for selecting your     boot OS.
rEFInd is a boot menu and maintenance toolkit for UEFI-based machines like all new PCs and Intel Macs. It can be used to boot multiple operating systems. It also provides a way to enter and explore the EFI pre-boot environment.
I was able to solve boot problems with HP laptop which wouldnt show Linux Deepin while booting (only Windows was showing)

Features

  • Support for EFI 1.x and UEFI 2.x computers
  • Support for Mac and PC platforms
  • Graphical and text-mode boot selector
  • Auto-detection of available EFI boot loaders
  • Directly launch Linux 3.3.0 and later kernels with EFI stub loader support
  • Maintenance-free Linux kernel updates — boot-time auto-detection means that no configuration file changes are needed after a kernel update
  • Set boot-time options from a list
  • Manually edit boot-time options
  • Launch EFI programs such as an EFI shell (available from third parties)
  • Launch OS X and Windows recovery tools
  • Reboot into the firmware setup utility (on some UEFIs)
  • Try before installation via a CD-R or USB flash drive image
  • Secure Boot support (requires separate shim or PreLoader program)
  • Includes EFI drivers for ext2/3fs, ext4fs, ReiserFS, Btrfs, HFS+, and ISO-9660
LINK:

How to Repair, Restore, or Reinstall Grub 2 with a Linux Mint Live Disk

Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is usually a EXT4 Partition. Replace the XY with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.

sudo mount /dev/sdXY /mnt

Now bind the directories that grub needs access to to detect other operating systems, like so.

sudo mount –bind /dev /mnt/dev &&
sudo mount –bind /dev/pts /mnt/dev/pts &&
sudo mount –bind /proc /mnt/proc &&
sudo mount –bind /sys /mnt/sys

Now we jump into that using chroot.

Now install, check, and update grub.

This time you only need to add the drive letter (usually a) to replace X, for example: grub-install /dev/sda, grub-install –recheck /dev/sda.

grub-install /dev/sdX grub-install --recheck /dev/sdX

Now grub is back, all that is left is to exit the chrooted system and unmount everything.

exit &&
sudo umount /mnt/sys &&
sudo umount /mnt/proc &&
sudo umount /mnt/dev/pts &&
sudo umount /mnt/dev &&
sudo umount /mnt

Shut down and turn your computer back on, and you will be met with the default Grub2 screen.

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/

Deepin: Solved Read/Write error in NTFS drive

I was getting an error whenever i was trying to Write/Move files in NTFS drive (Deepin).

Unable to access Drive/RW Protected

Error mounting /dev/sda4 at /media/dump: Command-line `mount -t “ntfs” -o “uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177” “/dev/sda4” “/media/rolindroy/Media Center”‘ exited with non-zero exit status 14: The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount ‘/dev/sda4’: Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the ‘ro’ mount option

Solution:
Use this in the terminal , if u can’t access Windows.

sudo ntfsfix /dev/sdXY

where XY is the partition

e.g sda2 or sdb1

(then mount

sudo mount -o rw /dev/sdXY)

I couldnt mount so i restarted it and it was working. I was able to Write/Move again.

After installing Deepin 15.3

After installing Deepin 15.3, i have done following:

  • installed HP printer
  • used Crossover and updated it
  • installed adobe flash player by reconfiguring sources.list
    • sudo nano /etc/apt/sources.list

## Generated by deepin-installer
deb [by-hash=force] http://packages.deepin.com/deepin unstable main contrib non-f$
deb-src http://packages.deepin.com/deepin unstable main contrib non-free

deb http://ftp.uk.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.uk.debian.org/debian/ jessie main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

# jessie-updates, previously known as ‘volatile’
deb http://ftp.uk.debian.org/debian/ jessie-updates main contrib non-free
deb-src http://ftp.uk.debian.org/debian/ jessie-updates main contrib non-free

  • installed Opera
  • installed Nemo and removed Deepin file manager (i just didnt like it)
    • sudo apt-get install nemo