Sometimes I need to modify some configuration files in installed packages.  For example I modified /etc/pam.d/polkit-1 file and after I tried modified file I forgot its original version so I removed it hoping that reinstalling policykit-1 package would replace it, so I did   sudo apt-get install --reinstall policykit-1   but it did not replace it though /etc/pam.d/polkit-1 belongs to policykit-1   I also I tried sudo apt-get -o Dpkg::Options::="--force-overwrite" install --reinstall policykit-1  though --force-overwrite option used to override files installed by different packages.  Would anybody tell me how to do that with apt-get? I need to know it because I frequently modify files in my system. Though I can fix it manually.
89682
I want to revert a file in /etc/ back to its originally-installed form. I have edited the file since it was installed. How can I revert this config file? Apt is smart enough not to overwrite edited config files, so how do I tell it that I want it to do so?  For argument's sake, let's say that I want to revert the file /etc/foo.conf from the package foo.
103606
This is more of a curiosity question as I try to get a better understanding of apt and package management.   I'm seeing that in my /etc/apt/ and /etc/apt/sources.list.d/ folders I have very or sometimes identical files which have the extension of sources.list, sources.list.distUpgrade, sources.list.save, and so on.   What's the point of these duplicate or similar files?   sources.list and sources.list.save in /etc/apt/ seem to be identical but sources.list.distUpgrade shows quantal instead of raring for most stuff (I probably first installed quantal).   On the other hand, in the case of google-talkplugin.list and google-talkplugin.listUpgrade in /etc/apt/sources.list.d/ the content of the files seems to be completely identical.  Didn't find much in Google searches. I reviewed  but it didn't talk much about it.   Also noticed  where  related to the extensions was noted for 10.10
7534
I was browsing through the apt folder to try my proxy settings and I was unable to find the apt.conf file in Ubuntu 11.04. Is there any alternative file for it?  Adding proxy settings to 99-synaptic in apt.conf.d does not help as it gets overwritten everytime I restart the system.
81731
In order to research what caused the installation of a given package, I'd like to get a list of packages which depend on that package. I couldn't find anything obvious in man dpkg.
92410
Recently I uninstalled some software using sudo apt-get --purge autoremove, thinking that this would remove all traces of it including unused dependencies and configuration files. However I discovered that a configuration file was left behind in my home folder.  Is there a more powerful command which would remove even that?   Also, is it safe to delete the hidden files and folders under home, if they are merely configuration files, or are there other kinds of files?
60228
I've occasionally lost my config file "/etc/mysql/my.cnf", and want to restore it. The file belongs to package mysql-common which is needed for some vital functionality so I can't just purge &amp;&amp; install it: the dependencies would be also uninstalled (or if I can ignore them temporarily, they won't be working).  Is there a way to restore the config file from a package without un-ar-ing the package file?  dpkg-reconfigure mysql-common did not restore it.
28424
When packages are already installed and I run an apt-get install &lt;package-name&gt;, sometimes it will print a line &lt;package-name&gt; is set to manually installed.  What does that mean?
43512
I would like to know what some specific package installs, for example, when installing ncurses, I have found that TAB key expands:  sudo apt-get install ncurses-   to show:  ncurses-base      ncurses-doc       ncurses-hexedit ncurses-bin       ncurses-examples  ncurses-term   How could I know what, say, ncurses-term installs? I am interested mainly in programs, but libraries and any other filetypes could be useful too.  Command-line method, if possible, would be preferred (any others accepted too).
98438
On Ubuntu 18.04.2 LTS, I completely removed/uninstalled my apt-get because of problems I was having.  I tried re-installing it with dpkg by runnung:   $ sudo wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt-transport-https_1.0.1ubuntu2.23_amd64.deb   to install apt-transport-https then it's dependency:  $ sudo wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg4.12_1.0.1ubuntu2_amd64.deb   then I ran the two following commands  $ sudo dpkg -i libapt-pkg4.12_1.0.1ubuntu2_amd64.deb $ sudo dpkg -i apt-transport-https_1.0.1ubuntu2.23_amd64.deb   but when I try run apt or apt-get I still get the error     command not found   I'm still pretty new to ubuntu and I'm not sure what to do
15908
I've upgraded to Ubuntu 12.04 and did it . I didn't look at the "packages to remove" section before clicking next - I've done Ubuntu upgrades many times and assumed it was just the normal set of obsolete library packages etc. But I do tend to watch the terminal text go by and see what it's doing, and I saw it removing a number of packages I wanted. I guess these are packages that aren't on the CD that can't co-exist with the new Ubuntu.  Anyway, I want to find which packages have been removed. So does the update log get saved somewhere?  Then I can start doing some grepping on it and then reinstall the packages I did want.
51055
I'll change my system from 32 bits to 64 bits, and will be the same I had before, Debian Squeeze, but I do not want to lose the programs I installed before, because I do not remember the name of them all.   So I wanted a command to do this for me, save the name of all the programs I installed on a file, but not the standard programs that came with the system, and when I'm using the other system I would mention the name of the file and your directory for everything to be installed automatically.   One more question: is it possible to do this with programs that were installed manually with dpkg-i package.deb? If so, how can I do that?
110360
I wanted to remove and reinstall the software-center package.  I removed it, but now I can't reinstall.  I tried these commands without success:  sudo apt-get update sudo apt-get install software-center   How can I reinstall software-center?    When I performed the install command this is what I got:  $ sudo apt-get install software-center Reading package lists... Done Building dependency tree        Reading state information... Done Package software-center 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 'software-center' has no installation candidate
44028
Usually, for some commands such as apt-get install xxx, I forget to add sudo first, then I need to retype it. What I want is in such cases, I just type a simple command, for example resudo. It will sudo my last command sudo apt-get install xxx. Is it possible in bash?
97053
It is not about the common download &amp; install thing, what apt (aptitude, etc) does, it is a scripted download a package file.  I found the dget tool for this task, which works quite well. But, unfortunately, it doesn't have any option to specify a different repository URL as it is given in the /etc/apt/sources.list.  Is it somehow possible? Actually, a dget-like functionality would be the best, but where I can also specify the repo URL.    P.s. thank you very much the scripts, but I would like to prefer a debian tool for this very simple task. It will be part of a buildscript, for external usage, and any unneeded complexity has intolerable collateral costs. It must be done by a debian tool.  P.s.2. Finally I solved this with updating the system-wide repos, and downloading the packages with dget. Thank you very much the scripts!
18205
If I run:  sudo apt-get --yes install postfix    or  sudo bash -c 'yes | apt-get --yes install postfix'   an interactive prompt appears to configure postfix. I need to automate the installation of postfix (I can modify the configuration files after the install).  Is there some magic that lets me install postfix (and other package) without human intervention?
111214
Any time I try to install software or updates, I get the following message (or a slight variation):  dpkg: error: parsing file '/var/lib/dpkg/available' near line 10650 package 'libreoffige-writev': field name `Replaces&gt;' must be followed by colon   I have no idea what it means, but it always insists that `Replaces&gt;' be followed by a colon.
107115
Yesterday I had some problem with /var/lib/dpkg/lock during update. I knew that in such cases removing lock file could solve problem. So I tried to do it, but by mistake I removed all DPKG directory. So now I cannot do any update, install, upgrade and so on.  I try via Software Center, Terminal, Qapt, Synaptic. None of these work because all of them do such operations via dpkg. And as my dpkg is corrupted, so I have problem.   How can I completely restore DPKG? I have downloaded dpkg_1.16.1.2ubuntu7_amd64.deb (I use 64bit Ubuntu 12.04) file, but what to do with it in terminal? Simple double-clicking on .deb opens Software Center and you already know, it doesn't work.  P.S. Terminal gives such error:   dpkg: error: cannot read info directory: No such file or directory E: Sub-process /usr/bin/dpkg returned an error code (2)