Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [[ $(/usr/bin/id -u) -ne 0 ]]
- > then
- > echo 'Please run this script as the "root" user (uid 0).'
- > exit 1
- > fi
- if [[ ! -x /usr/bin/apt-show-versions ]]
- > then
- > echo 'To use this script, please run this command first:'
- > echo ' sudo apt install apt-show-versions'
- > exit 2
- > fi
- To use this script, please run this command first:
- sudo apt install apt-show-versions
- exit
- /usr/bin/apt-get update --quiet=2 --download-only
- E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
- E: Unable to lock directory /var/lib/apt/lists/
- E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
- E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
- FOREIGN=$(tempfile --prefix=fopa_)
- /usr/bin/apt-show-versions | grep -Ev ' (uptodate|not installed)$' > $FOREIGN
- -bash: /usr/bin/apt-show-versions: No such file or directory
- if [ -e $FOREIGN ]
- > then
- > echo 'Packages / package versions which are installed but of unknown origin:'
- > cat $FOREIGN
- > else
- > echo 'Note: No packages / package versions of unknown origin were found' >&2
- > fi
- Packages / package versions which are installed but of unknown origin:
- rm $FOREIGN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement