APT: Pinning package origin & apt proxy on packages resources list - proxy

I try to configure priority pinning with APT on Debian 8, to force a package installation from a specific repository.
My servers are configured to use an apt proxy, specified on each lines of /etc/apt/sources.list:
deb http://<my-apt-cacher-ng-proxy>:9999/ftp.fr.debian.org/debian/ jessie main
deb http://<my-apt-cacher-ng-proxy>:9999/ftp.igh.cnrs.fr/pub/mariadb/repo/10.0/debian sid main
I would like to use 'MariaDB' repository for a specific package 'libmysqlclient18'.
The recommended way is to add an apt preference, indicating that origin "ftp.igh.cnrs.fr" weight more than default repos, for example like this:
/etc/apt/preferences.d/libmysqlclient18.conf
Package: libmysqlclient18
Pin: origin ftp.igh.cnrs.fr
Pin-Priority: 1001
But as I use a proxy, every origins in my conf refers to <my-apt-cacher-ng-proxy>...
Is there a way to force the repos .?
I tried some alternatives with no success:
Pin: release o=MariaDB
Pin: release l=MariaDB
...
I even tried to indicate that Debian base package should not be installed, with no success either:
Package: libmysqlclient18
Pin: release n=Jessie
# OR: Pin: release o=Debian
Pin-Priority: -10
Same result every time: the two repos. keep the same 500 priority
$ aptitude versions libmysqlclient18
Paquet libmysqlclient18 :
p 5.5.42-1 testing 500
p 10.0.17+maria-1~sid <NULL> 500
Thanks a lot

I found a workaround, by asking apt to consider everything comming from MariaDB as more important... this is ok as this repository only contains 4 or 5 packages, but is not the ideal solution!
Package: *
Pin: release o=MariaDB
Pin-Priority: 999
If I only indicate one package instead of '*', it stops working. Even 'Package: libmysql*' does not work.

Related

Git dependency errors when using Composer with private VCS repository on IBM i

More details below, but I'm running into the following error when I issue a composer install or composer update command on a project which uses a custom VCS repository for an included project. This is on an IBM i v7r3 system via SSH session. I've run out of ideas on how to troubleshoot further, so here I am. Has anyone ever seen this error or have any ideas on how to troubleshoot further?
Error:
bash-4.4$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 113 installs, 0 updates, 0 removals
- Installing sshUser/myPackage (v1.0.26): Cloning a2db0666b1
[RuntimeException]
Failed to clone gitUser:/opt/git/myPackage.git, git was not found, check that
it is installed and in your PATH env.
Could not load program git:
Dependent module /usr/local/zendphp7/lib/libz.so.1(shr_64.o) could not be loaded.
File /usr/local/zendphp7/lib/libz.so.1 is not an
archive or the file could not be read properly.
System error: Exec format error
I have a remote IBM i server which has two users. The first user "gitUser" is used for my private Git repositories (headless). I then have another user "sshUser" which is used to SSH in with and do my typical work. I have SSH keys configured to simplify connections for both users and the "gitUser" ssh key doesn't require a password, so I can use it for automated scripting.
I have a private VCS repository included in my composer.json file for a project. So long as I have the entry in the "repository" section I'm getting the above error. This occurs even if I'm not requireing a package from the repository.
Repository Entry:
"repositories": [
{
"type": "vcs",
"url": "gitUser:/opt/git/myPackage.git"
}
]
Composer on the IBM i is up to date at 1.7.2.
It's clear the issue lies with git and the inability to find a dependency in libz.so.1.
However, if I follow the chain of dependencies for the version of Git in my path, all the appropriate files exist with adequate permissions:
bash-4.4$ which git
/QOpenSys/pkgs/bin/git
bash-4.4$ dump -X64 -H /QOpenSys/pkgs/bin/git
/QOpenSys/pkgs/bin/git:
***Loader Section***
Loader Header Information
VERSION# #SYMtableENT #RELOCent LENidSTR
0x00000001 0x000000df 0x0000433f 0x0000009d
#IMPfilID OFFidSTR LENstrTBL OFFstrTBL
0x00000006 0x00044910 0x00000a18 0x000449ad
***Import File Strings***
INDEX PATH BASE MEMBER
0 /QOpenSys/pkgs/lib:/QOpenSys/usr/lib
1 libz.so.1 shr_64.o
2 libiconv.so.2 shr_64.o
3 libcrypto.so.1.0.0 shr_64.o
4 libpthread.a shr_xpg5_64.o
5 libc.a shr_64.o
bash-4.4$
I can confirm there are no permission failures through out all of this. So this doesn't seem to be the result of inadequate permissions. Also, I do not think the issue lies within the user profile gitUser as if I issue a composer install or composer update from another machine (with appropriate keys), everything works flawlessly. So it seems to be specific to the IBM i and the sshUser profile.
I'm starting to think Composer is using a different git executable and the dependencies of that executable do not exist. Though I assume Composer would just use my path.
Note*: I tried specifying my LIBPATH in my ./.profile with the following. But it doesn't seem to make any difference:
LIBPATH=/usr/local/zendphp7/lib
LIBPATH=$LIBPATH:/QOpenSys/pkgs/lib:/QOpenSys/usr/lib
export LIBPATH
When echoing:
bash-4.4$ echo $LIBPATH
/usr/local/zendphp7/lib:/QOpenSys/pkgs/lib:/QOpenSys/usr/lib
bash-4.4$
If I don't add the above to my ./.profile, then echo $LIBPATH prints a blank line to screen.
Solution:
I just changed the symlink in the ZENDPHP7 directory structure to the repo version. Alternatively you can manipulate your library path, but I couldn't figure out the proper way to do it on IBM i.
bash-4.4$ pwd
/usr/local/zendphp7/lib
bash-4.4$ ln -s /QOpenSys/pkgs/lib/libz.so.1 ./libz.so.1
bash-4.4$ ls -la /usr/local/zendphp7/lib/libz.so.1
lrwxrwxrwx 1 dl 0 56 Oct 11 14:21 /usr/local/zendphp7/lib/libz.so.1 -> /QOpenSys/pkgs/lib/libz.so.1
bash-4.4$
I'm guessing something is off with your path when you do the install. Is it maybe looking at the Zend PHP libraries rather than the expected ones in /usr/lib?
Notice that the errors shows a path of /usr/local/zendphp7/lib/ libz.so.1(shr_64.o) while your git dump instead shows /QOpenSys/pkgs/lib:/QOpenSys/usr/lib.

Chocolatey app install failure with the error message of The remote server returned an error: (403) Forbidden

Chocolaty Cannot install packages.
I cannot install any packages from chocolatey package manager
here is the full command prompt message
C:\WINDOWS\system32>choco install winrar -dv
Chocolatey v0.10.11
Chocolatey is running on Windows v 10.0.17134.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" install winrar -dv
Received arguments: install winrar -dv
RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
Sending message 'PreRunMessage' out if there are subscribers...
[Pending] Removing all pending packages that should not be considered installed...
The source 'https://chocolatey.org/api/v2/' evaluated to a 'normal' source type
NOTE: Hiding sensitive configuration data! Please double and triple
check to be sure no sensitive data is shown, especially if copying
output to a gist for review.
Configuration: CommandName='install'|
CacheLocation='C:\Users\irrem\AppData\Local\Temp\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://chocolatey.org/api/v2/'|SourceType='normal'|
Debug='True'|Verbose='True'|Trace='False'|Force='False'|Noop='False'|
HelpRequested='False'|UnsuccessfulParsing='False'|RegularOutput='True'|
QuietOutput='False'|PromptForConfirmation='True'|AcceptLicense='False'|
AllowUnofficialBuild='False'|Input='winrar'|AllVersions='False'|
SkipPackageInstallProvider='False'|PackageNames='winrar'|
Prerelease='False'|ForceX86='False'|OverrideArguments='False'|
NotSilent='False'|ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|AllowDowngrade='False'|
ForceDependencies='False'|Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.17134.0'|
Information.PlatformName='Windows 10'|
Information.ChocolateyVersion='0.10.11.0'|
Information.ChocolateyProductVersion='0.10.11'|
Information.FullName='choco, Version=0.10.11.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|
Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='True'|
Information.UserName='irrem'|
Information.UserDomainName='DESKTOP-8FVQM8H'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|Information.LicenseType='Foss'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ScriptsCheckLastExitCode='False'|
ListCommand.LocalOnly='False'|
ListCommand.IdOnly='False'|ListCommand.IncludeRegistryPrograms='False'|
ListCommand.PageSize='25'|ListCommand.Exact='False'|
ListCommand.ByIdOnly='False'|ListCommand.ByTagOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='unknown'|
PinCommand.Command='unknown'|OutdatedCommand.IgnorePinned='False'|
Proxy.BypassOnLocal='True'|
_ Chocolatey:ChocolateyInstallCommand - Normal Run Mode _
Installing the following packages:
winrar
By installing you accept licenses for the packages.
**[NuGet] An error occurred while loading packages from 'https://chocolatey.org/api/v2/': The remote server returned an error: (403) Forbidden.**
winrar not installed. The package was not found with the source(s) listed.
Source(s): 'https://chocolatey.org/api/v2/'
NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify `--pre`,
the package may not be found.
Please see https://chocolatey.org/docs/troubleshooting for more
assistance.
Chocolatey installed 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
- winrar - winrar not installed. The package was not found with the source(s) listed.
Source(s): 'https://chocolatey.org/api/v2/'
NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify `--pre`,
the package may not be found.
Please see https://chocolatey.org/docs/troubleshooting for more
assistance.
Sending message 'PostRunMessage' out if there are subscribers...
Exiting with 1
The Chocolatey Community Repoository was having issues around that time. Are you still having issues now?
To keep up to date with all the Chocolatey notifications use:
Twitter - https://twitter.com/chocolateynuget
Gitter - https://github.com/chocolatey/choco#chat-room
Google Groups - https://groups.google.com/forum/#!forum/chocolatey (and https://groups.google.com/forum/#!forum/chocolatey-announce for announcements)
The issues were announced on those mediums.

How to require a specific commit of a Drupal project?

I know this had been asked several times, but the other solutions don't work for me so the problem may be somewhere else.
In a dependent project I require a package like this:
"require": {
"drupal/security_review": "dev-8.x-1.x#35ebae44"
}
but composer update fails with the reason:
package/name dev-master requires drupal/security_review dev-8.x-1.x#35ebae44
-> no matching package found.
For research purposes I fetched package info:
[local]$ composer show --all drupal/security_review
name : drupal/security_review
descrip. : Site security and configuration review module.
keywords :
versions : 1.x-dev, dev-1.x
type : drupal-module
source : [git] https://git.drupal.org/project/security_review 9a3bdf82a645dabb9801f73d2d76acf8c3081d88
support
source : http://cgit.drupalcode.org/security_review
requires
drupal/core ~8.0
and then tried to use the version in place of branch omitting "dev-" part from the version as it goes as prefix:
"require": {
"drupal/security_review": "dev-1.x#35ebae44"
}
And this went differently:
[local]$ composer update
...
- Installing drupal/security_review (dev-1.x 9a3bdf8): Cloning 9a3bdf82a6
As you see it fetches commit #9a3bdf8 instead of the requested - #35ebae44.
Any ideas?
Needed to figure out this too, it's 1.x-dev and not dev-1.x
For example:
composer require drupal/security_review:1.x-dev#35ebae44
1/2: http://packagist.org/p/provider-latest$00ceddb9dc4b7174d6c84c3e2ac454ccd6a6cb952ab70c1ab623371566d63754.json
2/2: http://packagist.org/p/provider-2018-04$1ce22045b6ddc998c850721c3db7f2902d0d37ae5989b30f0fb40ebfa5e91833.json
Finished: success: 2, skipped: 0, failure: 0, total: 2
./composer.json has been updated
Gathering patches for root package.
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
Gathering patches for root package.
- Installing drupal/security_review (dev-1.x 35ebae44): Gathering patches for dependencies. This might take a minute.
Cloning 35ebae44 from cache
Writing lock file
Generating autoload files
> DrupalProject\composer\ScriptHandler::createRequiredFiles

AWS EC2 User Data Not Decoding Correctly

I am experimenting with creating an EC2 instance to host a Perforce server. My instance is configured with the following user data:
#!/bin/bash
# Add a newline to the ec2-user prompt string
echo PS1=\"\\n\$PS1\" >> /home/ec2-user/.bashrc
# Update all packages
yum update –y
# Install Perforce packages
# The RHEL/7 part of the baseurl should be replaced with
# the latest RHEL version that both Amazon and Perforce support
rpm –import https://package.perforce.com/perforce.pubkey
cd /etc/yum.repos.d/
echo [perforce] > perforce.repo
echo name=Perforce >> perforce.repo
echo baseurl=http://package.perforce.com/yum/rhel/7/x86_64 >> perforce.repo
echo enabled=1 >> perforce.repo
echo gpgcheck=1 >> perforce.repo
yum install –y helix-p4d
# Make directories for the server, owned by new “perforce” user
cd /opt/perforce/servers/
mkdir danware
cd danware
mkdir danware-db danware-chkpts journal
chown –R perforce:perforce danware
I have tested each of the above commands, and know that they work when executed manually in this order. However, some aspect of Amazon's base64 encode/decode system seems to be getting in the way. When I go to "Actions > Instance Settings > View/Change User Data" from the EC2 Console after launching (and passing all system checks), I see the following user data. Note how almost every hyphen "-" has been replaced with some strange "a" character.
However, I'm not sure that this is the issue, because the log file at /var/log/cloud-init-output.log gives me the following output (I replaced some repetitive text with [...] to save space). Note the line that says Failed running /var/lib/cloud/instance/scripts/part-001 I have verified that this part-001 file actually does have the correctly displayed hyphen characters.
[...]
Cloud-init v. 0.7.6 running 'modules:final' at Fri, 09 Sep 2016 06:23:39 +0000. Up 86.66 seconds.
Loaded plugins: priorities, update-motd, upgrade-helper
No Match for argument: –y
No packages marked for update
RPM version 4.11.2
Copyright (C) 1998-2002 - Red Hat, Inc.
This program may be freely redistributed under the terms of the GNU GPL
Usage: rpm [-aKfgpqVcdLilsiv?] [-a|--all] [-f|--file] [-g|--group] [...]
Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> [...]
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
helix-p4d x86_64 2016.1-1429894 perforce 24 k
Installing for dependencies:
helix-cli x86_64 2016.1-1429894 perforce 8.8 k
helix-cli-base x86_64 2016.1-1429894 perforce 1.4 M
helix-p4d-base x86_64 2016.1-1429894 perforce 3.1 k
helix-p4d-base-16.1 x86_64 2016.1-1429894 perforce 2.4 M
helix-p4dctl x86_64 2016.1-1429894 perforce 1.2 M
Transaction Summary
================================================================================
Install 1 Package (+5 Dependent packages)
Total download size: 5.0 M
Installed size: 13 M
Is this ok [y/d/N]: Exiting on user command
Your transaction was saved, rerun it with:
yum load-transaction /tmp/yum_save_tx.2016-09-09.06-23.dRP_r2.yumtx
/var/lib/cloud/instance/scripts/part-001: line 22: cd: /opt/perforce/servers/: No such file or directory
chown: invalid user: ‘–R’
Sep 09 06:23:41 cloud-init[2517]: util.py[WARNING]: Failed running /var/lib/cloud/instance/scripts/part-001 [1]
Sep 09 06:23:41 cloud-init[2517]: cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
Sep 09 06:23:41 cloud-init[2517]: util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python2.7/dist-packages/cloudinit/config/cc_scripts_user.pyc'>) failed
Cloud-init v. 0.7.6 finished at Fri, 09 Sep 2016 06:23:41 +0000. Datasource DataSourceEc2. Up 88.53 seconds
Even more annoying, I assumed that the early No Match for argument: –y line from the log file was referring to the yum update -y line from my user data. Sure enough, just running the example user data script from the EC2 documentation page, which also uses yum update -y, gives me this same error/warning! Amazon's own example script doesn't work!? So can anyone answer why A) AWS is not displaying the user data code correctly, and B) why my user data is yielding the errors shown above? The help is much appreciated!
For lines such as
yum update –y
The character you are using is a "EN DASH U+2013"
The usual character for a hyphen is "HYPHEN-MINUS U+002D"
Fix your user data source to use "hyphen minus" and have another go
I checked the character codes by cut n pasting into this online site http://www.fileformat.info/info/unicode/char/search.htm?q=-&preview=entity
Don't know if you can see the difference but this is your hyphen
yum update –y
and this is a "hyphen minus"
yum update -y

Using hgsubversion on Windows

I'm trying to use hgsubversion plugin for mercurial from Windows. Pull from SVN repositpry works on Windows. But when I'm trying to push to the repository, I get the following message:
pushing to svn+ssh://user#server.com/home/user/.repo/test.svn/
abort: command unavailable for Subversion repositories
It seems this happens because hgsubversion is using SWIG bindings instead of subvertpy( on Linux everything works fine with subvertpy)
D:\test\>hg version --svn
hgsubversion: 88f3cda47def
Subversion: 1.6.13
bindings: SWIG
But I didn't find any easy way to install it(now I'm trying to compile it myself, but there are some problems). Maybe I missed something. Bzr is using subvertpy, maybe it is possible to extract it? Any suggestions?
Does anyone using hgsubversion from Windows?
P.S To compile the library i tried this hint: https://bitbucket.org/tortoisehg/thg-winbuild/issue/14/request-add-subvertpy-to-the-default
UPD: solved initial problem with fail on push. The largefiles(which is distributed with mercurial >= 2.0) extension breaks hgsubversion. Just disabled it and got hgsubversion working.
Well, I had slightly different results
hgsubversion: 6c4d15d8cfbd
Subversion: 1.6.13
bindings: SWIG
on my test-repo with commit-auth
Test 1, inside TortoiseHG
Cloned from root http://mayorat.ursinecorner.ru:8088/svn/Hello/
Tip is revision from trunk, edit file, commit OK
On push I got long waiting (really long) on "Searching for changes" stage (without any requests from server)
"Stop operation" show me error message "Basic authentification rejected by server"
Test 2, CLI-mode
Cloned only trunk http://mayorat.ursinecorner.ru:8088/svn/Hello/trunk/
>hg push --stupid
pushing to http://mayorat.ursinecorner.ru:8088/svn/Hello/trunk/
searching for changes
Auth realm: <http://mayorat.ursinecorner.ru:8088> VisualSVN Server
Password for Badger:
Auth realm: <http://mayorat.ursinecorner.ru:8088> VisualSVN Server
Username: lazybadger
Password for lazybadger:
[r32] lazybadger: Cleanups
pulled 1 revisions
saved backup bundle to ...
Can say nothing about first password request, second and third are obvious and correct. 32 revision exist and visible to everybody
Sidenote: my changes doesn't broke linear history of SVN

Resources