Antix Advert Block for Mint?<SOLVED>

Questions about applications and software
Forum rules
Before you post please read how to get help
Glockdoc
Level 3
Level 3
Posts: 106
Joined: Tue May 09, 2017 5:42 am

Re: Antix Advert Block for Mint??

Post by Glockdoc »

gm10 wrote:
Fri Nov 08, 2019 10:51 am
Glockdoc wrote:
Fri Nov 08, 2019 10:38 am
No link. It is included in my MX install. Found it by accident. Been using MX for 5 months on my main machine and I keep finding new stuff.
Just keep using it then. In a terminal window:

Code: Select all

mkdir ~/.local/bin
wget https://raw.githubusercontent.com/antiX-Linux/advert-block-antix/master/block-advert.sh -O ~/.local/bin/block-advert
chmod +x ~/.local/bin/block-advert
apt install yad
source ~/.profile
You can then run the script like this:

Code: Select all

sudo block-advert
When I run this gm I get "command not found". Did I miss a step?

Code: Select all

big@big-Latitude-E5430-non-vPro:~$ mkdir ~/.local/bin
big@big-Latitude-E5430-non-vPro:~$ wget https://raw.githubusercontent.com/antiX-Linux/advert-block-antix/master/block-advert.sh -O ~/.local/bin/block-advert
--2019-11-19 14:19:30--  https://raw.githubusercontent.com/antiX-Linux/advert-block-antix/master/block-advert.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.8.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.8.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6858 (6.7K) [text/plain]
Saving to: ‘/home/big/.local/bin/block-advert’

/home/big/.local/bi 100%[===================>]   6.70K  --.-KB/s    in 0.003s  

2019-11-19 14:19:31 (2.38 MB/s) - ‘/home/big/.local/bin/block-advert’ saved [6858/6858]

big@big-Latitude-E5430-non-vPro:~$ chmod +x ~/.local/bin/block-advert
big@big-Latitude-E5430-non-vPro:~$ apt install yad
[sudo] password for big:     
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gir1.2-mate-desktop gir1.2-mate-panel libllvm7 linux-headers-4.15.0-47
  linux-headers-4.15.0-47-generic linux-headers-4.15.0-48
  linux-headers-4.15.0-48-generic linux-headers-4.15.0-50
  linux-headers-4.15.0-50-generic linux-headers-4.15.0-51
  linux-headers-4.15.0-51-generic linux-headers-4.15.0-52
  linux-headers-4.15.0-52-generic linux-headers-4.15.0-58
  linux-headers-4.15.0-58-generic linux-headers-4.15.0-62
  linux-headers-4.15.0-62-generic linux-headers-4.15.0-64
  linux-headers-4.15.0-64-generic linux-image-4.15.0-47-generic
  linux-image-4.15.0-48-generic linux-image-4.15.0-50-generic
  linux-image-4.15.0-51-generic linux-image-4.15.0-52-generic
  linux-image-4.15.0-58-generic linux-image-4.15.0-62-generic
  linux-image-4.15.0-64-generic linux-modules-4.15.0-47-generic
  linux-modules-4.15.0-48-generic linux-modules-4.15.0-50-generic
  linux-modules-4.15.0-51-generic linux-modules-4.15.0-52-generic
  linux-modules-4.15.0-58-generic linux-modules-4.15.0-62-generic
  linux-modules-4.15.0-64-generic linux-modules-extra-4.15.0-47-generic
  linux-modules-extra-4.15.0-48-generic linux-modules-extra-4.15.0-50-generic
  linux-modules-extra-4.15.0-51-generic linux-modules-extra-4.15.0-52-generic
  linux-modules-extra-4.15.0-58-generic linux-modules-extra-4.15.0-62-generic
  linux-modules-extra-4.15.0-64-generic mint-backgrounds-tessa python-psutil
  python-xapp
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  yad
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 160 kB of archives.
After this operation, 563 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic/universe amd64 yad amd64 0.38.2-1 [160 kB]
Fetched 160 kB in 3s (58.1 kB/s)
Selecting previously unselected package yad.
(Reading database ... 576866 files and directories currently installed.)
Preparing to unpack .../yad_0.38.2-1_amd64.deb ...
Unpacking yad (0.38.2-1) ...
Setting up yad (0.38.2-1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23+linuxmint6) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
big@big-Latitude-E5430-non-vPro:~$ source ~/.profile
big@big-Latitude-E5430-non-vPro:~$ sudo block-advert
sudo: block-advert: command not found
big@big-Latitude-E5430-non-vPro:~$ sudo block-advert
sudo: block-advert: command not found
big@big-Latitude-E5430-non-vPro:~$ 
gm10
Level 20
Level 20
Posts: 10999
Joined: Thu Jun 21, 2018 5:11 pm

Re: Antix Advert Block for Mint??

Post by gm10 »

Sorry, actually I made a mistake. Run this once and you'll be fine:

Code: Select all

sudo mv ~/.local/bin/block-advert /usr/local/bin
Don't forget that as an alternative there's also still the packaged version I made for you with menu entry and all.
Glockdoc
Level 3
Level 3
Posts: 106
Joined: Tue May 09, 2017 5:42 am

Re: Antix Advert Block for Mint?

Post by Glockdoc »

Thank you!

And, I totally missed you made a package. Thank you again. I was wrapped up in the code and trying to connect the dots I missed it. Linux has progressed so far with the desktops and prepackaged stuff I feel some of the new users will miss out on CL stuff. I try to play around with the CL and learn when I can. I will run that command next time I am in front of the Mint machine.
gm10
Level 20
Level 20
Posts: 10999
Joined: Thu Jun 21, 2018 5:11 pm

Re: Antix Advert Block for Mint?

Post by gm10 »

Glockdoc wrote:
Wed Nov 20, 2019 8:30 am
I was wrapped up in the code and trying to connect the dots I missed it. Linux has progressed so far with the desktops and prepackaged stuff I feel some of the new users will miss out on CL stuff. I try to play around with the CL and learn when I can. I will run that command next time I am in front of the Mint machine.
Very well. Since you want to learn let me explain my mistake: I did originally have you download the script into your home folder. I only then realized it required to be run with root privileges because it did not request them itself, so I added the sudo.

So why did it say that it could not find the command? Because if you just give the name of the command without a path, then the shell searches all locations in the PATH environment variable for the command in order to execute it. However, the ~/.local/bin path I had you download the script to is only in your user's PATH environment, whereas the sudo commands spawns a root context with its own PATH environment variable not containing your user's folders.

The solution I went with moved the script out of your home folder and into a system folder that's included in the system-wide PATH environment variable and will thus be used within a sudo context.

The alternative solution would have been to tell you to supply the full path to the command, but that is much less convenient.
Last edited by gm10 on Wed Nov 20, 2019 8:57 am, edited 1 time in total.
User avatar
trytip
Level 13
Level 13
Posts: 4919
Joined: Tue Jul 05, 2016 1:20 pm

Re: Antix Advert Block for Mint?

Post by trytip »

you need to pay closer attention to this:
The following packages were automatically installed and are no longer required:
gir1.2-mate-desktop gir1.2-mate-panel libllvm7 linux-headers-4.15.0-47
linux-headers-4.15.0-47-generic linux-headers-4.15.0-48
linux-headers-4.15.0-48-generic linux-headers-4.15.0-50
linux-headers-4.15.0-50-generic linux-headers-4.15.0-51
linux-headers-4.15.0-51-generic linux-headers-4.15.0-52
linux-headers-4.15.0-52-generic linux-headers-4.15.0-58
linux-headers-4.15.0-58-generic linux-headers-4.15.0-62
linux-headers-4.15.0-62-generic linux-headers-4.15.0-64
linux-headers-4.15.0-64-generic linux-image-4.15.0-47-generic
linux-image-4.15.0-48-generic linux-image-4.15.0-50-generic
linux-image-4.15.0-51-generic linux-image-4.15.0-52-generic
linux-image-4.15.0-58-generic linux-image-4.15.0-62-generic
linux-image-4.15.0-64-generic linux-modules-4.15.0-47-generic
linux-modules-4.15.0-48-generic linux-modules-4.15.0-50-generic
linux-modules-4.15.0-51-generic linux-modules-4.15.0-52-generic
linux-modules-4.15.0-58-generic linux-modules-4.15.0-62-generic
linux-modules-4.15.0-64-generic linux-modules-extra-4.15.0-47-generic
linux-modules-extra-4.15.0-48-generic linux-modules-extra-4.15.0-50-generic
linux-modules-extra-4.15.0-51-generic linux-modules-extra-4.15.0-52-generic
linux-modules-extra-4.15.0-58-generic linux-modules-extra-4.15.0-62-generic
linux-modules-extra-4.15.0-64-generic mint-backgrounds-tessa python-psutil
python-xapp
Use 'sudo apt autoremove' to remove them.
sometimes it's good to take out the garbage, even though most linux users say linux doesn't need cleaning. keep 3 kernels at the most but not all the same branch. maybe one default 4.15 updated, one new 5.0 updated and if you like to be edgy one of the new mainline 5.3 updated
Last edited by trytip on Wed Nov 20, 2019 9:07 am, edited 1 time in total.
Image
gm10
Level 20
Level 20
Posts: 10999
Joined: Thu Jun 21, 2018 5:11 pm

Re: Antix Advert Block for Mint?

Post by gm10 »

trytip wrote:
Wed Nov 20, 2019 8:57 am
you need to pay closer attention to this:
Or alternatively enable the automatic maintenance service in Update Manager, then you do not need to pay attention to that at all. ;)
User avatar
trytip
Level 13
Level 13
Posts: 4919
Joined: Tue Jul 05, 2016 1:20 pm

Re: Antix Advert Block for Mint?

Post by trytip »

gm10 wrote:
Wed Nov 20, 2019 8:59 am
trytip wrote:
Wed Nov 20, 2019 8:57 am
you need to pay closer attention to this:
Or alternatively enable the automatic maintenance service in Update Manager, then you do not need to pay attention to that at all. ;)
one would if one used the update manager :D but the one is a synaptic fella. i do have your updater thingy in my minty. glad to see you made it easier for everyone with your update manager helper, but they still need to know that it's there or that they need to turn it on. for me though, i do not use automation.
many times though @gm10, after using the updater script to remove kernels and open synaptic, i have residual configurations that need to be removed.
Image
gm10
Level 20
Level 20
Posts: 10999
Joined: Thu Jun 21, 2018 5:11 pm

Re: Antix Advert Block for Mint?

Post by gm10 »

trytip wrote:
Wed Nov 20, 2019 9:06 am
one would if one used the update manager :D but the one is a synaptic fella. i do have your updater thingy in my minty. glad to see you made it easier for everyone with your update manager helper, but they still need to know that it's there or that they need to turn it on. for me though, i do not use automation.
Well, the service runs independently from Update Manager and should get enabled automatically. Or at least it will be when using my mintupdate fork.
trytip wrote:
Wed Nov 20, 2019 9:06 am
many times though @gm10, after using the updater script to remove kernels and open synaptic, i have residual configurations that need to be removed.
The maintenance script? It is running a purge, so that's surprising, but best make a separate thread about it, we're already off-topic enough here.
Post Reply

Return to “Software & Applications”