Se o pacote deb
ainda estiver abaixo de /var/cache/apt/archives/
, você poderá usar dpkg -c <packagename>
para listar o conteúdo do pacote. Exemplo de saída para o pacote apt-file_2.5.1_all.deb (agora estou em um sistema Debian):
drwxr-xr-x root/root 0 2012-06-03 10:32 ./
drwxr-xr-x root/root 0 2012-06-03 10:32 ./etc/
drwxr-xr-x root/root 0 2012-06-03 10:32 ./etc/apt/
-rw-r--r-- root/root 2144 2012-06-03 10:32 ./etc/apt/apt-file.conf
drwxr-xr-x root/root 0 2012-06-03 10:32 ./etc/bash_completion.d/
-rw-r--r-- root/root 748 2012-06-03 10:32 ./etc/bash_completion.d/apt-file
drwxr-xr-x root/root 0 2012-06-03 10:32 ./usr/
drwxr-xr-x root/root 0 2012-06-03 10:32 ./usr/bin/
-rwxr-xr-x root/root 10584 2012-06-03 10:32 ./usr/bin/diffindex-download
-rwxr-xr-x root/root 8762 2012-06-03 10:32 ./usr/bin/diffindex-rred
-rwxr-xr-x root/root 23919 2012-06-03 10:32 ./usr/bin/apt-file
-rwxr-xr-x root/root 6437 2012-06-03 10:32 ./usr/bin/rapt-file
drwxr-xr-x root/root 0 2012-06-03 10:32 ./usr/share/
drwxr-xr-x root/root 0 2012-06-03 10:32 ./usr/share/apt-file/
-rw-r--r-- root/root 558 2012-06-03 10:32 ./usr/share/apt-file/apt-file-update.update-notifier
-rwxr-xr-x root/root 98 2012-06-03 10:32 ./usr/share/apt-file/do-apt-file-update
-rwxr-xr-x root/root 370 2012-06-03 10:32 ./usr/share/apt-file/is-cache-empty
drwxr-xr-x root/root 0 2012-06-03 10:32 ./usr/share/man/
drwxr-xr-x root/root 0 2012-06-03 10:32 ./usr/share/man/man1/
-rw-r--r-- root/root 2628 2012-06-03 10:32 ./usr/share/man/man1/apt-file.1.gz
-rw-r--r-- root/root 905 2012-06-03 10:32 ./usr/share/man/man1/diffindex-download.1.gz
-rw-r--r-- root/root 646 2012-06-03 10:32 ./usr/share/man/man1/diffindex-rred.1.gz
-rw-r--r-- root/root 1023 2012-06-03 10:32 ./usr/share/man/man1/rapt-file.1.gz
drwxr-xr-x root/root 0 2012-06-03 10:32 ./usr/share/doc/
drwxr-xr-x root/root 0 2012-06-03 10:32 ./usr/share/doc/apt-file/
-rw-r--r-- root/root 401 2012-06-02 18:50 ./usr/share/doc/apt-file/README
-rw-r--r-- root/root 464 2012-06-02 18:50 ./usr/share/doc/apt-file/copyright
-rw-r--r-- root/root 8634 2012-06-03 10:28 ./usr/share/doc/apt-file/changelog.gz
drwxr-xr-x root/root 0 2012-06-03 10:32 ./var/
drwxr-xr-x root/root 0 2012-06-03 10:32 ./var/cache/
drwxr-xr-x root/root 0 2012-06-03 10:32 ./var/cache/apt/
drwxr-xr-x root/root 0 2012-06-03 10:32 ./var/cache/apt/apt-file/
Agora você pode verificar as permissões e defini-las adequadamente.
Este site tem um script (impresso abaixo) que você poderia usar para redefinir as permissões de acordo com os pacotes presentes em seu sistema.
Para limitar o escopo do script a um único pacote .deb
, copie o pacote em questão de /var/cache/apt/archives/
para outra pasta e coloque essa pasta na variável ARCHIVE_DIR
do script.
#!/bin/bash
# Restores file permissions for all files on a debian system for which .deb
# packages exist.
#
# Author: Larry Kagan <me at larrykagan dot com>
# Since 2007-02-20
ARCHIVE_DIR=/var/cache/apt/archives/
PACKAGES='ls $ARCHIVE_DIR'
cd /
function changePerms()
{
CHOWN="/bin/chown"
CHMOD="/bin/chmod"
PERMS='echo | sed -e 's/--x/1/g' -e 's/-w-/2/g' -e 's/-wx/3/g' -e 's/r--/4/g' -e 's/r-x/5/g' -e 's/rw-/6/g' -e 's/rwx/7/g' -e 's/---/0/g''
PERMS='echo ${PERMS:1}'
OWN='echo | /usr/bin/tr '/' '.''
PATHNAME=
PATHNAME='echo ${PATHNAME:1}'
echo -e "CHOWN: $CHOWN $OWN $PATHNAME"
result='$CHOWN $OWN $PATHNAME'
if [ $? -ne 0 ]; then
echo -e $result
fi
echo -e "CHMOD: $CHMOD $PERMS $PATHNAME"
result='$CHMOD $PERMS $PATHNAME'
if [ $? -ne 0 ]; then
echo -e $result
fi
}
for PACKAGE in $PACKAGES;
do
if [ -d $PACKAGE ]; then
continue;
fi
echo -e "Getting information for $PACKAGE\n"
FILES='/usr/bin/dpkg -c "${ARCHIVE_DIR}${PACKAGE}"'
for FILE in "$FILES";
do
echo "$FILE" | awk '{print "\t""\t"}' | while read line;
do
changePerms $line
done
done
done