I manually compiled mono from the /tmp directory (4.9.1) and found that it was too unstable for me, so wanted to revert back to the install from the repos. I foolishly did a reboot before doing this, so the compiled code in /tmp had gone. So, I thought I'd remove the directory of where mono is installed and mark the package mono-complete as being automatically installed again.  (Un)Surprisingly, this did not work. Now, if I do a which mono it reports that it isn't installed. If I mono I get the same message. However, when I do an apt install mono-complete or mono-devel it reports mono-complete is already the newest version.  I have checked in the env and there is no reference to mono.  How can I sort this mess out and get back to being able to install mono from packages.
100364
I usually prefer to fix a Linux system than to reinstall from scratch. My computers have seen many distribution upgrades and a list of PPAs or third-party repositories. APT usually makes sure that everything works in the end. However, the fact that the package manager thinks that all required packages are 'installed' does not guarantee that all the files are present on the file system.  Such a such situation may occur if you have to work-around dependency problems with dpkg --force-*. One could also reproduce such a situation by deleting a file from /usr as root.  Is there a simple way to verify whether all files belonging to an installed package are present?  If a such a problem package is found, aptitude reinstall fixes the problem.
10670
Occasionally I install applications manually, rather than using apt or another package manager.   What location (/usr/, /usr/local/, /opt/, /home/, etc.) is suggested by "best practices" for the installation of user applications?
14979
I am looking for the best method to restore /etc/apt/sources.list to default from the command line.  Is there no way to reference the source code of the package which generates this file or something like that? I want a trusted and version-independent way of restoring this file.  Solutions Ruled Out  Before you mark this as a duplicate, note that I have reviewed  already. It is only applicable if you have the Ubuntu GUI available. This question is specific to the command line.  I have also reviewed  where the accepted solution is someone pasted the contents of their sources.list file. This is not an appropriate way to restore the file as the intentions of the person providing the file contents cannot be verified and the file is subject to change with new releases.  I checked out the , but this is also not from Ubuntu so I do not plan to use it.
116609
From the usability point of view, I do not understand why on each release upgrade you have to manually patch all the URLs of apt in order to make them point to the newer distribution.  Why is not possible for apt to auto-detect the current and use it, so when you upgrade there is no need to upgrade the urls anymore?
5332
For a specific package, can I find out why it is installed?  So, can I see or it's manually installed, or that it is installed as a dependency of another package? Or that it is installed as part of the distro?
6652
I have always had a problem installing and removing compiled software, so I have decided I would like to build software from source into a .deb package for easier installation/removal.  I would like to know of an easy and short way to build source into a .deb package, as an end user.  I have tried:   , which did not work for me This  guide, but I found it too long
100150
I know that I can use apt-get remove &lt;package&gt; to remove a program.  But apt is a program itself. Could I use apt-get remove apt to remove it, or would it get confused part way through?
116376
I wanted to reinstall the APT Tool, so I uninstalled it, and then I realized that it probably would've been better if I just deleted the /etc/apt directory. Is there any way that I can fix my screw-up?  My Ubuntu version is 18.04.2 LTS and the output of ls /etc/apt was   root@user-OptiPlex-755:~# ls /etc/apt  ls: cannot access '/etc/apt': No such file or directory   UPDATE: I have re-installed apt, however, this is my output:  root@user-OptiPlex-755:~# sudo apt install --reinstall apt-utils ubuntu-minimal ubuntu-release-upgrader-gtk ubuntu-desktop update-manager update-notifier update-notifier-common Reading package lists... Done Building dependency tree        Reading state information... Done Package update-manager is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: ubuntu-release-upgrader-core update-manager-core  Package update-notifier-common is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  Package update-notifier is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: update-notifier-common  Package apt-utils is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: apt  Package ubuntu-release-upgrader-gtk is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'apt-utils' has no installation candidate E: Unable to locate package ubuntu-minimal E: Package 'ubuntu-release-upgrader-gtk' has no installation candidate E: Unable to locate package ubuntu-desktop E: Package 'update-manager' has no installation candidate E: Package 'update-notifier' has no installation candidate E: Package 'update-notifier-common' has no installation candidate`
39425
I'd like to install software packages, similar to apt-get install &lt;foo&gt; but:   Without sudo, and Into a local directory   The purpose of this exercise is to isolate independent builds in my  server.  I don't mind compiling from source, if that's what it takes, but obviously I'd prefer the simplest approach possible. I tried apt-get source --compile &lt;foo&gt; as mentioned  but I can't get it working for packages like autoconf. I get the following error:  dpkg-checkbuilddeps: Unmet build dependencies: help2man  I've got help2man compiled in a local directory, but I don't know how to inform apt-get of that. Any ideas?  UPDATE: I found an answer that almost works at . The problem with chroot is that it requires sudo. The problem with apt-get source is that I don't know how to resolve dependencies. I must say, chroot looks very appealing. Is there an equivalent command that doesn't require sudo?
85466
A few weeks ago I installed a 32 bit .deb file through the 'force architecture' command (on my 64bit notebook), however the procedure was unsuccessful and I used the apt-get purgecommand to uninstall the app. It seems there are some leftovers of the app I uninstalled which has now broken system update. Synaptic recommended a sudo apt-get install -fwhich I did in the terminal with this initial response:  Reading package lists... Done Building dependency tree        Reading state information... Done The following package was automatically installed and is no longer required:   libntfs10 Use 'apt-get autoremove' to remove them. The following packages will be REMOVED:   crossplatformui 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]?   I chose 'Y' then got this response:  (Reading database ... 187616 files and directories currently installed.) Removing crossplatformui ... ztemtvcdromd: no process found dpkg: error processing crossplatformui (--remove):  subprocess installed post-removal script returned error exit status 1 Errors were encountered while processing:  crossplatformui E: Sub-process /usr/bin/dpkg returned an error code (1)   It seems the app I installed crossplatformuiis still on my system and has caused update manager to stop running with a partial upgrade warning. What do I do now?
46331
I was looking for some package (nautilus-terminal), and accidentally did this:  $ sudo apt-get install nautilus- Reading package lists... Done                                                                                                                                                                                                  Building dependency tree                                                                                                                                                                                                       Reading state information... Done                                                                                                                                                                                              The following packages were automatically installed and are no longer required:                                                                                                                                                  apturl apturl-common libgail-3-0 linux-headers-4.4.0-57 linux-headers-4.4.0-57-generic linux-image-4.4.0-57-generic linux-image-extra-4.4.0-57-generic                                                                       Use 'sudo apt autoremove' to remove them.                                                                                                                                                                                      The following packages will be REMOVED:                                                                                                                                                                                          gnome-session-flashback nautilus nautilus-sendto nautilus-share ubuntu-desktop                                                                                                                                               0 upgraded, 0 newly installed, 5 to remove and 69 not upgraded.                                                                                                                                                                After this operation, 2 031 kB disk space will be freed.                                                                                                                                                                       Do you want to continue? [Y/n] ^[[^C                                                                                                                                                                                             That's quite dangerous because remove is much harder to mistype than a simple dash from a failed autocompletion.     Is that an equivalent of apt-get remove? I couldn't find any documentation for that. Edit: except for overlooking the man page...
13808
I'm having some difficulties exactly understanding how the the whole update thing work in Ubuntu and good practice for installing software.  I understand I have a  /etc/apt/sources.list file where all my repositories are listed, and that these repositories are queried when I use apt-get update - to later be used with e.g. apt-get upgrade.  This makes perfect sense and I recently installed spotify by adding deb http://repository.spotify.com stable non-free to this "sources" list.    But then I got confused...  When I went to download Google Chrome I merely had to download and grab a .deb file, and Chrome installed with no problem... but I don't see any new entry in /etc/apt/sources.list...  So how does apt-get update know where to query concerning Chrome updates?  Has it somehow been added to one of the already listed repositories in the sources file?  I would like all my installed software to be encompassed by the update function.
10452
It seems that I have two installations of TeXlive, one of which is more updated.  When I run latex, it seems to search packages inside the old installation. How can I direct latex to look for the updated installation?  All my packages in the new installation (such as tcolorbox) are listed as directories in the directory /usr/local/texlive/2015/texmf-dist/tex/latex/.   The old installation lists the package files in /usr/share/texlive/texmf-dist/tex/latex/.  Also, the command which latex gives /usr/bin/latex.
3500
So I can run on one machine:  dpkg --get-selections '*' &gt; selection.txt   On another machine:  dpkg --set-selections &lt; selection.txt   ... followed by either of the following:  aptitude install apt-get -u dselect-upgrade   ... to install the packages that.  However, it appears that some information gets lost in the process, such as whether a package (say xyz) got installed automatically as dependency of another package (abc). You can see that whenever you do something like apt-get --purge remove abc. On the original machine you would be notified that package xyz was installed as dependency of abc and that you may use apt-get autoremove to get rid of it.  Now I am aware of deborphan and debfoster, but they're cumbersome to use given the (simple) task at hand.  It seems saving and restoring the selections as shown above is not sufficient to restore the subtle dependencies of installed packages.  Is there a way to back up the complete set of metadata for package management and restore it then in its entirety?
106916
I need to automatically install a package with its config file already present on the server.  I'm looking for something like:  apt-get install --yes --force-yes --keep-current-confs mysql-server  Probably a dumb question but I can't find such an option.
75382
I am thinking of the use case of this output:  The program 'tiger' is currently not installed. You can install it by typing: sudo apt-get install tiger   How can I get it to prompt me to install that package? For example it would output this:  The program 'tiger' is currently not installed. You can install it by typing: sudo apt-get install tiger # Confirmation can go here [sudo] password for tim: The following NEW packages will be installed   tiger tripwire 0 to upgrade, 11 to newly install, 0 to remove and 0 not to upgrade. Need to get 8,416 kB of archives. After this operation, 26.5 MB of additional disk space will be used. Do you want to continue? [Y/n]  # and/or confirmation can go here   I don't want to have to run it myself. How can I get it to do it automatically, and give me the option to not install?
2907
Simple enough question: is there some shell command (or GUI method) I can use that, given the path to a file on my system, tells me what package put it there? Assuming the file did in fact come from a package, that is.  Bonus question: what if it's a file that isn't installed on my system? Is there, say, a website that will let me look up a file and see what packages, if any, provide it?