Uncompleted installation files using apt-get - linux

Often I install softwares/packages using apt-get.
If the installation is stopped or interrupted anyhow,
then how to find and remove the partially installed files? Besides if I install the same package later, will the apt-get installation process create duplicate files?

Try this:
sudo apt-get -f install
And then:
update, upgrade, reinstall, etc...

Related

Installing vscode .deb package using terminal in ubuntu 18.04

I want to install Visual Code in ubuntu-18.04 with .deb package, i used: dpkg -i <file name.deb> i also tried: apt-get install -f
but it says it needs libconf-2-4, and libconf-2-4 needs more things...
Is there any way to install all of the dependencies together?
You can use apt for installing a package file, e.g.,
apt install ./filename.deb
The "./" helps it see that is just a package file, and after that it will continue by evaluating dependencies.

NPM/Node Error that I cannot resolve

I am trying to install my packages for a bot (that work on another vps I own) using npm 5, ubuntu 16.04, and node.js 8. The issue seems to be with sodium/libsodium. Here is the error:
I've tried deleting all the node modules and reinstalling, nothing seems to be working. Any ideas?
Install libtool. The log is saying it doesn't find libsodium so it has to build it with libtool which it can't find on your system.
sudo apt-get update
sudo apt-get install libtool
While you add at it, make sure you have automake and autoconf
sudo apt-get update
sudo apt-get install libtool automake autoconf
Then try npm install again. Remove node_modules first to be safe.
Hope this is of help.

puppet master fresh installation error

puppet master was working fine in my ubuntu 12.04 server. Today I uninstalled it using the following commands and made a fresh install again. After a fresh install, puppet master failed to start.
sudo apt-get remove puppetmaster-common
sudo apt-get remove --auto-remove puppetmaster-common
sudo apt-get purge puppetmaster-common
sudo apt-get purge --auto-remove puppetmaster-common
sudo apt-get remove puppet
sudo apt-get remove --auto-remove puppet
sudo apt-get purge puppet
sudo apt-get purge --auto-remove puppet
After a fresh install, it's totally stopped working and I am getting the below errors in log
Could not autoload puppet/type/user: Could not autoload
puppet/provider/user/directoryservice: cannot load such file
Could not autoload puppet/provider/user/directoryservice: cannot load
such file -- plist
Could not autoload puppet/type/user: Could not autoload
puppet/provider/user/directoryservice: cannot load such file
Could not create resources for managing Puppet's files and directories
in sections [:main, :master, :ssl, :metrics]
Could not prepare for execution: Could not create resources for
managing Puppet's files and directories in sections
Also, there is no puppet.conf file exists in /etc/puppet/puppet.conf location even after fresh install. I tried installing twice and I couldn't see this file getting generated.
Puppet version 3.8.5.
Ubuntu : 12.04 version
Could someone help me to resolve this issue?
Matt, I figured it out finally.
I just removed the existing apt repository by manually deleting the entries in
/etc/apt/sources.list.d
and removed puppetlabls-pc1.list, puppet.list, puppet.save, all entries related to puppet and then invoked
sudo apt-get update
And installed puppet master once again without appending any additional apt repos
sudo apt-get -y install puppetmaster
I think I was using wrong apt source. It wasn't generating puppet.conf file at all. May be thats the reason why I was getting weired errors like that

In Docker, why is it recommended to run `apt-get` update in the Dockerfile?

Sorry, very new to server stuff, but very curious. Why run apt-get update when building a container?
My guess would be that it's for security purposes, if that the case than that'll answer the question.
apt-get update ensures all package sources and dependencies are at their latest version, it does not update existing packages that have been installed. It's recommended that you always run apt-get update prior to running an apt-get install this is so when the apt-get install is run, the latest version of the package should be used.
RUN apt-get update -q -y && apt-get install -q -y <your-program>
(the -q -y flags just mean that the apt process will run quietly without asking you for confirmations as this would cause the Docker process to fail)
First, lets make a distinction between apt-get update and apt-get upgrade. The update is to get the latest package index. This is so that you don't run into errors for outdated or redacted packages when doing a apt-get install.
The upgrade is actually going through an upgrading packages. It usually also requires a preceding update to have the updated package index. This might be done if there are package or security concerns of already installed packages.
You usually see an update a lot in builds because the base image may have a fairly out of date package index and just doing an apt-get install can fail.
The upgrade would be less common. But could still be done if you want to ensure the latest packages are installed.

What traces of an application can apt-get purge still leave behind?

I noticed that apt-get purge doesn't always clean every trace of an installation.
As a concrete example, I'm trying to remove mailman (installed by apt-get install mailman).
Now, I tried to remove every(!) trace of this installation by apt-get purge mailman.
find / -name '*mailman*' reveals that there is still some stuff from mailman around:
/run/mailman
/var/cache/apt/archives/mailman_1%3a2.1.16-2_amd64.deb
/var/spool/postfix/private/mailman
/usr/share/bash-completion/completions/mailmanctl
/usr/share/locale-langpack/en_GB/LC_MESSAGES/mailman.mo
/usr/share/locale-langpack/en_AU/LC_MESSAGES/mailman.mo
Also, the installation created an additional user "list" and a group "list" that I'm quite sure wasn't there before.
So, I was wondering how thorough apt-get purge is? In other words, in what way might apt-get install X; apt-get purge X; change my system? And are there more thorough methods?
When building a package, the files generated by the build process are registered. When you uninstall a package, these files will be removed (remove keeps config files, purge removes them, too).
If a program itself generates files, the package manager usually doesn't know about this, and won't touch these files.
Also, third party addons, suggested packages or dependencies may create files which do not belong to the removed/purged package, even if they don't make any sense without it.
To find out to which package a file belongs, use apt-file:
apt-file search /path/to/file
You may need to install apt-file and update its database:
sudo apt-get install apt-file && sudo apt-file update
You can use
apt-get --purge remove PACKAGE instead of apt-get purge
apt-get --purge remove mailman
AND this will remove the dependencies
sudo apt-get autoremove mailman

Resources