The Stack Overflow podcast is back! Listen to an interview with our new CEO.
3 added 13 characters in body
source | link

You can find all manually installed packages without their 1st level of dependencies as follows:

apt-mark showmanual | sort > manually-installed.txt

apt show $(apt-mark showmanual) 2>/dev/null | 
grep -e ^Depends -e ^Pre-Depends > deps1.txt

cat deps1.txt | 
sed 's/^Depends: //; s/^Pre-Depends: //; 
     s/(.*)//g; s/:any//g' > deps2.txt

cat deps2.txt | tr -d ',|' | tr ' ' '\n' | grep -v ^$ |
sort -u > all-dep-packages.txt

grep -v -F -f all-dep-packages.txt manually-installed.txt

You can also use the following one-liner magic:

apt-mark showmanual | sort | grep -v -F -f <(apt show $(apt-mark showmanual) 2> /dev/null | grep -e ^Depends -e ^Pre-Depends | sed 's/^Depends: //; s/^Pre-Depends: //; s/(.*)//g; s/:any//g' | tr -d ',|' | tr ' ' '\n' | grep -v ^$ | sort -u)

You can find all manually installed packages without their dependencies as follows:

apt-mark showmanual | sort > manually-installed.txt

apt show $(apt-mark showmanual) 2>/dev/null | 
grep -e ^Depends -e ^Pre-Depends > deps1.txt

cat deps1.txt | 
sed 's/^Depends: //; s/^Pre-Depends: //; 
     s/(.*)//g; s/:any//g' > deps2.txt

cat deps2.txt | tr -d ',|' | tr ' ' '\n' | grep -v ^$ |
sort -u > all-dep-packages.txt

grep -v -F -f all-dep-packages.txt manually-installed.txt

You can also use the following one-liner magic:

apt-mark showmanual | sort | grep -v -F -f <(apt show $(apt-mark showmanual) 2> /dev/null | grep -e ^Depends -e ^Pre-Depends | sed 's/^Depends: //; s/^Pre-Depends: //; s/(.*)//g; s/:any//g' | tr -d ',|' | tr ' ' '\n' | grep -v ^$ | sort -u)

You can find all manually installed packages without their 1st level of dependencies as follows:

apt-mark showmanual | sort > manually-installed.txt

apt show $(apt-mark showmanual) 2>/dev/null | 
grep -e ^Depends -e ^Pre-Depends > deps1.txt

cat deps1.txt | 
sed 's/^Depends: //; s/^Pre-Depends: //; 
     s/(.*)//g; s/:any//g' > deps2.txt

cat deps2.txt | tr -d ',|' | tr ' ' '\n' | grep -v ^$ |
sort -u > all-dep-packages.txt

grep -v -F -f all-dep-packages.txt manually-installed.txt

You can also use the following one-liner magic:

apt-mark showmanual | sort | grep -v -F -f <(apt show $(apt-mark showmanual) 2> /dev/null | grep -e ^Depends -e ^Pre-Depends | sed 's/^Depends: //; s/^Pre-Depends: //; s/(.*)//g; s/:any//g' | tr -d ',|' | tr ' ' '\n' | grep -v ^$ | sort -u)
2 Wrapped code.
source | link

You can find all manually installed packages without their dependencies as follows:

apt-mark showmanual | sort > manually-installed.txt

apt show $(apt-mark showmanual) 2>/dev/null |  
grep -e ^Depends -e ^Pre-Depends > deps1.txt 

cat deps1.txt |  
sed 's/^Depends: //; s/^Pre-Depends: //; 
     s/(.*)//g; s/:any//g' > deps2.txt 

cat deps2.txt | tr -d ',|' | tr ' ' '\n' | grep -v ^$ |  
sort -u > all-dep-packages.txt

grep -v -F -f all-dep-packages.txt manually-installed.txt

You can also use the following one-liner magic:

apt-mark showmanual | sort | grep -v -F -f <(apt show $(apt-mark showmanual) 2> /dev/null | grep -e ^Depends -e ^Pre-Depends | sed 's/^Depends: //; s/^Pre-Depends: //; s/(.*)//g; s/:any//g' | tr -d ',|' | tr ' ' '\n' | grep -v ^$ | sort -u)

You can find all manually installed packages without their dependencies as follows:

apt-mark showmanual | sort > manually-installed.txt

apt show $(apt-mark showmanual) 2>/dev/null | grep -e ^Depends -e ^Pre-Depends > deps1.txt
cat deps1.txt | sed 's/^Depends: //; s/^Pre-Depends: //; s/(.*)//g; s/:any//g' > deps2.txt
cat deps2.txt | tr -d ',|' | tr ' ' '\n' | grep -v ^$ | sort -u > all-dep-packages.txt

grep -v -F -f all-dep-packages.txt manually-installed.txt

You can also use the following one-liner magic:

apt-mark showmanual | sort | grep -v -F -f <(apt show $(apt-mark showmanual) 2> /dev/null | grep -e ^Depends -e ^Pre-Depends | sed 's/^Depends: //; s/^Pre-Depends: //; s/(.*)//g; s/:any//g' | tr -d ',|' | tr ' ' '\n' | grep -v ^$ | sort -u)

You can find all manually installed packages without their dependencies as follows:

apt-mark showmanual | sort > manually-installed.txt

apt show $(apt-mark showmanual) 2>/dev/null |  
grep -e ^Depends -e ^Pre-Depends > deps1.txt 

cat deps1.txt |  
sed 's/^Depends: //; s/^Pre-Depends: //; 
     s/(.*)//g; s/:any//g' > deps2.txt 

cat deps2.txt | tr -d ',|' | tr ' ' '\n' | grep -v ^$ | 
sort -u > all-dep-packages.txt

grep -v -F -f all-dep-packages.txt manually-installed.txt

You can also use the following one-liner magic:

apt-mark showmanual | sort | grep -v -F -f <(apt show $(apt-mark showmanual) 2> /dev/null | grep -e ^Depends -e ^Pre-Depends | sed 's/^Depends: //; s/^Pre-Depends: //; s/(.*)//g; s/:any//g' | tr -d ',|' | tr ' ' '\n' | grep -v ^$ | sort -u)
1
source | link

You can find all manually installed packages without their dependencies as follows:

apt-mark showmanual | sort > manually-installed.txt

apt show $(apt-mark showmanual) 2>/dev/null | grep -e ^Depends -e ^Pre-Depends > deps1.txt
cat deps1.txt | sed 's/^Depends: //; s/^Pre-Depends: //; s/(.*)//g; s/:any//g' > deps2.txt
cat deps2.txt | tr -d ',|' | tr ' ' '\n' | grep -v ^$ | sort -u > all-dep-packages.txt

grep -v -F -f all-dep-packages.txt manually-installed.txt

You can also use the following one-liner magic:

apt-mark showmanual | sort | grep -v -F -f <(apt show $(apt-mark showmanual) 2> /dev/null | grep -e ^Depends -e ^Pre-Depends | sed 's/^Depends: //; s/^Pre-Depends: //; s/(.*)//g; s/:any//g' | tr -d ',|' | tr ' ' '\n' | grep -v ^$ | sort -u)