Upgrade packages only from a specific repository - ansible

I would like to perform an apt-get upgrade only for the packages existing in a specific repo.
I've been cheking in the apt and apt_repository modules and I don't find a way to force that, I can see that we can handle packages, but not complete repos.
Is that possible?
If not, Is there some workaround which could avoid using the shell module?
I thought something like using the apt_repo module for deleting all the repositories, then adding my personal repo and executing the upgrade. But I can't figure out how to come back to the original repos after the upgrade is finished.

Related

Apt find/uninstall packages from removed repository

If I add a repo, install some packages from it, them remove the repo from my source list. How can I automatically delete all packages from this repo?
Scenario
apt add repository strange_repo
apt install obscure_useless_package_I_will_forget_about
Then years later : what's strange_repo? It's useless now. Hop delete that! Wait did I install anything from it?

How to cache packages which have been installed via `apt-get` in Travis CI?

So, with my .travis.yml, I'm installing some packages via apt-get which doesn't take too long to download, but a very long time to install.
Is there a way to make Travis CI remember the installed packages, so I won't have to install them from scratch for every build?
There seems to be no easy or convenient way to cache all of the packages you need to install via apt-get. According to the Caching Dependencies and Directories documentation, Travis CI currently only provides "convenience" caching for Bundler, CocoaPods, Yarn (and a few others).
However! If you can determine where apt-get installs each of the packages you need (as install locations vary from one package to the next), you can cache each of those install directories individually by following the steps in the Arbitrary directories documentation.
I hope this helps. Please let me know if you have any other questions and I'd be happy to help in any way I can. Cheers!
If the packages you need are in Travis' whitelist, you can install them more simply by adding to your .travis.yml:
addons:
apt:
packages:
- cmake
- package-xy
And cache them with:
cache:
apt: true

Lots of packages are missing in EPEL for RHEL7

I am trying to install any GUI desktop on the RHEL7, what originally does not have any.
There was even no ntfs-3g installed to work with NTFS file system.
really "nice" build is this RHEL7!!!!
and i m using the EPEL - repos for that in :
http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
while another the link to
http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
is not working.
So i installed the epel-release-latest-7.noarch.rpm with rpm.
But i do not have the group 'Server with GUI'in yum there, (what is recommended to install).
trying install gnome-desktop, x windows system, xfce, whatever i get the message about lots of unsatisfied dependencies like:
lots with libgtk*
libX11*
gk* whatever
so i guess the dependencies for GNOME are missing.
Yeah, so many libs are not included in the RHEL7 from the beginning, bravo to this version.
I guess there is no info about the dependencies in the epel package or
even in gnome-desktop-2.32.0-17.el7.x86_64.rpm.
Can someone please tell where from download all (means realy all) dependencies for GNOME Desktop or any other desktop?
before this issue i guessed, every package must have list of all dependencies to it , otherwise it is just... stupid
You don't need the EPEL repository for GUI on RHEL. All required packages, including all necessary dependencies, are a part of the default RHEL repositories.
Make sure that your installation is properly registered and subscribed (see How to register and subscribe a system to the Red Hat Customer Portal using Red Hat Subscription-Manager).
Then you should be able to install a GUI environment of your choice without any outside dependencies, i.e. it should be possible to execute, for example:
# yum groupinstall "Server with GUI"
See more detailed info at How to install a graphical user interface (GUI) for Red Hat Enterprise Linux.

Is there a durable store for deb files (like a maven repo?)

I have a maven built docker image that was dependent on libssl1.0.2_1.0.2d-3_amd64.deb, but this has now a 404 and has been replaced by libssl1.0.2_1.0.2e-1_amd64.deb.
This is a problem because maven builds are meant to be durable - ie you can rebuild them at any point in the future. The main maven repo is durable, so artefacts taken from that will be there in the future. I could move the debs I need into the maven repo, but that is a bit of abuse of other peoples storage...
So is there a durable store of debian files that is guaranteed to exist... well at least until the revolution/meteor strike/Jurassic resurrection etc.
You can do this yourself with free, open-source tools. You can create your own APT repository for storing Debian packages. If you are interested in using GPG signature to sign repository metadata read this.
Once you've created the repository, you can create a configuration file in /etc/apt/sources.list.d/ pointing to your repository. You can run apt-get update to refresh your systems apt cache, and then run apt-get install to install the package of your choice.
BTW, you can install a particular version of a package by running: apt-get install packagename=version.
For example, to install version 1.0 of "test", run: apt-get install test=1.0.
Alternatively, if you don't want to deal with any of this yourself you can just use packagecloud.io for hosting Debian, RPM, RubyGem, and Python PyPI repositories. A lot of people who use our service have your exact use case, where Debian packages they depend on disappear from public repositories so they upload them to us.

Best Way to Install and Maintain the Dependency?

I am a bit new to this kind of administration stuffs -- I would like to build GCC 4.8.2 (just an example) myself, and I would like some how makes yum realize that there is a package newer than what the external repos have (GCC 4.4 is the latest in the standard/defualt repos).
It seems like I have to:
1. Create an rpm package myself
2. Create a local yum repo myself
3. Add the rpm package to my local yum repo and somehow specify that it is a newer version of GCC than the one external repos offer
Am I right?
Is there a good tutorial? I searched online and there are many tutorials for creating RPMs, and tutorials for creating private yum repo. But I couldn't find an example/tutorial to show me the complete flow...
Any input is welcome.
You don't need to create a yum repo. Yum uses the RPM database to see which packages are installed, so if you create a gcc-4.8.2 RPM and install it then Yum will know that gcc-4.8.2 is installed.
Yum understands package version numbers so it will know that gcc-4.8.x newer than gcc-4.4.x

Resources