Advertisement
OldManRiver

Untitled

Aug 30th, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. #!/bin/bash
  2. if [[ $(/usr/bin/id -u) -ne 0 ]]
  3. > then
  4. > echo 'Please run this script as the "root" user (uid 0).'
  5. > exit 1
  6. > fi
  7. if [[ ! -x /usr/bin/apt-show-versions ]]
  8. > then
  9. > echo 'To use this script, please run this command first:'
  10. > echo ' sudo apt install apt-show-versions'
  11. > exit 2
  12. > fi
  13. To use this script, please run this command first:
  14. sudo apt install apt-show-versions
  15. exit
  16. /usr/bin/apt-get update --quiet=2 --download-only
  17. E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
  18. E: Unable to lock directory /var/lib/apt/lists/
  19. E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
  20. E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
  21. FOREIGN=$(tempfile --prefix=fopa_)
  22. /usr/bin/apt-show-versions | grep -Ev ' (uptodate|not installed)$' > $FOREIGN
  23. -bash: /usr/bin/apt-show-versions: No such file or directory
  24. if [ -e $FOREIGN ]
  25. > then
  26. > echo 'Packages / package versions which are installed but of unknown origin:'
  27. > cat $FOREIGN
  28. > else
  29. > echo 'Note: No packages / package versions of unknown origin were found' >&2
  30. > fi
  31. Packages / package versions which are installed but of unknown origin:
  32. rm $FOREIGN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement