Apt find/uninstall packages from removed repository - apt

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?

Related

How do I install mdbtools on an EC2 instance?

To install mdbtools on an EC2 instance I entered the following:
curl http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/m/mdbtools-0.7.1-3.el7.x86_64.rpm > mdbtools-0.7.1-3.el7.x86_64.rpm
rpm -Uvh mdbtools-0.7.1-3.el7.x86_64.rpm
yum -q install mdbtools -y
but I get the following
error: Failed dependencies:
libmdb.so.2()(64bit) is needed by mdbtools-0.7.1-3.el7.x86_64
libmdbsql.so.2()(64bit) is needed by mdbtools-0.7.1-3.el7.x86_64
mdbtools-libs = 0.7.1-3.el7 is needed by mdbtools-0.7.1-3.el7.x86_64
I have no idea how to fix these on EC2.
Any suggestions?
You're fetching a single package directly, then attempting to install it.
The package has a bunch of dependencies that can't be satisfied when it is taken outside a repository context.
What you should do, is install the EPEL repository configuration as detailed here.
Then let yum install the package while picking up whichever dependencies required:
yum install mdbtools
If for whatever reason, you want to install things without EPEL repository being configured, you will have one fun time fetching all the dependencies, which depends on a particular package :)
In this particular case you need at least mdbtools-libs, which direct URL is https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/m/mdbtools-libs-0.7.1-3.el7.x86_64.rpm

Upgrade packages only from a specific repository

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.

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

SmartGit Installation and Usage on Ubuntu

I have downloaded latest SmartGit installation and each time I want to use it I need to run script smartgit.sh from SmartGit bin directory, this process requires the same repository setup every time.
What it correct way of installing SmartGit on Ubuntu? Thus I can have normal icon and run the program from state of previous usage, without configuring repositories every time.
Thanks.
You can add a PPA that provides a relatively current version of SmartGit(as well as SmartGitHg, the predecessor of SmartGit).
To add the PPA run:
sudo add-apt-repository ppa:eugenesan/ppa
sudo apt-get update
To install smartgit (after adding the PPA) run:
sudo apt-get install smartgit
To install smartgithg (after adding the PPA) run:
sudo apt-get install smartgithg
This should add a menu option for you
For more information, see Eugene San PPA.
This repository contains collection of customized, updated, ported and backported packages for two last LTS releases and latest pre-LTS release
What it correct way of installing SmartGit on Ubuntu? Thus I can have
normal icon
In smartgit/bin folder, there's a shell script waiting for you: add-menuitem.sh. It does just that.
Now on the Smartgit webpage (I don't know since when) there is the possibility to download directly the .deb package. Once installed, it will upgrade automagically itself when a new version is released.
Seems a bit too late, but there is a PPA repository with SmartGit, enjoy! =)

Resources