1

I have a TX2 that I'm using a custom carrier board with. The BSP for this board is flashed onto the TX2, rather than one directly from NVIDIA. There have been issues when user have attempted to do a package list update ie apt-get upgrade. and I would like to disable the ability for users to run the upgrade command. My first thought was to create an alias with the same name, but I can't create a multi-word alias.

So is there a way to disable the ability for users utilize .

The setup is a single log in for all users. They need root access for everything else, so I can't limit the user privileges, but I do not want them being able to upgrade the package lists.

4
  • 1
    Re two-word aliases, you would make an apt-get wrapper script and have it fail for 'upgrade' and pass through otherwise.
    – pbhj
    Commented Nov 11, 2020 at 17:44
  • I thought of that, but usually apt-get requires the use of sudo. So if you try sudo apt-get the alias doesn't work.
    – Michael
    Commented Nov 11, 2020 at 17:50
  • 1
    linuxhandbook.com/run-alias-as-sudo to get sudo to work on aliases.
    – pbhj
    Commented Nov 13, 2020 at 9:16
  • 1
    You should really write this up as an answer. so I can give you credit for it. This is exactly the trick I was looking for. Thank you.
    – Michael
    Commented Nov 13, 2020 at 13:00

1 Answer 1

1

You can't really disable 'upgrade' while still allowing users to use 'install'. Either they'll become unable to install newer packages due to non-upgraded libraries, or apt itself will upgrade the packages during installation. (Indeed even apt-get install your_package will upgrade it if a newer version is not available.)

There are a few ways you can avoid the upgrade of specific packages:

  • Use apt-mark hold your_package.

  • Use /etc/apt/preferences ("apt-pinning") to give priority to one repository over another, regardless of package version.

  • Manage your own package repository which only has your hand-picked packages.

  • Make sure the package isn't in the repositories at all – that way there won't be anything to upgrade it to. If you've customized an existing package, give it a different name than the original.

  • Make sure your package always has a higher version, be it 9999.99.9-9 or something.

  • Install the files without using a package.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .