How Blacklist list of packages Installation?

Kernels & Hardware, configuring network, installing services

How Blacklist list of packages Installation?

Postby bester69 » 2020-06-21 14:45

How would you blacklist a list of packages for installation?

I purpose this Solution.:

0- BlacklistedPackages.txt (make list to blacklist from synaptic selections, save as)
cat BlacklistedPackages.txt
kaffeine install
kmplayer install
smtube install
minitube install

1- Get string chain param with all blacklisted packages;
blacklisted=$(cat BlacklistedPackages.txt| awk '{ print $1 }' |xargs) && echo $blacklisted
kaffeine libdvbv5-0 kmplayer smtube minitube

2- Add blacklisted packages composition to preferences pin sourcelist (-1), using sed..
Package: XXXX
Pin: release *
Pin-Priority: -1

sed -i 's/XXXX/$blacklisted/g' /etc/apt/preferences
Package: kaffeine libdvbv5-0 kmplayer smtube minitube

Pin: release *
Pin-Priority: -1

So, Now we can't install any of thoses packages.. :wink:


do you know any a better way to achieve this subject?
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1802
Joined: 2015-04-02 13:15

Re: How Blacklist list of packages Installation?

Postby stevepusser » 2020-06-22 05:18

I'm curious--why do you have to fight off those packages being installed by some undescribed entity?
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 12132
Joined: 2009-10-06 05:53

Re: How Blacklist list of packages Installation?

Postby bester69 » 2020-06-22 12:33

stevepusser wrote:I'm curious--why do you have to fight off those packages being installed by some undescribed entity?

Hi Steve,

There is something I dont get, we cant easily lock installation/remove packages/applications.. if you have a linux system with muiltiple users, the normal would be to be possible to select which applications list users can install/uninstall, when give them suders permission installation.. Imagine you want to be able to install/uninstall anything (application) but system packages such as kernel or things like that... why cant we do this in debian??..I really dont undestant it..
I know that's an admin task, but why can we delegate that task to users for a defined list, so they can install whatever they need within that whitelisted list?.. that's the reason I was trying to figure it out how to lock installation/unistallation.. and I still wasnt able to find a way to hold unistalling specific packages/applcications, when they are sudoers for uninstalling.. so its a trouble,,,

Imagine, you have a shared computer with linux system, and you would like your children were able to install/uninstall (sudoers synaptic) a list of whitelisted applications, we cant achieve this!! :shock: ...I think for this purpose is neccesary something like Apparmor...

I just would like to be able to hold installation/uninstallation packages with root.. with synaptic, so others managers werent able to install/uninstall those holded packages... that would be my idea :?

pin those package to -1 seems a good solution to prevent installation, but I cant prevent unistallation of those packages, unless they dont have unistalled permissons.... I wonder if there is any kind of workaround by using chattr to lock uninstalling packages, but i didnt finf a single file to chattr that breaks uninstalling process of that packages.
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1802
Joined: 2015-04-02 13:15

Re: How Blacklist list of packages Installation?

Postby Head_on_a_Stick » 2020-06-22 17:29

bester69 wrote: Imagine, you have a shared computer with linux system, and you would like your children were able to install/uninstall (sudoers synaptic) a list of whitelisted applications, we cant achieve this!

Of course you can — just set up a local package repository and only add that to the sources list.

bester69 wrote:i didnt finf a single file to chattr that breaks uninstalling process of that packages.

That's unusual, you're very good at finding nails for that particular hammer...
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12777
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: How Blacklist list of packages Installation?

Postby bester69 » 2020-06-23 05:47

Head_on_a_Stick wrote:
bester69 wrote: Imagine, you have a shared computer with linux system, and you would like your children were able to install/uninstall (sudoers synaptic) a list of whitelisted applications, we cant achieve this!

Of course you can — just set up a local package repository and only add that to the sources list.

That would be great If those packages make use of debian's repository...so, there should be a way to filter debian's repository (exluding packages).. and create several sources lists for different users .. sometimes, you feel you miss many obvious things.. So, Synaptic or systema packages managers, should contemplate user's profiles, that way users would be able to install/uninstall in a safety way.. perhaps we have a tool I dont know for this purpose
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1802
Joined: 2015-04-02 13:15

Re: How Blacklist list of packages Installation?

Postby stevepusser » 2020-06-23 15:42

local-apt-repository makes it dead easy to set one up.

I shudder to think of giving children any power over a shared system. Apparently Windows has taught us nothing.
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 12132
Joined: 2009-10-06 05:53

Re: How Blacklist list of packages Installation?

Postby bester69 » 2020-06-24 06:59

stevepusser wrote:local-apt-repository makes it dead easy to set one up.

I shudder to think of giving children any power over a shared system. Apparently Windows has taught us nothing.


Thanks Steve, I will take a look at it... :o
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1802
Joined: 2015-04-02 13:15

Re: How Blacklist list of packages Installation?

Postby bester69 » 2020-06-24 18:36

stevepusser wrote:local-apt-repository makes it dead easy to set one up.

I shudder to think of giving children any power over a shared system. Apparently Windows has taught us nothing.

Using this guide
https://askubuntu.com/questions/170348/ ... repository

How do I go about telling synaptic make use of a user source.list..

I would need something like XDG_CONFIG_HOME, but for etc folder; do we have XGD_ETC?? :?:
XGD_ETC=/home/user/etc synaptic
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1802
Joined: 2015-04-02 13:15

Re: How Blacklist list of packages Installation?

Postby stevepusser » 2020-06-25 02:14

The description for local-apt-repository:

Description: Ready to use local apt repository
With this package installed, every Debian package (i.e. a *.deb file) dropped
into /srv/local-apt-repository (which you need to create first) will be
available to apt.


If you're running systemd, that is. Without it, you'll have to run an update command that's in its /usr/lib/folder.

Install local-apt-repository.
Create /srv/local-apt-repository
Put debs in it.
Update apt.
Profit!
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 12132
Joined: 2009-10-06 05:53

Re: How Blacklist list of packages Installation?

Postby bester69 » 2020-06-25 12:48

stevepusser wrote:The description for local-apt-repository:

Description: Ready to use local apt repository
With this package installed, every Debian package (i.e. a *.deb file) dropped
into /srv/local-apt-repository (which you need to create first) will be
available to apt.


If you're running systemd, that is. Without it, you'll have to run an update command that's in its /usr/lib/folder.

Install local-apt-repository.
Create /srv/local-apt-repository
Put debs in it.
Update apt.
Profit!


Thanks a lot, Steve :o
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1802
Joined: 2015-04-02 13:15


Return to System configuration

Who is online

Users browsing this forum: morgon and 10 guests

fashionable