Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › The dumb question about tarballing, terminal, and other generic things thread.
New Posts  All Forums:Forum Nav:

The dumb question about tarballing, terminal, and other generic things thread.

post #1 of 31
Thread Starter 
Since I'm going to start trying out things I'm not that comfortable with I thought I'd confine all my future questions into one thread instead of many. The whole purpose being to learn more quickly than aimlessly searching around the net. However, if anyone else has questions about terminal, kernel, hardware, or other general things then feel free to ask them here as this will be the brunt I believe of my questions.

So I'll start things off with my current dilemma resulting from trying to install from tarballs:

1) why does rmdir exist if it only works on empty directories (I'm calling them folders from here on out)? (see dumb question)

2) Is there a faster/easier way than "rm -r" to clean out folders? Or is there another command that can do the same thing?

3) So after I untar things and install from the untared folder is there any reason to keep it? Aren't the files that will be used by the program going to be in /etc or drawn from /lib, /bin or similar now?

4) Finally, how difficult is it to get, install, and then use a kernel on my own without having a packagemanager do that for me?
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
Reply
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
Reply
post #2 of 31
Installing a kernel is way easy. I create .deb packages but you can always install the oldschool way and just forget about it.

[edit] I should have clarified more on the kernel part, it's really about 4 commands. "make gconfig" you can use xconfig, config, menuconfig, and oldconfig, but it all does the same thing as it makes your config file. gconfig/xconfig are graphical, menuconfig is in the terminal, oldconfig is what it sounds like it just uses your old config and then asks you questions about any new settings. I recommend gconfig/xconfig for anyone, no matter your skill level as it's just much easier to sort through. After that it's like make, make modules, make modules_install, make install, your done. If it doesn't build you obviously have to figure out why but that's the same with every thing you build with source. That is the old way, if you want to make a package (deb/tar.gz/.rpm/ect..) you use the distro command. Debian does make-kpkg <options> and that runs your make/make modules/ect... for you and spits out a .deb! It's the same for just about every distro, each thing has a slightly different command and options. I like making packages cause then it's easier to remove.

This brings me to your case about source folders. The only source folder you'll ever need to keep is the kernel source folder, it becomes your "kernel headers" and is what /usr/src/linux links to. If you make a separate headers folder package you shouldn't need to keep it but currently Debian is being a poo when it comes to that and I have to keep it anyways. I know arch makes it's own headers nicely, Ubuntu might, really they all should. I still like keeping the kernel source dir cause then if I need to re-compile (to change something) I can easily (plus the doubling for the headers).

rm -r is the only way to remove a folder really, it's the base command. You could make a script rmdir or whatever that would do rm -r <variable> so that you can just do rmdir /folder but why bother when rm -r is already that small of a command.

I just ignore rmdir, I use rm -r, same amount of letters.
Edited by mushroomboy - 1/28/11 at 7:36pm
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
post #3 of 31
rmdir maybe useful in simplifying scripts like you can run rmdir * and it will only delete empty directories. Also I feel a lot safer running rmdir. Mistyping anything with rm -r ...I wouldn't even want to think about it.
post #4 of 31
Quote:
Originally Posted by Rookie1337 View Post

1) why does rmdir exist if it only works on empty directories (I'm calling them folders from here on out)? (see dumb question)
prolly just a "leftover" command or a duplicate command that was made, but rm -r proved effective enough, so they never went any further with it.

Quote:
Originally Posted by Rookie1337 View Post
2) Is there a faster/easier way than "rm -r" to clean out folders? Or is there another command that can do the same thing?
not that i'm aware of, rm -r is what i've always used.

Quote:
Originally Posted by Rookie1337 View Post
3) So after I untar things and install from the untared folder is there any reason to keep it? Aren't the files that will be used by the program going to be in /etc or drawn from /lib, /bin or similar now?
if it is a source tarball and you compiled and installed, and didn't build a package from it, there will be no easy way to go thru and remove the program if ever want to without it, i could be wrong on this, as i've always built packages from source.

Quote:
Originally Posted by Rookie1337 View Post
4) Finally, how difficult is it to get, install, and then use a kernel on my own without having a packagemanager do that for me?
the hardest part in creating a kernel is getting it configured right, there are plenty of guides out this for this, but mushroomboy did give you the gist of it.
Bazinga Punk
(12 items)
 
ooh shiny!
(6 items)
 
 
CPUMotherboardGraphicsRAM
Intel Xeon 3440 AsRock P55 extreme Evga 8800 GT 512 MB Gskill Ripjaws 
Hard DriveCoolingOSMonitor
Western Digital Blue Antec Khuler 620 Ubuntu 11.10 Asus vw264H 
KeyboardPowerCaseMouse
GIGABYTE KM7600 CORSAIR TX 650 Cooler Master 590 GIGABYTE GM-M6800 
CPUMotherboardGraphicsRAM
Intel Core I5 6500 Gigabyte z170xp-SLI Nvidia 970gtx Corsair 16gb ddr4 2666mhz  
Hard DriveOS
250gb Samsung Evo 850 Windows 10 & Ubuntu 15.10 
  hide details  
Reply
Bazinga Punk
(12 items)
 
ooh shiny!
(6 items)
 
 
CPUMotherboardGraphicsRAM
Intel Xeon 3440 AsRock P55 extreme Evga 8800 GT 512 MB Gskill Ripjaws 
Hard DriveCoolingOSMonitor
Western Digital Blue Antec Khuler 620 Ubuntu 11.10 Asus vw264H 
KeyboardPowerCaseMouse
GIGABYTE KM7600 CORSAIR TX 650 Cooler Master 590 GIGABYTE GM-M6800 
CPUMotherboardGraphicsRAM
Intel Core I5 6500 Gigabyte z170xp-SLI Nvidia 970gtx Corsair 16gb ddr4 2666mhz  
Hard DriveOS
250gb Samsung Evo 850 Windows 10 & Ubuntu 15.10 
  hide details  
Reply
post #5 of 31
Oh and I lied again, apparently Debian make-kpkg is doing the headers correctly. Arrr, I just exited out of xorg to test this and it worked fine this time. =S Now I can delete the source dir =S lol I won't though.
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
post #6 of 31
Thread Starter 
Thanks for the replies. I feel bad since I'm not getting most of it.

I guess I was hoping that I wouldn't have to sit there and hit "y" for every single file and then empty folder when I need to remove the untared source files.

Now, you guys mentioned making packages out of the untared source files; does this mean that you would be having the package manager take over the install if you ran the packages instead? So if I make a package like an rpm out of the kernel then the package manager would take care of the install? I'm a bit nervous about doing a kernel install by myself right now.
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
Reply
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
Reply
post #7 of 31
Whenever I need to clean out a folder, I just delete the folder and mkdir a new one of the same name lol.
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
post #8 of 31
Greetz
There really is no need to be nervous about trying new kernels from repositories or especially DIY custom compiles. As long as you keep your old working kernel and simply add the new one, you can always go back.

Let's say that you presently have kernel version 2.6.34 and you want to compile 2.6.36, If you copy your current config, "/boot/config-2.6.34" to the kernel source location, commonly would be "/usr/src/linux-2.6.36", to "/usr/src/linux-2.6.36/.config (don't forget the "dot") and run "make oldconfig" it will use all your current working settings and ask you what you want to do with new ones.

If you simply run "make" your new freshly compiled kernel image can be found as "/usr/src/linux-2.6.36/arch/x86/bzImage". Simply copy that along with associated files like this, assuming you are in terminal at the build location "/usr/src/linux-2.6.36"

Code:
cat arch/x86/bzImage > /boot/vmlinuz-2.6.36
cp System.map /boot/System.map-2.6.36
cp .config /boot/config-2.6.36
When you run "make modules&&make modules_install" notice that the modules folder will carry with it the consistent kernel version designation as in "/lib/modules/2.6.36". This is done for you by the compiler so all the necessary files carry the suffix, in this case 2.6.36.

Distros using grub2 will automatically add the new kernel with "update-grub". Systems using legacy grub or lilo have to have kernels added manually and then the appropriate updater to have them recognize the new entry. Your menu will then include your old kernel as well as your new one. The only caveat is that if you use the proprietary nVidia driver you will in most cases have to run the installer again for the new kernel so it can build the nvidia.ko module for that kernel.

If the new kernel fails for any reason (extremely uncommon after oldconfig) you can always simply run the old one(s).

Incidentally I hate initrd and always compile with drive controller and file system support built in at kernel level rather than as loadable modules so I don't need one, so I din;t include any info on creating a new initrd here. For that. do what you prefer or try both.

Hope this helps
NewMain
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 - 3550 Asrock Z77 Extreme4 Gigabyte GTX 760  4x2GB Corsair Vengeance 
Hard DriveOptical DriveCoolingOS
Seagate SATA 2TB x 2  Plextor PX-891SAW CM-Hyper N520 Slackware 14, Studio KUbuntu, OpenSuSe 12.3, Wi... 
MonitorKeyboardPowerCase
32" Vizio HDTV + DLP Logitech Wireless Corsair HX-850 Antec Sonata I 
MouseMouse PadAudioOther
Razer DeathAdder 2013 dual ESI Juli@ CoolGear ExtSata Enclosure w/ Optical and 3TB S... 
  hide details  
Reply
NewMain
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 - 3550 Asrock Z77 Extreme4 Gigabyte GTX 760  4x2GB Corsair Vengeance 
Hard DriveOptical DriveCoolingOS
Seagate SATA 2TB x 2  Plextor PX-891SAW CM-Hyper N520 Slackware 14, Studio KUbuntu, OpenSuSe 12.3, Wi... 
MonitorKeyboardPowerCase
32" Vizio HDTV + DLP Logitech Wireless Corsair HX-850 Antec Sonata I 
MouseMouse PadAudioOther
Razer DeathAdder 2013 dual ESI Juli@ CoolGear ExtSata Enclosure w/ Optical and 3TB S... 
  hide details  
Reply
post #9 of 31
Quote:
Originally Posted by Rookie1337 View Post
3) So after I untar things and install from the untared folder is there any reason to keep it?
I feel like this is the only question left that could use a bit more explanation. If find that it is much easier to uninstall applications that you've compiled and installed by leaving that folder and later using "make uninstall", but not all sources even bother supporting that. Overall, I'd recommend that you make everything packages and then install them with your package manager. It makes things MUCH cleaner.

Arch Linux follows this philosophy pretty hardcore. Everything gets made into a package and I mean everything!
post #10 of 31
Thread Starter 
Alright I feel like I'm risking a dunce cap with this but:

I need to still compile, make, install before creating a package out of the files right? Or can I make the rpm first?
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
Reply
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › The dumb question about tarballing, terminal, and other generic things thread.