Linux Snippets

  1. This is a post to record the tips or just commands I found useful.


  • Mounting NTFS file system after a fresh installation.
    yum --enablerepo=extras install epel-release
    yum install ntfs-3g fuse



  • When a repository is causing problem, head to

    And open up the repos that’s causing problem and set





  • Find dependencies for a particular package
    yum deplist <package name>


    yum deplist vlc


  • Find out where a package comes from
    yum provides <packgage name>



  • Easiest way I found to install nvidia driver on Cent OS 7
    rpm -Uvh
    yum install nvidia-detect
     yum install $(nvidia-detect)


  • Install Skype on Cent OS 7
    Guide on centos wiki here states the easiest method is to use the nux-desktop repository, but at the time of writing this even though I have nux-repo yum can’t seem to find skype package, so here goes
    sudo yum localinstall skypeforlinux-64.rpm




  • When device doesn’t shows up on KDE Connect (You can run the following commands each time, or use the append argument to add it to it permanently)
    iptables -I INPUT -p tcp --dport 1714:1764 -j ACCEPT
    iptables -I INPUT -p udp --dport 1714:1764 -j ACCEPT


  • Maya fonts error
    sudo yum install xorg-x11-fonts*


  • Combine pdf file with command line, details here
    sudo yum install pdftk
    pdftk file1.pdf file2.pdf file3.pdf output outputName.pdf
  • Open a .jar file with java.
    java -jar file.jar


  • Find and delete duplicate files


  • Tell yum to treat a manually installed package as installed, solution found hereTwo possible solutions.
    1) You will need to download the package that you want to install and install them via the rpm command using the –nodeps option. To download the rpms, you should first ensure that you have the “yum-utils” package installed because it contains the “yumdownloader” command. Let’s say the package name is “something-xyz”. Here are the commands to download and install that package:
    # Download the package
    yumdownloader something-xyz
    # Test whether emacs is the only dependency.
    rpm -Uvh --test something-xyz.rpm
    # If emacs is the only dependency, then install the package
    rpm -Uvh --nodeps something-xyz.rpm

    If there are other dependencies, than you can try to install via yum if they are not dependent on emacs. Otherwise, you will need to do the same process as above to install them.

    2) If all of this does not work with your hand installation of emacs, then the last resort would be to install the emacs version that yum by default wants to install, but invoke your own version of emacs instead of the one yum installs.


  • Formatting a USB drive with FAT32 file system
    First find out its mount point
     fdisk -l

    or this



     mkfs –t vfat


  • According to this post here, changing/adding environment paths in CentOS 7 by adding .sh file in /etc/profile.d, below is sample of adding pycharm/bin
    # echo 'pathmunge /opt/pycharm-edu-2018.2/bin/' > /etc/profile.d/
    # chmod +x /etc/profile.d/
    # . /etc/profile

Leave a Reply

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