How do I stop apt from trying to install a snap package? - apt

In using Kubuntu 20.04 and have lots of issues with snap that I can work around. I have a specific issue with the chromium browser not installing:
snap install chromium
error: cannot perform the following tasks:
Run configure hook of "chromium" snap if present (run hook "configure": cannot perform operation: mount --rbind /home /tmp/snap.rootfs_U0ZnmW//home: Permission denied)
I can live with this and find an alternative source however it is affecting apt:
apt-get -yfu dselect-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
chromium-browser
0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.
Need to get 48.3 kB of archives.
After this operation, 164 kB of additional disk space will be used.
Get:1 http://au.archive.ubuntu.com/ubuntu focal-updates/universe amd64 chromium-browser amd64 1:85.0.4183.83-0ubuntu0.20.04.2 [48.3 kB]
Fetched 48.3 kB in 0s (110 kB/s)
Preconfiguring packages ...
(Reading database ... 559004 files and directories currently installed.)
Preparing to unpack .../chromium-browser_1%3a85.0.4183.83-0ubuntu0.20.04.2_amd64.deb ...
Installing the chromium snap
Checking connectivity with the snap store
Installing the chromium snap
error: cannot perform the following tasks:
Run configure hook of "chromium" snap if present (run hook "configure": cannot perform operation: mount --rbind /home /tmp/snap.rootfs_xemBfl//home: Permission denied)
dpkg: error processing archive /var/cache/apt/archives/chromium-browser_1%3a85.0.4183.83-0ubuntu0.20.04.2_amd64.deb (--unpack):
new chromium-browser package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/chromium-browser_1%3a85.0.4183.83-0ubuntu0.20.04.2_amd64.deb
Since chromium is not installing via apt or snap I cannot remove/purge it. How do I stop apt from wanting to install chromium via snap?
I've tried removing /var/cache/apt/archives/chromium-browser_1%3a85.0.4183.83-0ubuntu0.20.04.2_amd64.deb but apt always gets it back somehow.

Related

After system upgrade from ubuntu 20.04 LTS to ubuntu 22.04.1 LTS firefox error when doing `sudo apt --fix-broken install`

After upgrade from ubuntu 20.04 LTS to 22.04.1 LTS, I got a very persistent error:
(Reading database ... 350976 files and directories currently installed.)
Preparing to unpack .../firefox_1%3a1snap1-0ubuntu2_amd64.deb ...
=> Installing the firefox snap
==> Checking connectivity with the snap store
==> Installing the firefox snap
error: cannot perform the following tasks:
- Run hook connect-plug-host-hunspell of snap "firefox" (run hook "connect-plug-
host-hunspell": cannot perform operation: mount --rbind /var/log /tmp/snap.rootf
s_hE2Zj1//var/log: Permission denied)
dpkg: error processing archive /var/cache/apt/archives/firefox_1%3a1snap1-0ubunt
u2_amd64.deb (--unpack):
new firefox package pre-installation script subprocess returned error exit stat
us 1
Please restart all running instances of firefox, or you will experience problems
.
Errors were encountered while processing:
/var/cache/apt/archives/firefox_1%3a1snap1-0ubuntu2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
This
- Run hook connect-plug-host-hunspell of snap "firefox" (run hook "connect-plug-
host-hunspell": cannot perform operation: mount --rbind /var/log /tmp/snap.rootf
s_hE2Zj1//var/log: Permission denied)
was very persistent and was hindering any apt-involved installations.
Thus, no apt install nor apt upgrade was working.
After long search and trying around,
where I did:
sudo apt --fix-broken install
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo dpkg --configure -a
And then, cave(!) this removes firefox from your installed package list
and thus after this command you cannot use firefox any more on your computer
until you install it - so I did that - but I had a second computer
where I could google around while I had no firefox on that machine.
I couldn't install chromium browser or other browsers, because apt was not working! So run this command only when you have a second computer or at least your mobile to surf for instructions!
sudo dpkg --force depends -P firefox
I found a hint in
https://forums.mozillazine.org/viewtopic.php?f=38&t=3097766
My solution was:
# Add Mozilla Team PPA
sudo add-apt-repository ppa:mozillateam/ppa
# Set PPA priority
sudo gedit /etc/apt/preferences.d/mozillateamppa
# The command creates and opens empty config file in Gedit text editor.
# When it opens, add the lines below and save it:
Package: firefox*
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 501
save and close that file.
after that, I could do finally:
sudo apt --fix-broken install
# and then:
sudo apt update && sudo apt upgrade
and then, all apt or snap commands were working again flawlessly.
note:
Now, I encounter
sudo apt install chromium-browser
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
chromium-browser
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 0 B/48,4 kB of archives.
After this operation, 164 kB of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 313313 files and directories currently installed.)
Preparing to unpack .../chromium-browser_1%3a85.0.4183.83-0ubuntu2_amd64.deb ...
=> Installing the chromium snap
==> Checking connectivity with the snap store
==> Installing the chromium snap
error: cannot perform the following tasks:
- Run configure hook of "chromium" snap if present (run hook "configure": cannot perform operation: mount --rbind /var/log /
tmp/snap.rootfs_Gg42mE//var/log: Permission denied)
dpkg: error processing archive /var/cache/apt/archives/chromium-browser_1%3a85.0.4183.83-0ubuntu2_amd64.deb (--unpack):
new chromium-browser package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/chromium-browser_1%3a85.0.4183.83-0ubuntu2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I tried:
sudo add-apt-repository ppa:xtradeb/apps
sudo gedit /etc/apt/preferences.d/xtradebppa
# content:
Package: chromium*
Pin: release o=LP-PPA-xtradeb
Pin-Priority: 501
But this didn't help.
Finally, I found out the solution!
In former days, when my / containing system partition was too full, I sym-linked /var/log. I linked it to somehwere in my home folder. But then, I moved snap back.
- Run hook connect-plug-host-hunspell of snap "firefox" (run hook "connect-plug-
host-hunspell": cannot perform operation: mount --rbind /var/log /tmp/snap.rootf
s_hE2Zj1//var/log: Permission denied)
The permission was denied, because it tried to mount to a symlink.
All I had to do was:
sudo rm /var/log
sudo mkdir -p /var/log
Now, it is not a symlink any more. So it can actually mount to it.

When running sudo apt-get upgrade fails with 'libpam-runtime' is missing final newline

I'm trying to get some packages to install in Raspian Jessy, running command:
sudo apt-get upgrade
but it fails with:
'libpam-runtime' is missing final newline
I'm tried numerous suggestions I found online like:
1) reinstalling the package with:
apt-get install libpam-runtime --reinstall
This does nothing different.
etc.
Full output looks like:
sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
bind9-host debconf debconf-i18n debconf-utils libbind9-90 libdns-export100 libdns100 libgcrypt20
libgnutls-deb0-28 libgnutls-openssl27 libirs-export91 libisc-export95 libisc95 libisccc90 libisccfg-export90
libisccfg90 liblwres90 libwbclient0 perl perl-base perl-modules samba-common
22 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/9,237 kB of archives.
After this operation, 14.3 kB disk space will be freed.
Do you want to continue? [Y/n] Y
Reading changelogs... Done
Preconfiguring packages ...
dpkg: unrecoverable fatal error, aborting:
files list file for package 'libpam-runtime' is missing final newline
updated error
When I try to run:
the purge command I got:
dpkg: unrecoverable fatal error, aborting:
files list file for package 'libpam0g:armhf' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
But, I have not found a solution after nearly 3 hours.
Does anyone have any suggestions?
Thank you.
You can try to completely uninstall package and install it again
sudo apt-get purge libpam-runtime
sudo apt-get install libpam-runtime
Your files on libpam can't complete or corrupt. I reccomended your download frpm library sites of libpam and trying manual installing I think so safety.

Unable to install mesos on centos 6.5

I am trying to install mesos package according to https://open.mesosphere.com/getting-started/install/#slave-setup but, when I run yum install mesos, transaction abort with error message:
Error unpacking rpm package mesos-1.0.1-2.0.93.centos65.x86_64
error: unpacking of archive failed on file /usr/lib/libmesos-1.0.1.so;57c7a348: cpio: read
Failed:
mesos.x86_64 0:1.0.1-2.0.93.centos65
any pointers? or is the packaging of this particular version corrupted?
I tried mesos.x86_64 0:1.0.0-2.0.89.centos65 which seems to be working.
The current mesos 1.x.x RPM installers do not handle upgrades from mesos versions < 1.0 gracefully in CentOS 6.X. A yum update of mesos from 0.28 to 1.1.0 produces the following error:
Running Transaction
Updating : mesos-1.1.0-2.0.107.centos65.x86_64
Error unpacking rpm package mesos-1.1.0-2.0.107.centos65.x86_64
error: unpacking of archive failed on file /usr/include/mesos/slave: cpio: rename
The workaround is to run:
rm -rf /usr/include/mesos/slave
And then re-run yum update (or whatever RPM management command you are using to upgrade mesos).
Source: https://github.com/mesosphere/mesos-deb-packaging/issues/87
[Updated:] A new RPM which fixes this error, 1.0.1-2.0.96, has been generated and is available for download at https://open.mesosphere.com/downloads/mesos/. (Thanks #js84)

Ubuntu 14.04 apt-get dist-upgrade error on bcmwl-kernel-source

A dist-update I just did hung (froze) after printing line:
DKMS: install completed.
I had to close the terminal to kill process, and to carry on did
sudo lsof /var/lib/dpkg/lock
kill -15 THE-PID
sudo dpkg --configure -a
But dist-update and command below (with output) still hangs, freezes on statement:
DKMS: install completed.
$ sudo apt-get install bcmwl-kernel-source
Reading package lists... Done
Building dependency tree
Reading state information... Done
bcmwl-kernel-source is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up bcmwl-kernel-source (6.30.223.248+bdcom-0ubuntu0.1) ...
Removing old bcmwl-6.30.223.248+bdcom DKMS files...
-------- Uninstall Beginning --------
Module: bcmwl
Version: 6.30.223.248+bdcom
Kernel: 3.13.0-24-generic (x86_64)
-------------------------------------
Status: Before uninstall, this module version was ACTIVE on this kernel.
wl.ko:
- Uninstallation
- Deleting from: /lib/modules/3.13.0-24-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
depmod....
DKMS: uninstall completed.
------------------------------
Deleting module version: 6.30.223.248+bdcom completely from the DKMS tree.
------------------------------
Done.
Loading new bcmwl-6.30.223.248+bdcom DKMS files...
Building only for 3.13.0-24-generic
Building for architecture x86_64
Building initial module for 3.13.0-24-generic
Done.
wl:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/3.13.0-24-generic/updates/dkms/
depmod....
DKMS: install completed.
I dont think reboot is right answer here. Might not boot at all!
Gad Zooks! Any tips & tricks?
Probably should have commands below before update/upgrade but only hind sight is 20/20
sudo apt-get autoclean
sudo apt-get autoremove
Thanks,
Brad
It looks like my Broadcomm Wireless drivers do not play well with latest Ubuntu 14.04 updates.
I just removed debian packages bcmwl-kernel-source and dkms.
The packages might very well run fine, but apt-get upgrade hangs, and I don't want to to deal with contantly freezing updates.
Now I can run 'sudo apt-get dist-upgrade' and smooth sailing.

How can i install hudson on ubuntu 10.10

When i try t install, i get error:
aptitude install hudson
The following NEW packages will be installed:
hudson
0 packages upgraded, 1 newly installed, 0 to remove and 279 not upgraded.
Need to get 38.8MB of archives. After unpacking 39.7GB will be used.
WARNING: untrusted versions of the following packages will be installed!
Untrusted packages could compromise your system's security.
You should only proceed with the installation if you are certain that
this is what you want to do.
hudson
Do you want to ignore this warning and proceed anyway?
To continue, enter "Yes"; to abort, enter "No": Yes
Get:1 http://hudson-ci.org/debian/ binary/ hudson 1.397 [38.8MB]
Fetched 1B in 0s (2B/s)
E: Failed to fetch http://hudson-ci.org/debian/binary/hudson_1.397_all.deb: Size mismatch
apt-get clean
apt-get update
apt-get install hudson
this should work.
This question is probably best posted to serverfault.com; but regardless; it appears the mirror you are using is busted and you most likely downloaded an error page (which is why the failure). Try doing an update for your repository to get the latest mirror information.
apt-get update
execute aptitude update first
I had the same problem.
I followed the steps here: http://makeitfaster.wordpress.com/2010/12/14/install-the-hudson-build-server-on-ubuntu-10-10-server/
Which then also failed at the "sudo dpkg --install /tmp/hudson.deb" line. Then I did this:
aptitude install openjdk-6-jre
At which point hudson finished installing and came on line.
I've got the same problem...
Need to get 38.8MB of archives. After
this operation, 39.7GB of additional
disk space will be used. WARNING: The
following packages cannot be
authenticated!
hudson Install these
packages without verification [y/N]? y
Get:1 http://hudson-ci.org/debian/
binary/ hudson 1.397 [38.8MB] Fetched
38.8MB in 59s (655kB/s)
Failed to fetch
http://hudson-ci.org/debian/binary/hudson_1.397_all.deb
Size mismatch E: Unable to fetch some
archives, maybe run apt-get update or
try with --fix-missing?
I have done
apt-get clean
apt-get update
apt-get install hudson
as root.
Still don't understand what the size mismatch is - I can't see any errors downloaded.
The main difference between me and the original poster is that I am downloading 38.8MB, but it still reports the wrong size.

Resources