Results 1 to 2 of 2

Thread: sudo dpkg-scanpackages DOES NOT work??WHY?

  1. #1
    Join Date
    Aug 2007
    Beans
    70

    sudo dpkg-scanpackages DOES NOT work??WHY?

    Hey Guys,

    I'm trying to make a BASH script that makes metapackages.

    I've hit a problem

    I get permission errors when trying to run;
    sudo dpkg-scanpackages . /dev/null | sudo gzip -9c > Packages.gz

    If I run sudo su or sudo -i first it will work great in the terminal but not in a BASH script (The script stops).

    Any Ideas how to get around this? I'm stumped. Thanks!
    H.

  2. #2
    Join Date
    Mar 2008
    Beans
    1,755

    Re: sudo dpkg-scanpackages DOES NOT work??WHY?

    You can't use sudo in a script. Instead you must run the script with sudo. Remove sudo from your scripts and execute like so (assuming that it is test.sh)

    sudo ./test.sh

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •