Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
2
votes
4
answers
1984
views
Stripping down a Linux (CentOS7) system
How do I strip down a Linux system (especially CentOS 7) to only the parts that I need? I'm not asking for a specific command, but more for a hint to where I can find more about the packages that I have and what they do. If I use `yum list installed` I get a long list of packages. How do I know for...
How do I strip down a Linux system (especially CentOS 7) to only the parts that I need? I'm not asking for a specific command, but more for a hint to where I can find more about the packages that I have and what they do.
If I use
yum list installed
I get a long list of packages. How do I know for which purpose they are on my machine?
How do I know if de-installing them will not break my machine?
*Edit: Thanks for the answers. Using another Linux distribution is not the way I would like to go. First we are using a software which requires RHEL or Debian and second we use CentOS on a few different machines, so I would like to keep using CentOS 7.*
*Thank you nmks for the yum info
command which helps a lot.*
PS: I saw this: How to strip a Linux system , but my question kind of goes into another direction.
dice
(71 rep)
Dec 15, 2015, 02:14 PM
• Last activity: Sep 18, 2019, 10:21 PM
2
votes
1
answers
2112
views
Remove .shstrtab with strip
I've noticed that **strip** removes ELF sections, such as *.symtab* and *.strtab*, but is there a way to force it to remove the **.shstrtab** section as well? I already tried the `-R` option but it didn't work. Strip just exits as if nothing happened. The current strip version is 2.30
I've noticed that **strip** removes ELF sections, such as *.symtab* and *.strtab*, but is there a way to force it to remove the **.shstrtab** section as well? I already tried the
-R
option but it didn't work. Strip just exits as if nothing happened. The current strip version is 2.30
Trey
(85 rep)
May 20, 2018, 06:45 AM
• Last activity: May 26, 2018, 10:16 PM
24
votes
5
answers
3031
views
How to strip a Linux system?
I've been building a Linux distro, and I've stripped the binaries, etc. The system won't use GCC or development tools, as it will be a Chrome kiosk, so it would greatly help if I could strip down the system... I was wondering, is there a way that I can delete all of the unused system files (like bin...
I've been building a Linux distro, and I've stripped the binaries, etc. The system won't use GCC or development tools, as it will be a Chrome kiosk, so it would greatly help if I could strip down the system...
I was wondering, is there a way that I can delete all of the unused system files (like binaries, etc.) by watching what files/libraries are used during runtime? Maybe another method is preferred, but is there a way to accomplish something like this?
Blender
(1883 rep)
Dec 10, 2010, 02:53 AM
• Last activity: Mar 12, 2018, 10:59 AM
0
votes
1
answers
110
views
Samba4 giant on Solaris 11
On linux samba4 is about 60MB at least on Slackware. On Solaris 11 samba4 compiled by myself and installed is 104MB! So i try strip solaris original strip #!/usr/bin/bash set -e find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xa...
On linux samba4 is about 60MB at least on Slackware.
On Solaris 11 samba4 compiled by myself and installed is 104MB!
So i try strip
solaris original strip
#!/usr/bin/bash
set -e
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip -g 2> /dev/null
gnu strip
#!/usr/bin/bash
set -e
STRIP=/opt/csw/gnu/strip
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $STRIP --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $STRIP --strip-unneeded 2> /dev/null
find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $STRIP -g 2> /dev/null
Before run those scripts
du -sh samba4
106MB
After
du -sh samba4
104MB
Only 2mb?
Is normal?
elbarna
(13690 rep)
Dec 18, 2017, 10:57 PM
• Last activity: Dec 19, 2017, 07:27 PM
58
votes
1
answers
84610
views
What are stripped and not-stripped executables in Unix?
From [man file][1], EXAMPLES $ file file.c file /dev/{wd0a,hda} file.c: C program text file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped /dev/wd0a: block special (0/0) /dev/hda: block special (3/0) $ file -s /dev/wd0{b,d} /dev/wd0b: data...
From man file ,
EXAMPLES
$ file file.c file /dev/{wd0a,hda}
file.c: C program text
file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), stripped
/dev/wd0a: block special (0/0)
/dev/hda: block special (3/0)
$ file -s /dev/wd0{b,d}
/dev/wd0b: data
/dev/wd0d: x86 boot sector
$ file -s /dev/hda{,1,2,3,4,5,6,7,8,9,10}
/dev/hda: x86 boot sector
/dev/hda1: Linux/i386 ext2 filesystem
/dev/hda2: x86 boot sector
/dev/hda3: x86 boot sector, extended partition table
/dev/hda4: Linux/i386 ext2 filesystem
/dev/hda5: Linux/i386 swap file
/dev/hda6: Linux/i386 swap file
/dev/hda7: Linux/i386 swap file
/dev/hda8: Linux/i386 swap file
/dev/hda9: empty
/dev/hda10: empty
$ file -i file.c file /dev/{wd0a,hda}
file.c: text/x-c
file: application/x-executable, dynamically linked (uses shared libs),
not stripped
/dev/hda: application/x-not-regular-file
/dev/wd0a: application/x-not-regular-file
What does executable stripping mean?
Why are some of the executables stripped while others are not?
Lazer
(36105 rep)
Oct 11, 2010, 06:10 AM
• Last activity: Jul 21, 2017, 05:28 PM
10
votes
1
answers
8424
views
Why doesn't `strip` remove section headers from ELF executables?
A minimal ELF executable only requires the ELF header and at least one program header in order to be functional. However, when I run strip on a short executable, it decides not to throw out the section header table or the section strings section, keeping them around although they have no purpose (as...
A minimal ELF executable only requires the ELF header and at least one program header in order to be functional. However, when I run strip on a short executable, it decides not to throw out the section header table or the section strings section, keeping them around although they have no purpose (as far as I know) for the program's execution.
Is there a reason why these aren't removed by strip? Is there another utility which removes everything which isn't required for the executable to run? I've tried manually editing the code-golfing executable I was making to remove the section headers, and it appears to work fine, and be much smaller.
Mystor
(103 rep)
Mar 2, 2016, 01:22 PM
• Last activity: Aug 3, 2016, 01:21 AM
10
votes
3
answers
3927
views
What harm would there be in running strip on all files?
I'm trying to decrease a Linux image running SuSE, and thought about running `strip` on all of the system's executables. Even though I may not re-gain much disk space this way, would there be any harm in doing so?
I'm trying to decrease a Linux image running SuSE, and thought about running
strip
on all of the system's executables. Even though I may not re-gain much disk space this way, would there be any harm in doing so?
Délisson Junio
(318 rep)
Aug 1, 2016, 08:28 PM
• Last activity: Aug 2, 2016, 07:01 AM
3
votes
1
answers
1183
views
Is it safe to strip the binaries in Linux Mint?
I am trying to reduce the disk space on my computer, and `du` shows that the library directories (`/usr/lib`and `/lib`) and binary directories (`/sbin`, `/bin`, `/usr/bin`, `/usr/sbin`) take up the most space apart from logs which I have already emptied. Is it safe to strip all the binaries and libr...
I am trying to reduce the disk space on my computer, and
du
shows that the library directories (/usr/lib
and /lib
) and binary directories (/sbin
, /bin
, /usr/bin
, /usr/sbin
) take up the most space apart from logs which I have already emptied.
Is it safe to strip all the binaries and libraries, and if so what options to strip
should I use? I am hesitant to trash my system and waste time reinstalling.
sadljkfhalskdjfh
(157 rep)
Aug 8, 2015, 03:36 PM
• Last activity: Jan 22, 2016, 10:18 PM
6
votes
5
answers
24502
views
Stripping directory paths to get file names
What I am doing is converting mp3's with LAME. I already have an old script I wrote that works but I want to add to it this ability--to no longer delete the file but instead save it in a new root folder with sub-directories that match the using the path that it is already in. This is the code I got...
What I am doing is converting mp3's with LAME. I already have an old script I wrote that works but I want to add to it this ability--to no longer delete the file but instead save it in a new root folder with sub-directories that match the using the path that it is already in.
This is the code I got off the Internet that I am using in my script to get the path:
c=$FILENAME
xpath=${c%/*}
xbase=${c##*/}
xfext=${xbase##*.}
xpref=${xbase%.*}
path=${xpath}
pref=${xpref}
ext=${xfext}
The
xpath
and path
give me the directory structure /home/user/working-root-directory/band-folder/album-name/
Using that technique, how do I script this to get just the band-folder into a separate variable and the album-folder into a separate variable?
Then I can use them to create new folders keeping all the mp3s in band album order to put them into a different root folder; this would eliminate me from having to move them myself so the next time I run my script I will not re-sample them again because they will no longer be in the working directoy path/folders and still have a back up copy of my files just in case.
uxserx-bw
(526 rep)
Oct 25, 2014, 02:25 AM
• Last activity: Nov 5, 2015, 12:00 PM
2
votes
3
answers
2693
views
How to reduce ncurses terminfo size
I notice that ncurses's terminfo database on `/usr/share/terminfo` is about 7MB (I compiled it myself). This is too large if I want to deploy it on an embedded Linux of 64MB disk space. Is there a way to reduce its size by deleting unneeded entries and keep the most-used ones? And what's is this act...
I notice that ncurses's terminfo database on
/usr/share/terminfo
is about 7MB (I compiled it myself). This is too large if I want to deploy it on an embedded Linux of 64MB disk space.
Is there a way to reduce its size by deleting unneeded entries and keep the most-used ones? And what's is this actually for?
**EDIT**: Is there any info or reference for commonly used terminfo for regular PCs or SSH clients?
uray
(3958 rep)
Sep 6, 2010, 05:33 PM
• Last activity: Oct 13, 2015, 12:32 AM
9
votes
2
answers
15778
views
How much strip(1)-ing is okay for kernel modules?
I regularly create packages for Slackware Linux and part of the process is stripping binaries so that they take up less space. I find that if I `strip --strip-all` (or `strip` with no options) kernel modules, they often fail to insert: >FATAL: Error inserting cloop (/lib/modules/2.6.38.7-smp/kernel/...
I regularly create packages for Slackware Linux and part of the process is stripping binaries so that they take up less space. I find that if I
strip --strip-all
(or strip
with no options) kernel modules, they often fail to insert:
>FATAL: Error inserting cloop (/lib/modules/2.6.38.7-smp/kernel/fs/cloop/cloop.ko): Invalid module format
What level of stripping is recommended for kernel modules? If I use --strip-debug
, will I remove debugging symbols that will negatively affect system performance and/or error logging?
amphetamachine
(5617 rep)
Nov 26, 2011, 09:16 PM
• Last activity: Nov 27, 2011, 01:56 AM
2
votes
1
answers
5769
views
Core files when the symbols are stripped
I am building an application using g++ 4.3. I am using the with maximum possible optimization level, not using the `-g` option, and I am stripping symbols after it builds. If I do NOT strip symbols from my application and libraries, are the core files still useful? (When they are generated when the...
I am building an application using g++ 4.3. I am using the with maximum possible optimization level, not using the
-g
option, and I am stripping symbols after it builds.
If I do NOT strip symbols from my application and libraries, are the core files still useful? (When they are generated when the application crashes.)
Will the core files be useful if I compile my application with maximum possible optimization? (Without -g
option and without stripping symbols.)
BЈовић
(600 rep)
Jun 9, 2011, 09:57 AM
• Last activity: Jun 9, 2011, 09:38 PM
Showing page 1 of 12 total questions