LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   how can I find the file belong to what pkg? (http://www.linuxquestions.org/questions/slackware-14/how-can-i-find-the-file-belong-to-what-pkg-298710/)

jiawj 03-07-2005 10:12 AM

how can I find the file belong to what pkg?
 
my distro is slackware 9.1.

a similar example:

rpm -qf /etc/inittab

can find /etc/inittab is part of initscripts-7.31.16.EL-1

thx for any help

Okie 03-07-2005 10:17 AM

Code:

#
# inittab This file describes how the INIT process should set up
#  the system in a certain run-level.
#
# Version: @(#)inittab  2.04 17/05/93 MvS
#                                      2.10    02/10/95        PV
#                                      3.00    02/06/1999      PV
#                                      4.00    04/10/2002      PV
#
# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
# Modified by: Patrick J. Volkerding, <volkerdi@slackware.com>
#

# These are the default runlevels in Slackware:
#  0 = halt
#  1 = single user mode
#  2 = unused (but configured the same as runlevel 3)
#  3 = multiuser mode (default Slackware runlevel)
#  4 = X11 with KDM/GDM/XDM (session managers)
#  5 = unused (but configured the same as runlevel 3)
#  6 = reboot

# Default runlevel. (Do not set to 0 or 6)
id:4:initdefault:

# System initialization (runs when system boots).
si:S:sysinit:/etc/rc.d/rc.S

# Script to run when going single user (runlevel 1).
su:1S:wait:/etc/rc.d/rc.K

# Script to run when going multi user.
rc:2345:wait:/etc/rc.d/rc.M

# What to do at the "Three Finger Salute".
ca::ctrlaltdel:/sbin/shutdown -t5 -r now

# Runlevel 0 halts the system.
l0:0:wait:/etc/rc.d/rc.0

# Runlevel 6 reboots the system.
l6:6:wait:/etc/rc.d/rc.6

# What to do when power fails.
pf::powerfail:/sbin/genpowerfail start

# If power is back, cancel the running shutdown.
pg::powerokwait:/sbin/genpowerfail stop

# These are the standard console login getties in multiuser mode:
c1:1235:respawn:/sbin/agetty 38400 tty1 linux
c2:1235:respawn:/sbin/agetty 38400 tty2 linux
c3:1235:respawn:/sbin/agetty 38400 tty3 linux
c4:1235:respawn:/sbin/agetty 38400 tty4 linux
c5:1235:respawn:/sbin/agetty 38400 tty5 linux
c6:12345:respawn:/sbin/agetty 38400 tty6 linux

# Local serial lines:
#s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100
#s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100

# Dialup lines:
#d1:12345:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS0 vt100
#d2:12345:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS1 vt100

# Runlevel 4 used to be for an X window only system, until we discovered
# that it throws init into a loop that keeps your load avg at least 1 all
# the time. Thus, there is now one getty opened on tty6. Hopefully no one
# will notice. ;^)
# It might not be bad to have one text console anyway, in case something
# happens to X.
x1:4:wait:/etc/rc.d/rc.4

# End of /etc/inittab


Okie 03-07-2005 10:20 AM

that should work, it is the inittab out of slackware-10.1 but the date shows it older than 9.1 so they should be the same, copy & paste it to a text file and give it the inittab name and save it in /etc and it should work...

if anyone knows this wont work please correct me on this idea...

jiawj 03-07-2005 10:46 AM

sorry! Okie
my english is bad. :cry:

I mean I wanna find a command that can find a file belong to what package

I can list a serial of files ownership of a slackware package by pkgtool.

but the other way round, I can't find a file belong to what package.

perfect_circle 03-07-2005 10:58 AM

Re: how can I find the file belong to what pkg?
 
Quote:

Originally posted by jiawj
my distro is slackware 9.1.

a similar example:

rpm -qf /etc/inittab

can find /etc/inittab is part of initscripts-7.31.16.EL-1

thx for any help

Code:

skalkoto@darkstar:~$ grep "etc/inittab" -i /var/log/packages/*
/var/log/packages/sysvinit-2.84-i486-51:etc/inittab.new
skalkoto@darkstar:~$

*EDIT*
For every installed package in slackware there is a file in /var/log/packages with filename, the name of the package, that contains in pure text all the files that are contained in this package

Code:

skalkoto@darkstar:~$ cat /var/log/packages/sysvinit-2.84-i486-51
PACKAGE NAME:    sysvinit-2.84-i486-51
COMPRESSED PACKAGE SIZE:    269 K
UNCOMPRESSED PACKAGE SIZE:    590 K
PACKAGE LOCATION: /mnt/cdrom/slackware/a/sysvinit-2.84-i486-51.tgz
PACKAGE DESCRIPTION:
sysvinit: sysvinit (init, the parent of all processes)
sysvinit:
sysvinit: System V style init programs by Miquel van Smoorenburg that control
sysvinit: the booting and shutdown of your system.  These support a number of
sysvinit: system runlevels, each with a specific set of utilities spawned.
sysvinit: For example, the normal system runlevel is 3, which starts agetty
sysvinit: on virtual consoles tty1 - tty6.  Runlevel 4 starts xdm.
sysvinit: Runlevel 0 shuts the system down.
sysvinit:
sysvinit:
sysvinit:
FILE LIST:
./
etc/
etc/rc.d/
etc/rc.d/rc.sysvinit.new
etc/rc.d/rc.local.new
etc/rc.d/rc.4.new
etc/rc.d/rc.6.new
etc/rc.d/rc.K.new
etc/rc.d/rc.M.new
etc/rc.d/rc.S.new
etc/inittab.new
usr/
usr/bin/
usr/bin/last
usr/doc/
usr/doc/sysvinit-2.84/
usr/doc/sysvinit-2.84/sysvinit-2.84.lsm
usr/doc/sysvinit-2.84/Install
usr/doc/sysvinit-2.84/Propaganda
usr/man/
usr/man/man1/
usr/man/man1/last.1.gz
usr/man/man5/
usr/man/man5/initscript.5.gz
usr/man/man5/inittab.5.gz
usr/man/man8/
usr/man/man8/runlevel.8.gz
usr/man/man8/killall5.8.gz
usr/man/man8/shutdown.8.gz
usr/man/man8/poweroff.8.gz
usr/man/man8/init.8.gz
usr/man/man8/halt.8.gz
usr/man/man8/pidof.8.gz
usr/man/man8/reboot.8.gz
usr/man/man8/telinit.8.gz
sbin/
sbin/halt
sbin/shutdown
sbin/killall5
sbin/runlevel
sbin/initscript.sample
sbin/init.new
install/
install/doinst.sh
install/slack-desc
skalkoto@darkstar:~$


spaceballs 03-07-2005 11:11 AM

pkgtool
 
You can also use the pkgtool command to see what packages and directories are installed by each slackware package.

jiawj 03-07-2005 11:17 AM

thx perfect_circle

that a good ways and means

perfect_circle 03-07-2005 11:24 AM

Re: pkgtool
 
Quote:

Originally posted by spaceballs
You can also use the pkgtool command to see what packages and directories are installed by each slackware package.
I don't think pkgtool is an option in this case. He wants to find, in which package inittab is, Unless you are recommending to search one-by-one all the installed packages to find the specific file.

gbonvehi 03-07-2005 12:55 PM

A simple bash command (replace etc/inittab with any file):
Code:

grep -li "etc/inittab" /var/log/packages/*
You could also use http://slackware.com/pb you can search in a lot of ways there.

DaHammer 03-07-2005 08:16 PM

The file you want is MANIFEST.bz2. It's on the CDs in the slackware directory. It contains a complete list of every single file on a default slackware system, as well as the package that installed it.


All times are GMT -5. The time now is 09:26 PM.