spamegg wrote: ⤴Thu Dec 02, 2021 4:02 pm
(ah someone else beat me to it)
There is an issue with the alias, because both the start/end of the alias is using single quotes
'...'
, but also there are single quotes inside the command itself, so it causes a parsing issue. Try using double quotes for the start/end of the alias, using single quotes for the command itself, only inside the double-quotes:
Code: Select all
alias sc3="sudo dpkg -l | grep '^rc' | awk '{print $2}' | sudo xargs dpkg --purge"
I tested some other aliases using double-quotes and they work fine...
OK, that makes sense. I tried replacing the single quotes (actually, apostrophes) in SC1 and SC2 with double quotes (actually quotation marks but now I'm just being pedantic; I blame lack of sleep) and they continued to work just fine and dandy.
spamegg wrote: ⤴Thu Dec 02, 2021 4:02 pm
...The response you get from running the command un-aliased is actually normal. I run the same command regularly (un-aliased), so I know. I get the same response quite regularly.
When the earlier part of the command does not find anything to be cleaned up (residual configurations for uninstalled packages), which is often, if you keep your Mint clean and neat like me, which I guess you do, then basically, there is nothing for
xargs
to pass to the
dpkg --purge
command...
OK, that actually made sense to me. Mayhap that is the real reason I never noticed it before since today, unlike before, I ran that command quite a few times today.
spamegg wrote: ⤴Thu Dec 02, 2021 4:02 pm
...The default place to keep aliases is
~/.bash_aliases
although this is more of an organizational preference. I'd recommend moving all your aliases there.
I have no clue how I would move them plus I'm a firm believer in the "if it ain't broke, don't fix it" school of thought" so I'm going to leave well enough alone before I can break something (plus I have a back problem; there is a yellow streak running down it
).
rene wrote: ⤴Thu Dec 02, 2021 4:06 pm
rene wrote: ⤴Thu Dec 02, 2021 3:56 pm
(not looked at the command itself).
By now also looked at the command itself and you actually as part of an alias and now due to the double quotes also still need to escape that
$
in
$2
. That is.
Code: Select all
alias sc3="dpkg -l | grep '^rc' | awk '{print \$2}' | sudo xargs dpkg --purge"
I took a slightly different approach and, instead of creating sc3, I added the "troublesome" command (with your modification) to SC2 where I originally tried to park it. this is what it looks like:
When I run sc2 now, I get this:
Based on what spamegg wrote, everything is now working like it should be.
I originally wanted the commands in sc1 and sc2 to reside in just one alias but when I tried that, even though I opened the Terminal to full screen, the resulting line was too long and when the commands wrapped around to the next line, the previous line disappeared and everything went pear shaped and south without even a hand basket. I thought about putting together the text of the alias in Writer, then copying and pasting it in but, by that time, I was getting tired and frustrated so, instead, I tried putting sc1 and sc2 into another alias named sc. Sonuvagun, it worked (why not? I frequently make short cuts to shortcuts--long story
). Here is what I get when I run sc:
Code: Select all
jeannie@Laptop1:~$ sc
[sudo] password for jeannie:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 58 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 58 not upgraded.
removed '/home/jeannie/.cache/thumbnails/large/012ee5c43e510124f563ed205e65ddd6.png'
removed '/home/jeannie/.cache/thumbnails/large/01a5960e357a2650a04fd7e68ad0f36d.png'
removed '/home/jeannie/.cache/thumbnails/large/0203b1f93662941b823217556353d74c.png'
removed '/home/jeannie/.cache/thumbnails/large/036e9fb3f7ec2c049d9316ba6e4e1ef4.png'
removed '/home/jeannie/.cache/thumbnails/large/03be9427bbc6198d487aed929a7e9804.png'
removed '/home/jeannie/.cache/thumbnails/large/04c3b35c40c4c7146e74066d765e336b.png'
removed '/home/jeannie/.cache/thumbnails/large/0719950931a199ebacad8c210aec00a4.png'
removed '/home/jeannie/.cache/thumbnails/large/08b9aa9ed7136cd02524f6557da03d0f.png'
removed '/home/jeannie/.cache/thumbnails/large/09e64e7db6b6b3358d1befa2d425c0d7.png'
removed '/home/jeannie/.cache/thumbnails/large/0bd3a2ba0adecc9e985c1a9df33eeed4.png'
removed '/home/jeannie/.cache/thumbnails/large/0c381d48f55ad64b1830c30e05e402d1.png'
removed '/home/jeannie/.cache/thumbnails/large/0e452d72c614534f0d2d4e694be05191.png'
removed '/home/jeannie/.cache/thumbnails/large/0f523ea2b1e74dd3979d348f5b33eb19.png'
removed '/home/jeannie/.cache/thumbnails/large/0fc23fe91e011faa33909d088054b935.png'
removed '/home/jeannie/.cache/thumbnails/large/101c3b25e527947c5f5873fbcc81ee1b.png'
removed '/home/jeannie/.cache/thumbnails/large/10b78b794233c81ddb55a880303e3512.png'
removed '/home/jeannie/.cache/thumbnails/large/11c71e75ff1c36e07c0ba33103ed7efe.png'
removed '/home/jeannie/.cache/thumbnails/large/142ab859e901823379b8d1b2f3e4d451.png'
removed '/home/jeannie/.cache/thumbnails/large/145ce75240641cc8508367052b3b0494.png'
removed '/home/jeannie/.cache/thumbnails/large/155fe71bf2a05a70bb768047222f0d39.png'
removed '/home/jeannie/.cache/thumbnails/large/168de0cacc697fd0eb03af684bd3b686.png'
removed '/home/jeannie/.cache/thumbnails/large/170a6efcb3710915e9507ffeec8e6eb2.png'
removed '/home/jeannie/.cache/thumbnails/large/257a14c60ee51976f9a616c704b2a500.png'
removed '/home/jeannie/.cache/thumbnails/large/295d7fd90dd1617608ed75fe7df8aa63.png'
removed '/home/jeannie/.cache/thumbnails/large/3149038897b0d631f624d77c023bf3db.png'
removed '/home/jeannie/.cache/thumbnails/large/36e60f879d3de5f929ffeaef962ada46.png'
removed '/home/jeannie/.cache/thumbnails/large/396722a09da5ed415332f18b0ed57a93.png'
removed '/home/jeannie/.cache/thumbnails/large/3b2cb3107d9979f697f1a3b6cfab9816.png'
removed '/home/jeannie/.cache/thumbnails/large/3b5b144e56a166cdab9f39d22cff42df.png'
removed '/home/jeannie/.cache/thumbnails/large/3c4d287abe25a3faa51981cb1177b692.png'
removed '/home/jeannie/.cache/thumbnails/large/3f34376591121f90dfa68f85de34f996.png'
removed '/home/jeannie/.cache/thumbnails/large/4b3cad1dcb5e128aba56f5f4a9e09c23.png'
removed '/home/jeannie/.cache/thumbnails/large/4b52b8aa47604d0a320da3d2cea9efb2.png'
removed '/home/jeannie/.cache/thumbnails/large/4f9341a0f6ed5fb4c987b3e3362042fe.png'
removed '/home/jeannie/.cache/thumbnails/large/55845f2b48ef781dceef83926fb847d2.png'
removed '/home/jeannie/.cache/thumbnails/large/5afa01590a3b29abce6c5c81f7e71bf2.png'
removed '/home/jeannie/.cache/thumbnails/large/5c60f2186fca113a253750c878da221b.png'
removed '/home/jeannie/.cache/thumbnails/large/5e91d34dc8f11d8004f84de39914d0e4.png'
removed '/home/jeannie/.cache/thumbnails/large/5ee4822dd55baa626b85ddd523ba53c6.png'
removed '/home/jeannie/.cache/thumbnails/large/5f29153de4ca54f504d06ddc72f45c37.png'
removed '/home/jeannie/.cache/thumbnails/large/62b275dd4b7f637bf62630fcd58e58e6.png'
removed '/home/jeannie/.cache/thumbnails/large/66ed11bc761eef693fbefecb01e7234e.png'
removed '/home/jeannie/.cache/thumbnails/large/6aea5f5d68e1eecfd5b306ad55d75405.png'
removed '/home/jeannie/.cache/thumbnails/large/6ebd427324bebafd0df9a53a245e094c.png'
removed '/home/jeannie/.cache/thumbnails/large/6f20637a65cbe89032c45a2610783ea2.png'
removed '/home/jeannie/.cache/thumbnails/large/7cb4404a56349308e86bf32ca51b5923.png'
removed '/home/jeannie/.cache/thumbnails/large/7dc6c33a7d75e747e6dda168063e76c5.png'
removed '/home/jeannie/.cache/thumbnails/large/83f4cb463ffd8aec018e8ce468eee830.png'
removed '/home/jeannie/.cache/thumbnails/large/877194a433a4d11a665ff001f538de9e.png'
removed '/home/jeannie/.cache/thumbnails/large/8d6ae58f5be4f0604f97b55750f3a997.png'
removed '/home/jeannie/.cache/thumbnails/large/8f09227149728d5ba17d3638d60d927b.png'
removed '/home/jeannie/.cache/thumbnails/large/8f0ac68c07ff7a8e0276d432f13ce946.png'
removed '/home/jeannie/.cache/thumbnails/large/91a1444182867b934d260d22f17f6a44.png'
removed '/home/jeannie/.cache/thumbnails/large/95c1fa1084d40057d7420e265c4942a3.png'
removed '/home/jeannie/.cache/thumbnails/large/97d6bcf4c1de6062ac21f2101d500fea.png'
removed '/home/jeannie/.cache/thumbnails/large/985be5fc5e2da106b468efe74e907d14.png'
removed '/home/jeannie/.cache/thumbnails/large/9de78cf5b570cf883634896afa85bb47.png'
removed '/home/jeannie/.cache/thumbnails/large/9ebb4155782b96d4a066ce463afb72ed.png'
removed '/home/jeannie/.cache/thumbnails/large/9ec91595ce1224e7d0e4d0a14e56eabc.png'
removed '/home/jeannie/.cache/thumbnails/large/a1b3432b6a2634a5a17c1f7b5c5b9ba9.png'
removed '/home/jeannie/.cache/thumbnails/large/a4eb987df4aaf1cb1cd70f3006d5780c.png'
removed '/home/jeannie/.cache/thumbnails/large/a77339ead6c521255c6fff2358a7414d.png'
removed '/home/jeannie/.cache/thumbnails/large/a78a1842121719e2861e3524fa73035a.png'
removed '/home/jeannie/.cache/thumbnails/large/a9bdaac1cfdaed3ec535452856cf5107.png'
removed '/home/jeannie/.cache/thumbnails/large/aa6a203aeabb6a6b12ad0851585eea15.png'
removed '/home/jeannie/.cache/thumbnails/large/aae0e5bcd607f610eb8585d6247ca229.png'
removed '/home/jeannie/.cache/thumbnails/large/b173fc6ae570b4d23b1cdb62b9695948.png'
removed '/home/jeannie/.cache/thumbnails/large/b3be0f52f0d3451983b2be890f448fc9.png'
removed '/home/jeannie/.cache/thumbnails/large/b91e2ea8789a02cdedeebf0895cc37ac.png'
removed '/home/jeannie/.cache/thumbnails/large/bcf53803be065564e28bafe6719c0936.png'
removed '/home/jeannie/.cache/thumbnails/large/bf633f24a0792e33fed5721b3950988f.png'
removed '/home/jeannie/.cache/thumbnails/large/c269a4fedd7362dfba35a6ba5f5e6d8f.png'
removed '/home/jeannie/.cache/thumbnails/large/c4d52ec6886e32f5ee81608eccfae612.png'
removed '/home/jeannie/.cache/thumbnails/large/c5358263a911975161bcfb7ccdacce06.png'
removed '/home/jeannie/.cache/thumbnails/large/c686a6db0e852effe43e3139731964c1.png'
removed '/home/jeannie/.cache/thumbnails/large/c9e02700bed3561afde9326803d43b77.png'
removed '/home/jeannie/.cache/thumbnails/large/cb913c6d572a02416e3d0c19535c5378.png'
removed '/home/jeannie/.cache/thumbnails/large/ce818e0e1dcfa7c4103e5da0014ffc1c.png'
removed '/home/jeannie/.cache/thumbnails/large/cfb8d00a27686f927f36512cde49a413.png'
removed '/home/jeannie/.cache/thumbnails/large/d8141acd394740a3d7dddbd0507250fc.png'
removed '/home/jeannie/.cache/thumbnails/large/dafbcfee56d52911206f3bf66d5ad3a6.png'
removed '/home/jeannie/.cache/thumbnails/large/deb9ae072cfb66b70b6893f8c461c9d3.png'
removed '/home/jeannie/.cache/thumbnails/large/e1f0179af513877ba4cd8f376e0d74bd.png'
removed '/home/jeannie/.cache/thumbnails/large/e30b0d7f4a4d08b138cfa373eaef0c57.png'
removed '/home/jeannie/.cache/thumbnails/large/e79c568e22137fb498521d05ca5c4a06.png'
removed '/home/jeannie/.cache/thumbnails/large/e8aa34ba0b9fdafa913fb70c12865893.png'
removed '/home/jeannie/.cache/thumbnails/large/ea0db64feb1779cc6ba9fc4d74fbbf80.png'
removed '/home/jeannie/.cache/thumbnails/large/edf196088406b955dc5022f5b26f4689.png'
removed '/home/jeannie/.cache/thumbnails/large/f4ce3bf419294cb180e1067af6646991.png'
removed '/home/jeannie/.cache/thumbnails/large/fbde4d98b88ebcb0c312cdbda4e831b0.png'
removed '/home/jeannie/.cache/thumbnails/normal/0203b1f93662941b823217556353d74c.png'
removed '/home/jeannie/.cache/thumbnails/normal/0c381d48f55ad64b1830c30e05e402d1.png'
removed '/home/jeannie/.cache/thumbnails/normal/0e452d72c614534f0d2d4e694be05191.png'
removed '/home/jeannie/.cache/thumbnails/normal/142ab859e901823379b8d1b2f3e4d451.png'
removed '/home/jeannie/.cache/thumbnails/normal/257a14c60ee51976f9a616c704b2a500.png'
removed '/home/jeannie/.cache/thumbnails/normal/3b2cb3107d9979f697f1a3b6cfab9816.png'
removed '/home/jeannie/.cache/thumbnails/normal/5afa01590a3b29abce6c5c81f7e71bf2.png'
removed '/home/jeannie/.cache/thumbnails/normal/5c60f2186fca113a253750c878da221b.png'
removed '/home/jeannie/.cache/thumbnails/normal/6aea5f5d68e1eecfd5b306ad55d75405.png'
removed '/home/jeannie/.cache/thumbnails/normal/95c1fa1084d40057d7420e265c4942a3.png'
removed '/home/jeannie/.cache/thumbnails/normal/9de78cf5b570cf883634896afa85bb47.png'
removed '/home/jeannie/.cache/thumbnails/normal/c686a6db0e852effe43e3139731964c1.png'
removed '/home/jeannie/.cache/thumbnails/normal/deb9ae072cfb66b70b6893f8c461c9d3.png'
removed '/home/jeannie/.cache/thumbnails/normal/ea0db64feb1779cc6ba9fc4d74fbbf80.png'
dpkg: error: --purge needs at least one package name argument
Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;
Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
Vacuuming done, freed 0B of archived journals from /var/log/journal.
Deleted archived journal /var/log/journal/9863d8c99ecd4a098145e3f0d000cc51/system@a397cfbc38834a2e9549543a6b8a7929-0000000000000f19-0005d22fdbed1f13.journal (8.0M).
Deleted archived journal /var/log/journal/9863d8c99ecd4a098145e3f0d000cc51/user-1000@554ec78d633546888a8e8f38ab741a8c-0000000000000f23-0005d22fdf811c24.journal (8.0M).
Vacuuming done, freed 16.0M of archived journals from /var/log/journal/9863d8c99ecd4a098145e3f0d000cc51.
jeannie@Laptop1:~$
Thanks for the help, guys! I'm going to mark this solved and take a nap.