Linux Troubleshooting

1. Missing dependencies when install an app.

You can fix this by installing missing dependencies.
Just run the following command
(after you have run sudo dpkg -i google-chrome-stable_current_i386.deb).

sudo apt-get install -f

This will install missing dependencies and configure Google Chrome for you.

2. Fix for Ethernet Connection Drop on Raspberry Pi



if ifconfig eth0 | grep -q "inet addr:" ;
        echo "$(date "+%m %d %Y %T") : Ethernet OK" >> $LOGFILE
        echo "$(date "+%m %d %Y %T") : Ethernet connection down! Attempting reconnection." >> $LOGFILE
        ifup --force eth0
        OUT=$? #save exit status of last command to decide what to do next
        if [ $OUT -eq 0 ] ; then
                STATE=$(ifconfig eth0 | grep "inet addr:")
                echo "$(date "+%m %d %Y %T") : Network connection reset. Current state is" $STATE >> $LOGFILE
                echo "$(date "+%m %d %Y %T") : Failed to reset ethernet connection" >> $LOGFILE

3. Write Raspbian to external partition

The image file is a “whole disk” image that includes a partition table with two partitions (for boot and root filesystems).
It will not work if you try and write it into an existing partition.

The way I use dto do it was like this….

1) Uncompress the image file to a plain “.img” file
2) Use kpartx to access the image file “sudo kpartx -a -v uncompressed_raspbian_image_file_name” which will create block devices in /dev/mapper

$ sudo kpartx -a -v 2018-04-18-raspbian-stretch.img 
add map loop0p1 (252:0): 0 88262 linear /dev/loop0 8192
add map loop0p2 (252:1): 0 9576448 linear /dev/loop0 98304

$ sudo mount /dev/mapper/loop0p2 /mnt
$ ls /mnt
bin   dev  home  lost+found  mnt  proc  run   srv  tmp  var
boot  etc  lib   media       opt  root  sbin  sys  usr

You can then copy the files from there into the existing partitions for boot and root on your disk. You will then have to fix the config.txt and fstab files to make them mount the correct partitions.

4. Google Drive File Stream in Linux



Leave a Reply

Your email address will not be published. Required fields are marked *