Advertisement
Guest User

Debian Setup

a guest
May 24th, 2018
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.37 KB | None | 0 0
  1. ######### Getting Debian Setup #########
  2.  
  3. // How to create a linux live boot on linux
  4. // First download the copy of debian you want (I use netinst)
  5. // One you have the iso run the following commands to make a live boot on a USB
  6. // Format the USB you plan on using as FAT32
  7. // Creating these live boots assumes you are making them on a linux box already
  8. // There is two ways to create a live boot, but the 1st is my favorite
  9. // The first way to make a USB live boot:
  10.  
  11. # Copying the .iso to USB
  12. cp debian.iso /dev/sdX
  13.  
  14. sync
  15.  
  16. # The second way to is to install pv if you don’t already have it with
  17.  
  18. sudo apt-get install pv
  19.  
  20. # Then make the Live Boot USB with pv
  21.  
  22. sudo -i
  23.  
  24. dd bs=4M if=/path/to/debian.iso | pv | dd of=/dev/sdx && sync
  25.  
  26. exit
  27.  
  28.  
  29. ######### Setting up and Configuring Debian #########
  30.  
  31. # Add your user to sudoers list below the root user (my user name is dan, change it to your username)
  32. # If you dont have gedit then install it, you can switch to the root user to install by typing "su -"
  33. # then type "apt-get install gedit" Gedit is just my favorite text editor. You can use whatever.
  34. # Once you're done configuring the sudoers list make sure you log out of root by typing "exit"
  35.  
  36. # Switch user to root
  37. su -
  38.  
  39. # Edit the sudoers list
  40. gedit /etc/sudoers
  41.  
  42. # Add your user below the root user, save and close text editor.
  43. dan ALL=(ALL:ALL) ALL
  44.  
  45. # Type exit in terminal to log you out of root user.
  46. # You can tell if you are root or user if the terminal starts with user@computer:~$ (User logged in)
  47. # Or if root is still logged in it will look like root@computer:~#
  48. # If unsure just exit the terminal and open another
  49. exit
  50.  
  51. # Run an update and make sure you can update the repos with your user using sudo
  52.  
  53. sudo apt-get update
  54.  
  55. # Update the sources list
  56.  
  57. # Use source list in folder
  58. sudo gedit /etc/apt/sources.list
  59.  
  60.  
  61. # Sources List
  62. deb http://ftp.us.debian.org/debian/ stretch main contrib non-free
  63. deb-src http://ftp.us.debian.org/debian/ stretch main contrib non-free
  64.  
  65. # Security List
  66. deb http://security.debian.org/debian-security stretch/updates main contrib non-free
  67. deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free
  68.  
  69. # Kernel List
  70. deb http://mirrors.kernel.org/debian/ stretch main contrib non-free
  71. deb-src http://mirrors.kernel.org/debian/ stretch main contrib non-free
  72.  
  73. # Debian Multimedia
  74. deb http://www.deb-multimedia.org/ stretch main non-free
  75.  
  76. # X2Go Repository (release builds)
  77. deb http://packages.x2go.org/debian stretch main
  78. deb-src http://packages.x2go.org/debian stretch main
  79.  
  80. # Then Update
  81.  
  82. sudo apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E && sudo apt-get -y update
  83.  
  84. BUG: "gpg: failed to start the dirmngr"
  85.  
  86. #I was able to fix with the following commands:
  87.  
  88. 1. sudo apt remove gnupg
  89. 2. sudo apt install --reinstall gnupg2 (possibly not necessary, but doesn't hurt)
  90. 3. sudo apt install dirmngr
  91.  
  92.  
  93. # Install Multimedia Keyring & X2Go Keyring
  94.  
  95. sudo apt-get install deb-multimedia-keyring
  96. sudo apt-get install x2go-keyring
  97. sudo apt-get update
  98. sudo apt-get upgrade
  99. sudo apt-get dist-upgrade
  100.  
  101. # Install Kernel Headers
  102.  
  103. sudo apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')
  104.  
  105. # Install More programs, Multimedia, Realtek drivers, x2go
  106. # You may not need all these but this is what I install. Some errors may come up saying cant find package.
  107. # If that happens remove that program from this command and run it again
  108.  
  109. # Command that works
  110. sudo apt-get install libreoffice gimp guake icedtea-plugin unace rar p7zip sharutils uudeview mpack arj cabextract lzip lunzip bleachbit gparted vlc pv ffmpeg libdvdcss2 mplayer flashplayer-mozilla firmware-realtek nfs-common docky libreoffice x2goserver x2goserver-xsession synaptic apt-xapian-index gdebi gksu firmware-linux intel-microcode ttf-freefont ttf-mscorefonts-installer ttf-bitstream-vera ttf-dejavu ttf-liberation clementine parcellite evince file-roller shotwell gnome-disk-utility libavcodec-extra xscreensaver-gl playonlinux wine winetricks apt-transport-https putty arp-scan system-config-printer task-print-server cups pkg-config git build-essential automake autoconf libtool pkg-config intltool autoconf-archive libpcre3-dev libglib2.0-dev libgtk-3-dev libxml2-utils cifs-utils
  111.  
  112.  
  113. # Install Intel Drivers for My AC Wifi card and most other intel chips
  114.  
  115. sudo apt-get install firmware-iwlwifi
  116.  
  117.  
  118. # Install Nvidia Drivers
  119. # Follow this tutorial:
  120. http://linuxconfig.org/nvidia-geforce-driver-installation-on-debian-jessie-linux-8-64bit
  121.  
  122. # sudo apt-get install nvidia-driver
  123.  
  124. # sudo apt-get install nvidia-xconfig
  125.  
  126. # sudo apt-get install nvidia-settings
  127.  
  128. # sudo nvidia-xconfig
  129.  
  130. # sudo nvidia-settings
  131.  
  132. # Run this comand to fix lag:
  133.  
  134. sudo nvidia-settings -a InitialPixmapPlacement=0
  135.  
  136. # Then Install Steam
  137. # Follow this tutorial:
  138. http://linuxconfig.org/installation-of-steam-client-on-debian-jessie-8-linux-64bit
  139.  
  140. wget http://media.steampowered.com/client/installer/steam.deb
  141. sudo dpkg -i steam.deb
  142. sudo apt-get -f install
  143. sudo dpkg --add-architecture i386
  144. sudo apt-get update
  145. sudo apt-get install libgl1-mesa-dri:i386 libgl1-mesa-glx:i386 libc6:i386
  146. sudo apt-get install libgl1-nvidia-glx:i386
  147. steam
  148.  
  149.  
  150. ######### Debian Fixes for Random Bugs #########
  151.  
  152. # Disabling Soundcards in Debian using ALSA
  153. cat /proc/asound/cards
  154.  
  155.  
  156. cat /proc/asound/modules
  157.  
  158.  
  159. sudo nano /etc/modprobe.d/alsa-base.conf
  160. options snd_hda_intel index=-1
  161. options snd_usb_intel index=-2
  162.  
  163.  
  164. sudo nano /etc/modprobe.d/sound
  165. options snd-usb-audio index=0
  166. options snd-hda_intel index=-1
  167. options snd-hda_intel index=-2
  168.  
  169.  
  170. sudo nano /etc/modprobe.d/blacklist.conf
  171. blacklist snd_hda_intel
  172.  
  173. # Cinnamon: No admin prompt for elevated privileges
  174. # Basically if I tried opening Gparted or Synaptic it wouldn't because no admin password prompt
  175. # Found the fix on a Debian bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845764
  176.  
  177. # Edit this file: "/usr/share/applications/cinnamon-polkit-gnome-authentication-agent-1.desktop"
  178.  
  179. '/usr/share/applications/cinnamon-polkit-gnome-authentication-agent-1.desktop' has some thing wrong.
  180. In this file, at about line 82, there is
  181. 'Exec=/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1',
  182. but in the fact, there is no directory named policykit-1-gnome in '/usr/lib/'.
  183. It should be 'Exec=/usr/lib/polkit-gnome-authentication-agent-1'
  184.  
  185.  
  186. # Install Grub Customizer to change Grub boot order
  187. # Follow this tutorial:
  188. http://www.linuxserve.com/2015/05/how-to-install-grub-customizer-406-in.html
  189.  
  190. # Reset Panel in XFCE to defualt
  191.  
  192. xfce4-panel --quit ; pkill xfconfd ; rm -rf ~/.config/xfce4/panel ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml ; xfce4-panel;
  193.  
  194. ######### NFS Server Shares for Kodi ########
  195.  
  196. # Install Requirements
  197. sudo apt-get install nfs-kernel-server nfs-common
  198.  
  199. # Pick which folder you want to share and change permissions and ownership
  200. mkdir /home/client1
  201. chown nobody:nogroup /home/client1
  202. chmod 755 /home/client1
  203.  
  204. # Add the folder as a NFS share to the exports file
  205. sudo gedit /etc/exports
  206. "/home/dan/Videos 10.0.0.0/255.255.255.0(rw,all_squash,insecure)"
  207.  
  208. Save changes and close
  209.  
  210. # Restart the NFS service
  211. /etc/init.d/nfs-kernel-server restart
  212.  
  213.  
  214. ######### Mounting Network Shares (fstab) #########
  215.  
  216.  
  217. # Setup fstab to mount shares
  218. # Follow this tutorial:
  219. # I have included my fstab file which mounts the share using my user
  220. https://wiki.ubuntu.com/MountWindowsSharesPermanently
  221.  
  222. # How you manually mount a smb/cifs share:
  223.  
  224. mount.cifs //10.0.0.10/employee_storage/ /mnt/shares/employee_storage/ -o user=dan,pass=security
  225.  
  226. //10.0.0.10/employee_storage /mnt/shares/employee_storage cifs username=dan,password=security 0 0
  227.  
  228. # Edit fstab
  229.  
  230. sudo gedit /etc/fstab
  231.  
  232. # My fstab file looks like this
  233.  
  234. # /etc/fstab: static file system information.
  235. #
  236. # Use 'blkid' to print the universally unique identifier for a
  237. # device; this may be used with UUID= as a more robust way to name devices
  238. # that works even if disks are added and removed. See fstab(5).
  239. #
  240. # <file system> <mount point> <type> <options> <dump> <pass>
  241. # / was on /dev/sda1 during installation
  242. UUID=e319384f-9b7f-4cce-8930-90297c59b87c / ext4 errors=remount-ro 0 1
  243. # swap was on /dev/sda5 during installation
  244. UUID=91b7f2a3-8200-4fbd-bd04-5408708f80f2 none swap sw 0 0
  245.  
  246. ##### ONLY USE THE EXAMPLES FROM BLOW THIS LINE THE ABOVE WILL BE DIFFERENT FOR EACH DEVICE #####
  247.  
  248. # FreeNAS NFS Shares
  249. #Prometheus
  250. 10.0.0.25:/mnt/Prometheus /mnt/nfs/Prometheus nfs rw,sync,hard,intr 0 0
  251. 10.0.0.25:/mnt/Prometheus/Movies /mnt/nfs/Prometheus/Movies nfs rw,sync,hard,intr 0 0
  252. 10.0.0.25:/mnt/Prometheus/TVshows /mnt/nfs/Prometheus/TVshows nfs rw,sync,hard,intr 0 0
  253.  
  254. #Kronos
  255. 10.0.0.25:/mnt/Kronos/Applications /mnt/nfs/Kronos/Applications nfs rw,sync,hard,intr 0 0
  256. 10.0.0.25:/mnt/Kronos/Movies /mnt/nfs/Kronos/Movies nfs rw,sync,hard,intr 0 0
  257. 10.0.0.25:/mnt/Kronos/Storage /mnt/nfs/Kronos/Storage nfs rw,sync,hard,intr 0 0
  258. 10.0.0.25:/mnt/Kronos/TVshows /mnt/nfs/Kronos/TVshows nfs rw,sync,hard,intr 0 0
  259. 10.0.0.25:/mnt/Kronos/Anime /mnt/nfs/Kronos/Anime nfs rw,sync,hard,intr 0 0
  260.  
  261. #FreeNAS SMB Shares
  262. #Kronos
  263. //10.0.0.25/KMovies /mnt/smb/Kronos/Movies cifs guest,uid=1000,comment=systemd.automount,iocharset=utf8 0 0
  264. //10.0.0.25/KTVshows /mnt/smb/Kronos/TVshows cifs guest,uid=1000,comment=systemd.automount,iocharset=utf8 0 0
  265. //10.0.0.25/KStorage /mnt/smb/Kronos/Storage cifs guest,uid=1000,comment=systemd.automount,iocharset=utf8 0 0
  266. //10.0.0.25/KApplications /mnt/smb/Kronos/Applications cifs guest,uid=1000,comment=systemd.automount,iocharset=utf8 0 0
  267. //10.0.0.25/KAnime /mnt/smb/Kronos/Anime cifs guest,uid=1000,comment=systemd.automount,iocharset=utf8 0 0
  268.  
  269. #Prometheus
  270. //10.0.0.25/PMovies /mnt/smb/Prometheus/Movies cifs guest,uid=1000,comment=systemd.automount,iocharset=utf8 0 0
  271. //10.0.0.25/PTVshows /mnt/smb/Prometheus/TVshows cifs guest,uid=1000,comment=systemd.automount,iocharset=utf8 0 0
  272. //10.0.0.25/PDocuments /mnt/smb/Prometheus/Documents cifs guest,uid=1000,comment=systemd.automount,iocharset=utf8 0 0
  273.  
  274. --------------------------------------------------------------------------------------------------------------------------------------------------
  275.  
  276. If you want to setup the NFS client on your linux machine (After setting up NFS shares on FreeNAS)
  277. First Install the client:
  278.  
  279. "sudo apt-get install nfs-common"
  280.  
  281. Then make your directories to mount the NFS shares to:
  282.  
  283. "sudo mkdir -p /mnt/nfs/Prometheus"
  284.  
  285. And do this for all of the directories you have. Then you need to try and mount the NFS shares:
  286.  
  287. "sudo mount 192.168.2.25:/mnt/Prometheus /mnt/nfs/Prometheus"
  288.  
  289. or
  290.  
  291. "sudo mkdir -p /mnt/nfs/Games"
  292. "sudo mount 192.168.2.25:/mnt/Storage/Storage/Games /mnt/nfs/Games"
  293.  
  294. I noticed I coulnt just mount storage and view the files inside, so I ended up just mounting the folders
  295. in my storage zpool is setup as Storage/Storage/"Folders"
  296. The "Folders" is different datasets setup in FreeNAS so I can monitor the size for each folder better and through the WebUI
  297.  
  298. ----------------------------------------------------------------------------------------------------------------------------------------------
  299.  
  300. Now to set it up to mount those shares at boot of the PC
  301.  
  302. So edit fstab:
  303. "sudo gedit /etc/fstab"
  304.  
  305. #NFS Shares to mount at bootup
  306.  
  307. 192.168.0.100:/mnt/Prometheus /mnt/nfs/Prometheus nfs rw,sync,hard,intr 0 0
  308.  
  309. -----------------------------------------------------------------------------------------------------------------------------------------------
  310.  
  311. # Unzipping multiple .rar and .zip files
  312.  
  313. Unzip multiple .rar files:
  314. "for f in *.rar;do unrar e $f;done"
  315.  
  316. Unzip multiple .zip files:
  317. "unzip '*.zip' -d /folder/with/zips/"
  318.  
  319. # Repackage .deb files
  320. mkdir tmp
  321. dpkg-deb -R original.deb tmp
  322. # edit DEBIAN/postinst
  323. dpkg-deb -b tmp fixed.deb
  324.  
  325.  
  326. ----------------------------------------------------------------------------------------------------------
  327.  
  328. # Building from source and errors and how to fix them #
  329.  
  330. Error: configure: WARNING: 'missing' script is too old or missing
  331.  
  332. Run this before configure, make, make install:
  333.  
  334. autoreconf -fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement