date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,399,366,660,000
I am updating my Debian system to a new major release and as Debian is famous for having one of the largest software repositories among Linux distros, I am interested to see what packages have been added since the last release. Currently I am updating from Debian 10 "Buster" to Debian 11 "Bullseye". Is such a list maintained by the Debian project people or else how is it possible to build it, probably using an APT query? Obviously packages that have only seen version updates should not be counted. It would also be interesting to see what packages have been removed.
My goal was to get a sneak peak of what is to come (and to go) in a new Debian release before making any changes to my system. I also wanted to keep the list to a possible minimum, since the changes in Debian releases are incredibly huge. While other posted answers are great, by borrowing from them I came up with the following command. It fetches package name lists belonging to different releases from the Debian website, removes unnecessary info such as version numbers and whitespace as much as possible and compares the two lists of package names using diff. Therefore all package names that are present in one release and not in the other are marked and colorized and vice versa. This is what I came up with: diff --color=auto --side-by-side --width=$COLUMNS \ --suppress-common-lines --ignore-case --ignore-all-space \ <(curl https://packages.debian.org/buster/allpackages?format=txt.gz | zcat | sed -E 's/\([^)]+\)/-/') \ <(curl https://packages.debian.org/bullseye/allpackages?format=txt.gz | zcat | sed -E 's/\([^)]+\)/-/') For a nicer GUI experience, the diff command could be replaced with meld. Some packages have version numbers inside their names that makes it hard to remove using a regex, e.g. linux-image-4.19.0-12-amd64. So please share any modifications that might result in an easier to read output.
How to find what packages are added in a new Debian release
1,399,366,660,000
I'm running a custom build of Debian buster/sid. I have broken a lot of things seemingly by mistakenly running apt-get dist-upgrade (I think that's what did it). So the desktop manager\desktop environment no longer loads at all and I just get a command-line shell. Aptitude and apt-get are broken as is dpkg. apt update, aptitude update and apt-get update fails and gives a lot of errors when attempted to run, however my /etc/apt/sources.list looks fine deb http://ftp.ie.debian.org/debian unstable main contrib non-free deb-src http://ftp.ie.debian.org/debian unstable main contrib non-free deb http://ftp.ie.debian.org/debian experimental main contrib non-free deb-src http:// ftp.ie.debian.org/debian experimental main contrib non free deb https://dl.winehq.org/wine-builds/debian sid main deb https://dl.winehq.org/wine-builds/ubuntu sid main errors on update like this: Err:2 http://ftp.ie.debian.org/debian unstable InRelease Couldn't execute /usr/bin/apt-key to check /var/lib/apt/lists/partial/ftp.ie.debian.org_debian_dists_experimental_InRelease and E: Problem executing scripts APT::Update::Post-Invoke-Success '/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/gdbus call --system --dest org.freedesktop.PackageKit --object-path /org/freedesktop/PackageKit --timeout 4 --method org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo > /dev/null' E: Sub-process returned an error code aptitude upgrade, apt upgrade or apt-get upgrade appear to be broken due to dpkg being broken Dpkg gives this error: dpkg: warning: 'sh' not found in PATH or not executable dpkg: error: 1 expected however echo $PATH returns, which looks fine to me /home/ferg/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games if I try sh I get The program 'sh' is currently not installed. To run 'sh' please ask your administrator to install the package 'dash' If I try sudo apt-get install dash it tells me dash is already the newest version (0.5.8-2.6) and if I continue E: Sub-process /usr/sbin/dpkg-preconfigure --apt || true returned an error code (100) E: Failure running script /usr/sbin/dpkg/preconfigure --apt || true If I run sudo nano /etc/apt/apt.conf.d/70debconf and comment out the line DPkg::Pre-Install-Pkgs {"/usr/sbian/dpkg-preconfigure --apt || true";}; then aptitude fails with dpkg: warning: 'sh' not found in PATH or not executable dpkg: error: 1 expected So I can't reinstall necessary packages to restore the system because dpkg (and therefore aptitude, apt-get, apt) are broken, seemingly because sh is not in my PATH. However all the correct directories are in my PATH. I'm assuming that fixing this issue with sh would allow dpkg and aptitude to work again but I'm wondering what precisely is the problem with sh? Thank you in advance for any help. Update: ls -l /bin/bash returns -rwxr-xr-x 1 root root 1099016 May 15 2017 /bin/bash ls -l /bin/sh returns lrwxrwxrwx 1 root root 4 Jun 28 2017 /bin/sh -> dash ls -l /bin/dash returns ls: cannot access 'bin/dash': No such file or directory So /bin/sh seems to redirect to /bin/dash which has been deleted somehow? sudo apt-get install --reinstall dash fails with: 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. E: Internal Error, No file name for dash:amd64 Running sudo ln -sf bash /bin/sh and then sudo apt-get install --reinstall dash fails with the same error as above. Searching for this issue and variants of it on Google I've found numerous solutions related to the user's PATH and permissions, I've checked the files which relate to that including /etc/sudoers /root/.bashrc and /root/.profile and /etc/profile. In most of those cases the users were able to solve their issue by simply defining their path correctly (usually the /sbin or /usr/sbin directories were missing). As stated above my PATH seems to contain all the relevant directories whether I run echo $PATH normally or as root or sudo echo $PATH. Some users were also having issues with permissions or with sudo itself. I've also tried executing various aptitude apt and apt-get and dpkg commands as root using sudo -i which suggests that my issue is different.
As stated by @Stephen Kitt I had encountered this bug in dash which had broken sh (the Bourne shell) as /bin/sh is a symlink to /bin/dash/ in my particular distribution. Running sudo ln -sf bash /bin/sh in order to point sh to bash and then running sudo apt-get update followed by sudo apt-get install --reinstall dash followed by sudo apt-get full-upgrade solved the issue.
Broken my Debian install: 'sh' not found in PATH
1,399,366,660,000
I have a problem with an uncompleted upgrade on my local Debian install: Operating System: Debian GNU/Linux buster/sid Kernel: Linux 4.12.0-1-686-pae Architecture: x86 I tried to fix it with apt upgrade -f and dpkg --configure lilypond-data but whatever I do, I get the following message: Setting up lilypond-data (2.18.2-8) ... Running mktexlsr /usr/share/texlive/texmf-dist... mktexlsr: Updating /var/lib/texmf/ls-R-TEXLIVEDIST... mktexlsr: Done. ln: failed to create symbolic link 'lilypond/user': File exists dpkg: error processing package lilypond-data (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: lilypond-data E: Sub-process /usr/bin/dpkg returned an error code (1) if I run dpkg --remove --force-remove-reinstreq --dry-run lilypond-data I get: dpkg: dependency problems prevent removal of lilypond-data: lilypond depends on lilypond-data (= 2.18.2-8). dpkg: error processing package lilypond-data (--remove): dependency problems - not removing Errors were encountered while processing: lilypond-data
The general approach would be to look at (shell script) /var/lib/dpkg/info/lilypond-data.postinst and find the ln line that's failing. Then determine why, and work around it (e.g., by rming the existing link, or worst case by editing the postinst). And of course then file a bug. Except someone else has already done so—see bug 871631. And the bug has been fixed; you just need to grab (and install) 2.18.2-9 from unstable. (Which yields an important lesson: check the bug tracking system before thinking about how to fix it...) Also: you may want to install apt-listbugs.
Problem with lilypond upgrade on Debian "buster/sid"
1,399,366,660,000
I've got a feeling something bad just happened to this machine. faheem@bulldog:/usr/local/src/mercurial$ sudo dpkg -i mercurial_3.0-1_amd64.deb mercurial-common_3.0-1_all.deb dpkg: warning: 'ldconfig' not found in PATH or not executable dpkg: warning: 'start-stop-daemon' not found in PATH or not executable dpkg: error: 2 expected programs not found in PATH or not executable Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin This is an old unmaintained machine I've been using for a while. Assuming it was going to die some day. Looks like this might be the day. It starting throwing errors a bit earlier, and it looks like someone just rebooted it. UPDATE: After running sudo -s I checked the value of path echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/games So some stuff is missing from here, e.g. sbin, and /usr/sbin. UPDATE 2: As it turns out, person or persons unknown deleted the following lines from /etc/sudoers. Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" Thanks to Anthony for explaining.
As the 'Note:' at the bottom of your sudo dpkg -i output hints at, this is usually caused by $PATH being set wrong. One way that happens is when you run dpkg -i without root; but that isn't the case here. An easy way to confirm the path is to run sudo -s, which tells sudo to run a shell instead of some other program. So you'll be landed at a root shell prompt. If you echo "$PATH", you'll likely find /sbin and/or /usr/sbin missing. sudo's default behavior is to keep your user's $PATH variable intact. That default is normally changed by Debian's default /etc/sudoers, which contains: Defaults env_reset ⋮ Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" If you're missing the secure_path line, that'd explain the problem. Two options are to add that line back (but someone may have removed it because he/she wanted the user path to be carried over, e.g., because it contains extra elements in /opt, for example) or to add /sbin:/usr/sbin to your user's $PATH.
What do you do when you try to sudo and root's PATH has gone kerblooey?
1,399,366,660,000
I often use dpkg or aptitude combined with grep when I want to list certain packages available or installed on my system, but I noticed that when I add | grep, the output lines look a little bit different. Here's a pure dpkg output, the first command was typed when the terminal was smaller, the second one when the terminal was maximized: As you can see, the output differs depending on the size of the window -- the spaces are reduced in the case of a smaller one. Now, what happens when we add | grep: A part of the first output was dropped to the second line. But when I maximised the terminal and typed the command once more, the line is in one piece. Moreover, the columns have the same fixed size (the same spaces between them). This is an aptitude output: Both commands were typed in the maximised window, but the grep line has narrower columns, and some text of the third column was cut off. Why does it happen? Is there a way to stop grep from resizing the lines? I don't know how to add an image without changing its parameters, I hope you see what I'm talking about.
It is not grep changing the output. It is dpkg and aptitude. They check whether the output goes to a terminal or to some other command. If it is a terminal they adapt their own output width to match the terminal size. If the output does not go to a terminal, the command has no idea what column size would be appropriate. (The output might as well end in some file.) The same happens with ls. Compare ls and ls|cat. There is no general way to solve this, but some commands might have specific options for that. For example aptitude has --disable-columns and -w: --disable-columns This option causes aptitude search and aptitude versions to output their results without any special formatting. In particular: normally aptitude will add whitespace or truncate search results in an attempt to fit its results into vertical “columns”. With this flag, each line will be formed by replacing any format escapes in the format string with the corresponding text; column widths will be ignored. -w <width>, --width <width> Specify the display width which should be used for output from the search command (by default, the terminal width is used). The man page of dpkg says: COLUMNS Sets the number of columns dpkg should use when displaying formatted text. Currently only used by -l.
Why does grep change the length of output lines?
1,399,366,660,000
So, I ssh into a (very) remote Ubuntu 10.4 server to do some admin and web dev+design. And I was looking through the various package manager options. There's a lot. The big ones are dpkg, apt, apt-get, aptitude, and synaptic. I don’t remember where I got the idea, but I seem to remember that each of these is basically building on top of its predecessors, so I kind of assumed that if I do some stuff in one tool, then do some more stuff in another tool, it wouldn’t cause any conflicts. (And I haven’t noticed any so far.) But then I saw some dotfiles/dot-directories in my home directory and started to think more about it. Are these just storing configuration information for each tool’s “front end”? Or are they all tracking package management activities separately? Separate would be bad. ☺ Is this safe?
You should be fine. Each front end will have its own set of configuration values, but as far as your system goes, the backend (in your case the Debian package system) is going to have the system-wide package database of things that have been installed etc. The information about your system would not be in your home directory anyways :)
dpkg, apt, synaptic. aptitude: can user customizations cause conflicts?
1,399,366,660,000
I want to build a version of some software that is more recent than the one that is currently available as a stable release Debian package. To do this, however, other than using a more recent version of the source code, I would like to follow, as closely as possible, the build procedure that was used to build the Debian package for this software in the stable release. At the very least, I would like to specify the same configuration flags and the same values for relevant environment variables during the build as was done for the stable release Debian package for this software. Q: How can I find the build procedure for a specific (stable release) Debian package?
The build procedure for a Debian package is described by its source package. If you have a Debian system, you can download that using apt source ${package} if your sources.list contains the appropriate deb-src entries. If you have multiple releases referenced in your repositories, you can specify that you’re after the stable release: apt source ${package}/stable (assuming you have stable in your repositories). You might find the newer release you’re interested in already packaged in testing or unstable, in which case using that instead will save you some time — see How can I install more recent versions of software than what Debian provides? for instructions in this situation. In the source package, the main files to look at are debian/control and debian/rules. For example, the hello package‘s control file specifies that it builds with debhelper in compatibility level 9 (see man debhelper for details) and its rules file specifies that it uses the default dh settings to build (including the default dpkg build flags, see dpkg-buildflags). If your source package specifies how to update it, you might only need to run uscan to update the source package, change to the corresponding directory, add a changelog entry for the new version with dch -v 1.2.3-0.1 "New upstream release." (replacing 1.2.3 as appropriate), then dpkg-buildpackage -us -uc to build the package. The main gotcha when updating a package in this way is that any patches may need to be updated. If debian/patches/series exists and isn’t empty, you’ll need to check each patch in turn, by running quilt push; see man quilt for details.
How to get the build procedure for a Debian package?
1,399,366,660,000
I know I can do dpkg --get-selections to see a list of installed packages. However I have a hard drive that doesn't boot but most files appear to be intact. Is there a way I can get the list of packages that were installed off this broken hard drive without figuring out how to boot a system from it? Where does dpkg store this information? The old system was Ubuntu 18.04 LTS. Thanks in advance.
The answer to your question is that it is stored in the file /var/lib/dpkg/status (at least by default). However, if you have mounted the old system, then it may be possible to run dpkg --get-selections on it directly, using the --root switch. From man dpkg: --root=dir Changing root changes instdir to «dir» and admindir to «dir/var/lib/dpkg». So for example dpkg --root=/mnt/oldroot --get-selections If your old system had a separate /var or /var/lib partition, these will also need to be appropriately mounted as well.
where does apt or dpkg store the list of installed packages?
1,399,366,660,000
These commands: dpkg -i apt-get install apt-get update apt-get remove apt-get dist-upgrade apt-get purge in these distros: Opensuse, Fedora, Gentoo, Arch, Slackware.
Check this page, you will get all details . Fedora/RHEL/CentOS: yum install/remove/search/update package OpenSuse: yast2 --install/--remove <package_name> Or zypper # to print the list of available global options and commands zypper help search # to print help for the search command zypper lp # to see what patch updates are needed zypper patch # to apply the needed patches zypper se sqlite # to search for sqlite zypper rm sqlite2 # to remove sqlite2 zypper in sqlite3 # to install sqlite3 zypper in yast* # to install all packages matching 'yast*' zypper up # to update all installed packages with newer versions, where possible Gentoo: emerge package # Install emerge -C package # Remove a package emerge -s keyword # Search for packages (package names only) emerge -u package # update the package Arch pacman -U package.pkg.tar.xz # Local package install pacman -Syy # Refresh package databases pacman -Syu # Update installed packages pacman -S package # Install package pacman -R package # Remove package Slackware Check man pages of Pkgtools/Slackpkg
Equivalent of these commands in the following distros [closed]
1,399,366,660,000
I'm used to using dpkg -S /path/to/file to figure out where something came from on Debian. The ~new "everything-in-usr" AKA usrmerge policy often breaks this. For just on example: > dpkg -S /bin/systemd systemd: /bin/systemd > readlink -f /bin/systemd /usr/lib/systemd/systemd > dpkg -S /usr/lib/systemd/systemd dpkg-query: no path found matching pattern /usr/lib/systemd/systemd This sucks because the actual executable running is /usr/lib/systemd/systemd so I'm much more likely to want to know what package that came from in any given usage of dpkg -S. Is there another usrmerge aware substitute for dpkg -S I could used to easily and reliably track an executable back to its package?
I’m not aware of any /usr-merge-aware equivalent to dpkg -S, but there is a way to avoid this problem: dpkg -S doesn’t need a full path, so dpkg -S lib/systemd/systemd and dpkg -S bin/systemd will give you the answer(s) you’re looking for. If you want to avoid listing all files matching the given patterns as substrings, add a *: dpkg -S '*lib/systemd/systemd' '*bin/systemd' See also dpkg-query: no path found matching pattern /usr/bin/bash, and this description of the /usr merge (written by the dpkg maintainer) which explains some of the constraints involved, and lists a number of dpkg features which are broken by the usrmerge package’s approach (including dpkg -S).
Debian everything-in-usr directory scheme (usrmerge) breaks dpkg -S. Work around?
1,399,366,660,000
I am upgrading the kernel in Debian 9.0 Stretch to kernel to 4.9.0-1-amd64. The package is installed, however, at the end of the procedure I got the cryptic error: device-mapper: reload ioctl on osprober-linux-sda2 failed: Device or resource busy Command failed I also am worried about rebooting it, and it not booting properly. Running dpkg-reconfigure linux-image-4.9.0-1-amd64 also produces the same error. Oddly enough, at /etc/fstab I have no sda2 partition, and the procedure used to work until now. It just stopped working after the last package upgrades (in fact I could swear I saw the error first after the last udev package upgrade to 232-18 ). VMs with Jessie are still working fine. So fstab is: $cat /etc/fstab /dev/sda1 / ext3 errors=remount-ro,noatime 0 1 /dev/sda3 none swap sw 0 0 However, running blkid, I remember now /dev/sda2 is the ext3 journaling partition: /dev/sda1: UUID="43dcd715-1914-4da8-8e55-27879705920a" EXT_JOURNAL="b153f326-cb4e-491b-9b38-f9750dcf5165" TYPE="ext3" PARTUUID="8aac691c-01" /dev/sda2: LABEL="j-my-dev" UUID="b153f326-cb4e-491b-9b38-f9750dcf5165" LOGUUID="b153f326-cb4e-491b-9b38-f9750dcf5165" TYPE="jbd" PARTUUID="8aac691c-02" /dev/sda3: UUID="a04c0b69-07d5-40e1-8c80-6914118f6df4" TYPE="swap" PARTUUID="8aac691c-03" After investigating a little more, I also found a dangling file still mentioning the old sda2 (as this VM was migrated from a server with LVM many moons ago) The contents of /etc/blkid.tab were: <device DEVNO="0x0802" TIME="1414777337.116803" UUID="B24u3l-mvwB-vyxK-GRNw-vc6o-r2sS-NDgVru" TYPE="LVM2_member">/dev/sda2</device> I deleted it, however it probably does not do any difference as the proper blkid.tab is as expected at /var/run/blkid/blkid.tab <device DEVNO="0x0801" TIME="1487991512.317454" UUID="43dcd715-1914-4da8-8e55-27879705920a" EXT_JOURNAL="b153f326-cb4e-491b-9b38-f9750dcf5165" TYPE="ext3" PARTUUID="8aac691c-01">/dev/sda1</device> <device DEVNO="0x0802" TIME="1487991415.63466" LABEL="j-my-dev" UUID="b153f326-cb4e-491b-9b38-f9750dcf5165" LOGUUID="b153f326-cb4e-491b-9b38-f9750dcf5165" TYPE="jbd" PARTUUID="8aac691c-02">/dev/sda2</device> <device DEVNO="0x0803" TIME="1487991512.507280" UUID="a04c0b69-07d5-40e1-8c80-6914118f6df4" TYPE="swap" PARTUUID="8aac691c-03">/dev/sda3</device> Running the previous dpkg-reconfigure still gives the same error. I also managed to pinpoint the error to upgrade-grub being called in dpkg-reconfigure. Running it separately: #update-grub Generating grub configuration file ... Found linux image: /boot/vmlinuz-4.9.0-1-amd64 Found initrd image: /boot/initrd.img-4.9.0-1-amd64 device-mapper: reload ioctl on osprober-linux-sda2 failed: Device or resource busy Command failed done stracing upgrade-grub, it is evident this happens at /etc/grub.d/30_os-prober, and reading that script the offending command is os-prober. So running it: #os-prober device-mapper: reload ioctl on osprober-linux-sda2 failed: Device or resource busy Command failed The error comes from os-prober calling: #/usr/bin/linux-boot-prober /dev/sda2 device-mapper: reload ioctl on osprober-linux-sda2 failed: Device or resource busy Command failed Looking at 30_os-prober I also find out about GRUB_OS_PROBER_SKIP_LIST. if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" ] && [ "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then echo "Skipped ${LONGNAME} on ${DEVICE} by user request." >&2 continue fi Googling around found this article: Make grub2 ignore a certain partition, which led me to put in /etc/default/grub: GRUB_OS_PROBER_SKIP_LIST="b153f326-cb4e-491b-9b38-f9750dcf5165@/dev/sda2" However, the error still happens, and putting the 30_os-prober script in debug mode shows the code block responsible for handling GRUB_OS_PROBER_SKIP_LIST is not executed. e.g. it does not even reaches the if line displayed above. My GRUB version is 2.02~beta3-5. What to do? UPDATE: as per @GaD3R request, libmapper-dev is 1.02.1
Given GRUB_OS_PROBER_SKIP_LIST apparently not being used (bug?), I had to configure instead GRUB/os-prober for not to scan for the OS in every partition. So it was added to /etc/default/grub the line: GRUB_DISABLE_OS_PROBER=true Now, the commands dpkg-reconfigure linux-image-4.9.0-1-amd64 and update-grub work properly. The server in question was also rebooted with the kernel 4.9.0-1-amd64 with success. A related question, that I found after all the debugging and the solution, here, also advocates removing os-prober altogether as an alternative. That solution will also work as the scripts check for the existence of the binary before invoking it. I suspect os-prober is only needed for multi-OS grub, which is not my case. After the comment of @Ferenc Wágner about historic problems with os-prober, and also sharing the opinion it does not hurt removing os-prober in a context of Linux-only VMs, I actually removed it from my VMs.
Debian: New error message upgrading kernel (to 4.9) - reload ioctl error
1,399,366,660,000
I obtained a strange error message inside a chroot: unknown user 'geoclue' in statoverride file when running apt-get install or apt-get upgrade. I use schroot to enter this chroot. I found that I had a package called geoclue-2.0 installed in the chroot, and I purged it. apt-get purge geoclue-2.0 This made the problem go away. What caused this problem? I'm running Debian wheezy on the host machine. The chroot is running Debian jessie (testing). I asked about this on chat, and this prompted Braiam to post the closely related How to prevent schroot from overridding passwd file and others files already present on the chrooted system?
In your specific case is because schroot overrides several files, including the /etc/passwd one, which dpkg queries to compare with the statoverride file, it checks that all entries of the statoverride file are in the passwd, and if they are not, issue a warning, which is what is happening. Essentially, it happens whenever you remove a user that a package created. That is easily fixable if you reconfigure/reinstall the relevant package (in your case it was geoclue, it can be anything else, luckily Debian uses the same username as the name of the project, normally) and it will (re)create the user in the passwd file.
Error message: unknown user 'geoclue' in statoverride file
1,399,366,660,000
When I type dpkg -l | grep xserver-xorg, I get a list of installed packages and their versions: ii xserver-xorg 1:7.7+3~deb7u1 ii xserver-xorg-core 2:1.12.4-6 ii xserver-xorg-input-evdev 1:2.7.0-1+b1 ii xserver-xorg-input-kbd 1:1.6.1-1+b1 ii xserver-xorg-input-mouse 1:1.7.2-3 ii xserver-xorg-video-radeon 1:6.14.4-8 I am wondering what the number in front of the colon means, i.e. the number 2 in 2:1.12.4-6
The version numbers in Debian are of the form [epoch:]upstream_version[-debian_revision] where epoch is a single (generally small) unsigned integer, which is included to allow mistakes in the version numbers of older versions of a package. If omitted, the epoch is assumed to be zero. upstream_version is usually the version number of the original source package from which the .deb file has been made. It is usually kept the same as the format used for the upstream source. debian_revision specifies the version of the Debian package based on the upstream version. It is optional and is omitted in cases where a piece of software was written specifically to be a Debian package.
Understanding Debian dpkg package version numbers [duplicate]
1,399,366,660,000
e.g. if package specifies Depends: www-browser How does apt/dpkg decide which real package will be installed?
According to this answer on Ask Ubuntu, apt will first try to install any non-virtual packages listed as options instead: Now, according to sources, apt tries first of satisfying the dependency before trying with virtual packages (i.e., if depends are firefox | www-browser, checks if any of the packages are installed, then try to install firefox if neither is). If not, it will simply iterate over the list of packages that provide the virtual one, and install the first one that it can: If the non-virtual package isn't available, it seems to just iterate over all packages which provides the virtual package, if no other dependencies are broken. Other comments evidence of this behavior are this which leads to GrpIterator::FindPreferredPkg function.
How does apt/dpkg choose which real package is installed when a virtual package is specified as a dependency?
1,399,366,660,000
I have been running Debian Wheezy for a long time. Today I ran a dpkg upgrade, which has somehow broken things badly. The upgrade aborted, and now apt-get and dpkg are not running. # dpkg dpkg: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory I can download the .deb files that contain the missing files, but I cannot install them without working tools. How do I get out of this catch 22?
Library files in the standard directories must be registered in a cache for performance. If the upgrade aborted at the wrong time, it's possible that you have library files that are present in the filesystem but not in the cache. Run ldconfig as root to update the cache. To help troubleshoot dynamic library problems, it can help to have some statically linked utility suites: busybox-static, sash, zsh-static.
Debian dpkg broken after apt-get upgrade
1,399,366,660,000
I want to list all packages of the form $ dpkg -l libav\* but in addition to this output, I would like the origin/source (I'm not sure of the preferred term) of each package. If the package doesn't correspond to any source, it should say unknown or similar. Off the top of my head, the most promising approach would be to use dctrl-tools, but I'm not sure how to go about it. For background, I was trying to debug a library mismatch with ffmpeg. See Debian bug report - ffmpeg: backport of 4:0.6.1-5 from unstable produces WARNING: library configuration mismatch. The bug report is no longer an issue, but I'm still interested in this question. Just to be clear on the format, this should look something like ii libavahi-client-dev 0.6.27-2+squeeze1 Development files for the Avahi client library squeeze ii libavcodec-dev 4:0.6.1-5 Development files for libavcodec unstable If the same package is available in multiple categories, ie. in both squeeze and testing, then the lowest / oldest category available should be used. In this case, squeeze.
Dpkg doesn't track this information. Where you got each .deb file is not its concern. Apt doesn't track this information either, but it knows where you can now get the package, which is good enough. As 9000 wrote in a comment, apt-cache policy '^libav' shows you what versions of packages with names matching the regexp ^libav are installed or available. The output isn't particularly convenient to parse, but here's a minimally tested script that gives approximately the format you want: { LC_CTYPE=C apt-cache policy '^libav'; echo .; } | perl -l -ne ' if (!/^ /) { if (defined $version) {print "$package: $version unknown"} s/: *$//; $package=$_; $installed=1; $version=undef; } if (/^ *Installed: *\(none\)$/) {$installed=0} if ($installed && /^ \*+ +([^ ]+)/) {$version=$1} if (/^ [^ ]/) {$version=undef} if ($installed && defined $version && /^ +[0-9]+ +[^ ]+ +([^ \/]+)/) { print "$package: $version $1"; $version=undef; } ' Another way to the information you're asking for is with aptitude versions. Again, the minimally-tested snippet below gives roughly the desired format. The pattern "^libav" ~i matches packages that are installed and whose name matches the given regexp. aptitude versions '"^libav" ~i' | awk -vRS= '{if ($6 !~ /[^0-9]/) {$6="unknown"} print $3, $2, $5, $6}' There's also a separately-packages utility apt-show-versions that, again, gives the information you want in roughly the format you're asking. apt-show-versions | grep '^libav'
listing packages in Debian, a la `dpkg -l`, but including the package origin/source
1,399,366,660,000
I've previously added i386 support in order to install wine32 with: sudo dpkg --add-architecture i386 Now I don't need wine32 anymore and removed it, then wanted to remove the i386 architecture again, but it states: sudo dpkg --remove-architecture i386 dpkg: error: cannot remove architecture 'i386' currently in use by the database I assume that I could remove all i386 packages shown by dpkg --list | grep i386, but I'm not sure whether this may impair my systems functionality or not. My question is, if its safe to remove the listed i386 packages, considering that I removed wine32. Or on the other hand if it may interfere with my system in any way, if I keep the i386 architecture. Debian Stretch 4.1.0-2-amd64
On a debian amd64 system, the i386 architecture is an optional extra. No i386 packages are required for the system to function. If you are not using any 32-bit programs, you can safely remove all :i386 packages, and the i386 architecture. Personally, I wouldn't bother removing them unless disk space was extremely tight. The i386 packages do no harm and you may want to run 32-bit software again in the future.
Added i386 support for wine, removed it now I can't remove the architecture
1,399,366,660,000
I am using Ubuntu 14.04, newly upgraded from 12.04. I was trying to upgrade my software, but it is showing many, many dpkg errors regarding texlive-*. When I type following command: sudo apt-get upgrade I get the following error: Ignoring /etc/texmf/texmf.d/05TeXMF.cnf during generation of texmf.cnf, please remove manually! Ignoring /etc/texmf/texmf.d/15Plain.cnf during generation of texmf.cnf, please remove manually! Ignoring /etc/texmf/texmf.d/45TeXinputs.cnf during generation of texmf.cnf, please remove manually! Ignoring /etc/texmf/texmf.d/55Fonts.cnf during generation of texmf.cnf, please remove manually! Ignoring /etc/texmf/texmf.d/65BibTeX.cnf during generation of texmf.cnf, please remove manually! Ignoring /etc/texmf/texmf.d/75DviPS.cnf during generation of texmf.cnf, please remove manually! Ignoring /etc/texmf/texmf.d/80DVIPDFMx.cnf during generation of texmf.cnf, please remove manually! Ignoring /etc/texmf/texmf.d/85Misc.cnf during generation of texmf.cnf, please remove manually! Ignoring /etc/texmf/texmf.d/90TeXDoc.cnf during generation of texmf.cnf, please remove manually! Ignoring /etc/texmf/texmf.d/95NonPath.cnf during generation of texmf.cnf, please remove manually! Running mktexlsr. This may take some time... done. Running updmap-sys. This may take some time... updmap-sys failed. Output has been stored in /tmp/updmap.kk3Qciew Please include this file if you report a bug. Sometimes, not accepting conffile updates in /etc/texmf/updmap.d causes updmap-sys to fail. Please check for files with extension .dpkg-dist or .ucf-dist in this directory dpkg: error processing package tex-common (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of latex-sanskrit: latex-sanskrit depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package latex-sanskrit (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-latex-base: texlive-latex-base depends on tex-common (>= 3); however: Package tex-common is not configured yet. and many more of such types. How can I fix this? @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ The output of the command :: apt-get install tex-common is following :: find: `/etc/texmf/texmf.d': No such file or directory Running mktexlsr. This may take some time... done. Running updmap-sys. This may take some time... updmap-sys failed. Output has been stored in /tmp/updmap.8Lse0Bt5 Please include this file if you report a bug. Sometimes, not accepting conffile updates in /etc/texmf/updmap.d causes updmap-sys to fail. Please check for files with extension .dpkg-dist or .ucf-dist in this directory dpkg: error processing package tex-common (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of latex-sanskrit: latex-sanskrit depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package latex-sanskrit (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-latex-base: texlive-latex-base depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package texlive-latex-base (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-generic-recommended: texlive-generic-recommended depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package texlive-generic-recommended (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure.dpkg: dependency problems prevent configuration of texlive-pstricks: texlive-pstricks depends on texlive-generic-recommended (>= 2013.20130512); however: Package texlive-generic-recommended is not configured yet. texlive-pstricks depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package texlive-pstricks (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of asymptote: asymptote depends on texlive-latex-base; however: Package texlive-latex-base is not configured yet. asymptote depends on texlive-pstricks; however: Package texlive-pstricks is not configured yet. asymptote depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package asymptote (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-latex-recommended: texlive-latex-recommended depends on texlive-latex-base (>= 2013.20130512); however: Package texlive-latex-base is not configured yet. texlive-latex-recommended depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-latex-recommended (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of cm-super-minimal: cm-super-minimal depends on tex-common (>= 3); however: Package tex-common is not configured yet. cm-super-minimal depends on texlive-latex-recommended; however: Package texlive-latex-recommended is not configured yet. dpkg: error processing package cm-super-minimal (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of cm-super: cm-super depends on tex-common (>= 3); however: Package tex-common is not configured yet. cm-super depends on texlive-latex-recommended; however: Package texlive-latex-recommended is not configured yet. cm-super depends on cm-super-minimal (= 0.3.4-9); however: Package cm-super-minimal is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package cm-super (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-metapost: texlive-metapost depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-metapost (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of context: context depends on texlive-metapost (>= 2013); however: Package texlive-metapost is not configured yet. context depends on tex-common (>= 4); however: Package tex-common is not configured yet. dpkg: error processing package context (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of context-modules: context-modules depends on context (>> 2011); however: Package context is not configured yet. context-modules depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package context-modules (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-font-utils: texlive-font-utils depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package texlive-font-utils (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of texlive-extra-utils: texlive-extra-utils depends on tex-common (>= 3); however: Package tex-common is not configured yet. texlive-extra-utils depends on texlive-latex-base (>= 2013.20130512); however: Package texlive-latex-base is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-extra-utils (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of feynmf: feynmf depends on tex-common (>= 3); however: Package tex-common is not configured yet. feynmf depends on texlive-latex-base; however: Package texlive-latex-base is not configured yet. feynmf depends on texlive-font-utils; however: Package texlive-font-utils is not configured yet. feynmf depends on texlive-extra-utils; however: Package texlive-extra-utils is not configured yet. dpkg: error processing package feynmf (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of latex-xcolor: latex-xcolor depends on texlive-latex-recommended; however: Package texlive-latex-recommended is not configured yet. latex-xcolor depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package latex-xcolor (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of latex-beamer: latex-beamer depends on tex-common (>= 4); however: Package tex-common is not configured yet. latex-beamer depends on latex-xcolor (>= 2.00-1); however: Package latex-xcolor is not configured yet. latex-beamer depends on texlive-latex-base; however: Package texlive-latex-base is not configured yet. dpkg: error processing package latex-beamer (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of latex-cjk-common: latex-cjk-common depends on texlive-latex-base; however: Package texlive-latex-base is not configured yet. latex-cjk-common depends on texlive-font-utils (>= 2007.dfsg.2-1); however: Package texlive-font-utils is not configured yet. latex-cjk-common depends on tex-common (>= 4); however: Package tex-common is not configured yet. dpkg: error processing package latex-cjk-common (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of latex-cjk-chinese: latex-cjk-chinese depends on latex-cjk-common (= 4.8.3+git20120914-2ubuntu1); however: Package latex-cjk-common is not configured yet. latex-cjk-chinese depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package latex-cjk-chinese (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of latex-cjk-japanese: latex-cjk-japanese depends on latex-cjk-common (= 4.8.3+git20120914-2ubuntu1); however: Package latex-cjk-common is not configured yet. latex-cjk-japanese depends on tex-common (>= 4); however: Package tex-common is not configured yet. dpkg: error processing package latex-cjk-japanese (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached alreadydpkg: dependency problems prevent configuration of latex-cjk-korean: latex-cjk-korean depends on latex-cjk-common (>= 4.8.3+git20120914-2ubuntu1); however: Package latex-cjk-common is not configured yet. latex-cjk-korean depends on tex-common (>= 4); however: Package tex-common is not configured yet. dpkg: error processing package latex-cjk-korean (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached alreadydpkg: dependency problems prevent configuration of texlive-lang-other: texlive-lang-other depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package texlive-lang-other (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of latex-cjk-thai: latex-cjk-thai depends on latex-cjk-common (>= 4.8.3+git20120914-2ubuntu1); however: Package latex-cjk-common is not configured yet. latex-cjk-thai depends on texlive-latex-base; however: Package texlive-latex-base is not configured yet. latex-cjk-thai depends on tex-common (>= 4); however: Package tex-common is not configured yet. latex-cjk-thai depends on texlive-lang-other (>= 2013.20130523-1); however: Package texlive-lang-other is not configured yet. dpkg: error processing package latex-cjk-thai (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of latex-cjk-all: latex-cjk-all depends on latex-cjk-common (>= 4.8.3+git20120914-2ubuntu1); however: Package latex-cjk-common is not configured yet. latex-cjk-all depends on latex-cjk-chinese (>= 4.8.3+git20120914-2ubuntu1); however: Package latex-cjk-chinese is not configured yet. latex-cjk-all depends on latex-cjk-japanese (>= 4.8.3+git20120914-2ubuntu1); however: Package latex-cjk-japanese is not configured yet. latex-cjk-all depends on latex-cjk-korean (= 4.8.3+git20120914-2ubuntu1); however: Package latex-cjk-korean is not configured yet. latex-cjk-all depends on latex-cjk-thai (= 4.8.3+git20120914-2ubuntu1); however: Package latex-cjk-thai is not configured yet. dpkg: error processing package latex-cjk-all (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of latexmk: latexmk depends on texlive-latex-base; however: Package texlive-latex-base is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package latexmk (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached alreadydpkg: dependency problems prevent configuration of m-tx: m-tx depends on tex-common (>= 4); however: Package tex-common is not configured yet. dpkg: error processing package m-tx (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of musixtex: musixtex depends on tex-common (>= 4); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package musixtex (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of pmx: pmx depends on tex-common (>= 4); however: Package tex-common is not configured yet. pmx depends on texlive-latex-base; however: Package texlive-latex-base is not configured yet. dpkg: error processing package pmx (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of purifyeps: purifyeps depends on texlive-metapost; however: Package texlive-metapost is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package purifyeps (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-fonts-recommended: texlive-fonts-recommended depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-fonts-recommended (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of texlive: texlive depends on texlive-latex-recommended (>= 2013.20130512); however: Package texlive-latex-recommended is not configured yet. texlive depends on texlive-fonts-recommended (>= 2013.20130512); however: Package texlive-fonts-recommended is not configured yet. texlive depends on texlive-latex-base (>= 2013.20130512); however: Package texlive-latex-base is not configured yet. dpkg: error processing package texlive (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of texlive-bibtex-extra: texlive-bibtex-extra depends on tex-common (>= 3); however: Package tex-common is not configured yet. texlive-bibtex-extra depends on texlive-latex-base (>= 2013.20130512); however: Package texlive-latex-base is not configured yet. dpkg: error processing package texlive-bibtex-extra (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of texlive-fonts-extra: texlive-fonts-extra depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package texlive-fonts-extra (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-fonts-extra-doc: texlive-fonts-extra-doc depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-fonts-extra-doc (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-fonts-recommended-doc: texlive-fonts-recommended-doc depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-fonts-recommended-doc (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of texlive-formats-extra: texlive-formats-extra depends on tex-common (>= 3); however: Package tex-common is not configured yet. texlive-formats-extra depends on texlive-latex-base (>= 2013.20130512); however: Package texlive-latex-base is not configured yet. dpkg: error processing package texlive-formats-extra (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of texlive-lang-polish: texlive-lang-polish depends on texlive-latex-base (>= 2013.20130512); however: Package texlive-latex-base is not configured yet. texlive-lang-polish depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package texlive-lang-polish (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-generic-extra: texlive-generic-extra depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-generic-extra (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-lang-indic: texlive-lang-indic depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-lang-indic (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-lang-spanish: texlive-lang-spanish depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-lang-spanish (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of texlive-omega: texlive-omega depends on texlive-latex-base (>= 2013.20130512); however: Package texlive-latex-base is not configured yet. texlive-omega depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package texlive-omega (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of texlive-lang-cyrillic: texlive-lang-cyrillic depends on tex-common (>= 3); however: Package tex-common is not configured yet. texlive-lang-cyrillic depends on texlive-latex-base (>= 2013.20130512); however: Package texlive-latex-base is not configured yet. dpkg: error processing package texlive-lang-cyrillic (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-humanities-doc: texlive-humanities-doc depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-humanities-doc (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-lang-english: texlive-lang-english depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-lang-english (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of fragmaster: fragmaster depends on texlive-latex-base; however: Package texlive-latex-base is not configured yet. fragmaster depends on texlive-latex-recommended; however: Package texlive-latex-recommended is not configured yet. fragmaster depends on texlive-extra-utils; however: Package texlive-extra-utils is not configured yet. fragmaster depends on texlive-font-utils; however: Package texlive-font-utils is not configured yet. dpkg: error processing package fragmaster (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached alreadydpkg: dependency problems prevent configuration of texlive-latex-extra-doc: texlive-latex-extra-doc depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package texlive-latex-extra-doc (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-publishers-doc: texlive-publishers-doc depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-publishers-doc (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached alreadydpkg: dependency problems prevent configuration of texlive-lang-european: texlive-lang-european depends on tex-common (>= 3); however: Package tex-common is not configured yet. dpkg: error processing package texlive-lang-european (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-pictures-doc: texlive-pictures-doc depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-pictures-doc (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-metapost-doc: texlive-metapost-doc depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-metapost-doc (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of texlive-science-doc: texlive-science-doc depends on tex-common (>= 3); however: Package tex-common is not configured yet. No apport report written because MaxReports is reached already dpkg: error processing package texlive-science-doc (--configure): dependency problems - leaving unconfigured dpkg: too many errors, stopping No apport report written because MaxReports is reached already Errors were encountered while processing: tex-common latex-sanskrit texlive-latex-base texlive-generic-recommended texlive-pstricks asymptote texlive-latex-recommended cm-super-minimal cm-super texlive-metapost context context-modules texlive-font-utils texlive-extra-utils feynmf latex-xcolor latex-beamer latex-cjk-common latex-cjk-chinese latex-cjk-japanese latex-cjk-korean texlive-lang-other latex-cjk-thai latex-cjk-all latexmk m-tx musixtex pmx purifyeps texlive-fonts-recommended texlive texlive-bibtex-extra texlive-fonts-extra texlive-fonts-extra-doc texlive-fonts-recommended-doc texlive-formats-extra texlive-lang-polish texlive-generic-extra texlive-lang-indic texlive-lang-spanish texlive-omega texlive-lang-cyrillic texlive-humanities-doc texlive-lang-english fragmaster texlive-latex-extra-doc texlive-publishers-doc texlive-lang-european texlive-pictures-doc texlive-metapost-doc texlive-science-doc Processing was halted because there were too many errors. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ and the output of the command apt-cache policy tex-common is as follows :: tex-common: Installed: 4.04 Candidate: 4.04 Version table: * 4.04 0 500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages 100 /var/lib/dpkg/status @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
This appears to be Ubuntu bug #1236951. See the link for workarounds and the status of a fix.
many many dpkg errors while upgrading
1,399,366,660,000
I have a simple script that applies a patch to a given package, and, since each time said package is upgraded the patch gets overridden, I would really like to automatically apply the patch after every upgrade. To accomplish this, I created a file in /etc/apt/apt.conf.d/ and added a hook for DPkg::Post-Invoke. As documented by man apt-get, this hook is run by apt-get after installing a package with dpkg. However this hook does not seem to have any information whatsoever about which particular package has been installed, so I cannot know if I have to apply the patch or not. Nothing gets passed to its stdin, nothing gets passed as argument, and the man page says nothing about it. So to solve this I did the only thing that I could think of: I added another hook for DPkg::Pre-Install-Pkgs, which gets run by apt-get before packages are installed. This hook gets (through stdin) the list of .deb files which are going to be installd by dpkg, so I just check whether any file name matches the name of the package I want to patch, and if so I create a file in /tmp. When my other hook is executed, it first checks for the existence of said file and, if present, applies the patch to the package that has just been installed. Here's the file I've created in /etc/apt/apt.conf.d/: DPkg::Pre-Install-Pkgs { "while read -r pkg; do case $pkg in *somepkg*) touch /tmp/.patch && exit 0; esac done < /dev/stdin"; }; DPkg::Post-Invoke { "[ -f /tmp/.patch ] && /home/marco/scripts/apply_somepkg_patch.sh && rm -f /tmp/.patch; exit 0"; }; To be clear: the apply_somepkg_patch.sh simply edits the contents of a file provided by the package. I want said file to be upgraded and patched each time, I don't want to "lock" it so it doesn't get upgraded. Now, while this all works just fine, it looks really dirty and somehow wrong to me. Is there any cleaner way to accomplish this? Perhaps only using the DPkg::Post-Invoke hook? Or, in other words, is there a way to know which package got installed in the DPkg::Post-Invoke hook? EDIT: adding a detailed example of what I'm doing just to be 101% clear, even though I don't think it adds any more information to what I said above. Suppose somepkg is the package I'm talking about, and somefile is the file installed by such package which I want to patch. First installation of somepkg, content of somefile: some_opt1 = some_value some_opt2 = some_value some_opt3 = a, b, c, d some_opt4 = some_value Apply patch, changing it to: some_opt1 = some_value some_opt2 = some_value some_opt3 = X, Y, Z, d some_opt4 = some_value Upgrade of somepkg, contents somefile after upgrade: some_opt1 = some_value some_opt2 = some_value some_opt5 = some_value some_opt3 = a, b, c, d some_opt6 = some_value some_opt4 = some_value Apply patch, changing it to: some_opt1 = some_value some_opt2 = some_value some_opt5 = some_value some_opt3 = X, Y, Z, d some_opt6 = some_value some_opt4 = some_value Now, what's the somepackage, where somefile is, what's inside somefile: this is all completely irrelevant for my question. All you need to know is that I want to dynamically modify the contents of somefile, which is part of somepkg, after getting the upgraded version of the file. This obviously cannot be done statically: I need a script to read somefile, parse its content and patch it accordingly. Therefore, if I want my script to be automatically ran each time somepkg gets updated, I need to make apt-get run it automatically for me.
There’s no nice way to do this with apt or dpkg hooks of the style you’re currently using. There might be a simple way of handling such patches on upgrades for the specific package and file you’re modifying, but if you want a generic solution, I think the best approach in Debian currently is to use file triggers. This involves creating a (simple) package which will take care of patching the file on upgrades of the other package (the one containing the file you wish to patch). Your patching package needs to declare its interest in a file trigger; to do so, add a file named debian/triggers) containing the single line interest /path/to/the/file/to/patch Then in the package’s postinst (debian/postinst), check if the first argument is triggered, and if it is, run your patching script (or merge that in your postinst). If you want to keep your patching script separate, you could ship it in your patching package to keep things contained. Once all that’s done, build and install your patching package, and then whenever you upgrade the package you’re modifying, your patching package’s postinst will be called.
Cleaner way to detect if a particular package was installed in apt-get hook?
1,399,366,660,000
I was trying to build a simple Debian package, I did these steps with user root: First, I downloaded the upstream tarball, then: $ mv hithere-1.0.tar.gz hithere_1.0.orig.tar.gz Then: $ tar xf hithere_1.0.orig.tar.gz After that: $ cd hithere-1.0 $ dch --create -v 1.0-1 --package hithere $ cd debian/ $ rm *.ex *.EX Then I edited "control file" and "copyright file": $ nano control $ nano copyright $ cd .. $ debuild -S After the last command, This error was generated: root@mehrnaz-MS-A934:/home/fabdollahei/hithere-1.0# debuild -S dpkg-buildpackage -rfakeroot -d -us -uc -S dpkg-buildpackage: warning: using a gain-root-command while being root dpkg-buildpackage: source package hithere dpkg-buildpackage: source version 1.0-1 dpkg-buildpackage: source distribution unstable dpkg-buildpackage: source changed by root <[email protected]> dpkg-source --before-build hithere-1.0 dpkg-source: error: syntax error in hithere-1.0/debian/control at line 15: block lacks the 'Package' field dpkg-buildpackage: error: dpkg-source --before-build hithere-1.0 gave error exit status 255 dpkg-source: error: syntax error in hithere-1.0/debian/control at line 15: block lacks the 'Package' field dpkg-buildpackage: error: dpkg-source --before-build hithere-1.0 gave error exit status 255 debuild: fatal error at line 1364: dpkg-buildpackage -rfakeroot -d -us -uc -S failed How do I get rid of that fatal error?
The message is just saying that dpkg-buildpackage command failed. If you read the messages you will notice where's the problem right away: dpkg-source: error: syntax error in hithere-1.0/debian/control at line 15: block lacks the 'Package' field dpkg-buildpackage: error: dpkg-source --before-build hithere-1.0 gave error exit status 255 If you fix that (and maybe other problems it has, that could show up later) it should work.
what does "dpkg-buildpackage -rfakeroot -d -us -uc -S failed" mean?
1,399,366,660,000
I am on Linux Mint 19.3 and would like to make the TeamViewer systemd service only run when I launch the GUI app (/opt/teamviewer/tv_bin/script/teamviewer). On Windows, this is fairly easy to do from the Services dialog by selecting the TeamViewer and changing its "Startup Type" from "Automatic" to "Manual". In Linux, I have TeamViewer 15 (installed via deb file from official site). I am seeing that the systemd service file has: $ cat /etc/systemd/system/teamviewerd.service [Unit] Description = TeamViewer remote control daemon After = network.target network-online.target dbus.service Wants = network-online.target Requires = dbus.service [Service] Type = forking PIDFile = /var/run/teamviewerd.pid ExecStart = /opt/teamviewer/tv_bin/teamviewerd -d Restart = on-abort StartLimitInterval = 60 StartLimitBurst = 10 [Install] WantedBy = multi-user.target and the service autostarts during login which I don't want. I don't mind hacking out a new bash script to start the service just before launching the gui but I'm not great with editing systemd services and had a concern about new versions overwriting my changes. Questions: I could probably just remove the service file and use a bash wrapper script just before/after the gui process starts/ends vs just launching its 'ExecStart' args directly. BUT... seems like this could be bad if the gui process were to interface with the service process using systemd calls... If I were going to keep the systemd service file around for better compat, is there a way to configure the service file to still have the service enabled but NOT to run on startup but still allow it to be manually controlled via sudo systemctl [start|stop] teamviewerd ? Is there a way in apt to specify a post-install script for a particular package. (e.g. when apt etc installs a new version of teamviewer which presumably reinstalls the systemd service and *.desktop files, I would like to have it automatically run a script to "fix" those things). I saw this and this and get that I would need something like /etc/apt/apt.conf.d/custom-hooks with a path to a script but not seeing how to: a) pass a list of last installed packages or b) find out which packages were just installed by apt. Is there a more elegant way to do things than capturing a list in the PRE hook and then recapturing and checking for changes in the POST hook? Is there a more elegant approach that I have not considered?
Usually, the startup of installed daemons is controlled via systemctl [enable|disable] <service_name>. Note, that you can still start your disabled service manually with systemctl start <service_name>. But with Teamviewer it's different. Every time Teamviewer is updated, it overwrites the /etc/systemd/system/teamviewerd.service file and enables its service for startup. So the daemon will work even if you don't want to. I solve this issue by adding overrides to the service: systemctl stop teamviewerd.service mkdir -p /etc/systemd/system/teamviewerd.service.d cat >/etc/systemd/system/teamviewerd.service.d/override.conf <<EOF [Unit] ConditionPathExists=/tmp/allow_teamviewerd EOF systemctl daemon-reload Now, to start the daemon run the following: touch /tmp/allow_teamviewerd systemctl start teamviewerd.service rm /tmp/allow_teamviewerd And stop as usual: systemctl stop teamviewerd.service
How to make TeamViewer service be on-demand rather than always-on?
1,399,366,660,000
We are hosting a branch of the debian jessie repository with custom, backported and patched packages. Every product release an ISO installer is created from this repo. We now noticed that an upgrade between a release from a couple of months ago to the release of this month fails. The problem occurs thanks to a custom package which had an incorrect configuration file under /etc/sysctl.d/. This results in systemd (because of procps) configuration failure during the upgrade. The custom package has been fixed, but during an upgrade the configuration of this package happens after the configuration of systemd. A possiblity is to patch systemd and add our custom package as a dependency ... Another idea was to work with Replace/Conflicts in the debian/control file, but I cannot seem to find any documentation about the upgrade order. Does apt-get upgrade start by replacing packages and then continue by upgrading the other packages? Any other ideas how to get the custom package configured before systemd? (without installing it manually ourselves before starting the full upgrade)
So you have an old custom package which triggers an error when systemd is upgraded due to a bad configuration file. Given the order in which maintainer scripts are executed, the earliest time at which the new version of your package can intervene is the preinst upgrade step, which happens before the new package is unpacked, well before the postinst configure steps. You can make your new preinst upgrade repair the problematic file or move it out of the way, and use the postinst configure script to fix any lingering issue. This will only work if APT decides to upgrade your package and systemd in the same run. Depending on what else it has to do, I think APT could decide to fully upgrade systemd, then upgrade your package. You can avoid this by declaring a dependency from systemd to the new version of your package (Depends: will ensure that your postinst configure runs first. You should also declare a Breaks: relationship from systemd to the old version of your package; in fact I think Breaks: is how it would be done if everything involved was an official Debian package. The problem with that is that you'd have to modify the new systemd package (or the old version of your package, but it's too late for that).
How to influence order of package upgrade (apt-get upgrade/dist-upgrade)
1,399,366,660,000
Having difficulty re-installing Firefox, after an installation to resolve places.sqlite issues. It appears that I'm trapped in circular dependency hell. Need to resolve firefox dependency hell to attempt to resolve Tomcat6 project dependencies (don't ask), ASAP. Have been trying for hours. What I've done (brief) sudo apt-get purge firefox firefox-globalmenu firefox-gnome-support sudo apt-get update sudo apt-get install firefox firefox-globalmenu firefox-gnome-support sudo apt-get -f install Potential error sources: Found in sudo apt-get install firefox firefox-globalmenu firefox-gnome-support dpkg: error processing /var/cache/apt/archives/firefox_18.0~a2~hg20121027r113701-0ubuntu1~umd1~precise_amd64.deb (--unpack): trying to overwrite '/usr/lib/firefox/extensions', which is also in package mint-search-addon 2012.05.11 So, /usr/lib/firefox/extensions doesn't even EXIST! Deleted /var/cache/apt/archives/firefox_18.0~a2~hg20121027r113701 as per recommendations. Errors were encountered while processing: /var/cache/apt/archives/firefox_18.0~a2~hg20121027r113701-0ubuntu1~umd1~precise_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) Outputs: sudo apt-get purge firefox firefox-globalmenu firefox-gnome-support tyler@machine ~ $ sudo apt-get purge firefox firefox-globalmenu firefox-gnome-support [sudo] password for tyler: Reading package lists... Done Building dependency tree Reading state information... Done Package firefox is not installed, so not removed The following packages will be REMOVED: firefox-globalmenu* firefox-gnome-support* 0 upgraded, 0 newly installed, 2 to remove and 38 not upgraded. 2 not fully installed or removed. After this operation, 460 kB disk space will be freed. Do you want to continue [Y/n]? y (Reading database ... dpkg: warning: files list file for package `mysqltuner' missing, assuming package has no files currently installed. (Reading database ... 192642 files and directories currently installed.) Removing firefox-globalmenu ... Removing firefox-gnome-support ... tyler@machine ~ $ sudo apt-get install firefox firefox-globalmenu firefox-gnome-support tyler@machine ~ $ sudo apt-get install firefox firefox-globalmenu firefox-gnome-support Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: latex-xft-fonts The following NEW packages will be installed: firefox firefox-globalmenu firefox-gnome-support 0 upgraded, 3 newly installed, 0 to remove and 38 not upgraded. Need to get 0 B/24.8 MB of archives. After this operation, 54.3 MB of additional disk space will be used. (Reading database ... dpkg: warning: files list file for package `mysqltuner' missing, assuming package has no files currently installed. (Reading database ... 192619 files and directories currently installed.) Unpacking firefox (from .../firefox_18.0~a2~hg20121027r113701-0ubuntu1~umd1~precise_amd64.deb) ... dpkg: error processing /var/cache/apt/archives/firefox_18.0~a2~hg20121027r113701-0ubuntu1~umd1~precise_amd64.deb (--unpack): trying to overwrite '/usr/lib/firefox/extensions', which is also in package mint-search-addon 2012.05.11 Selecting previously unselected package firefox-globalmenu. Unpacking firefox-globalmenu (from .../firefox-globalmenu_18.0~a2~hg20121027r113701-0ubuntu1~umd1~precise_amd64.deb) ... Selecting previously unselected package firefox-gnome-support. Unpacking firefox-gnome-support (from .../firefox-gnome-support_18.0~a2~hg20121027r113701-0ubuntu1~umd1~precise_amd64.deb) ... Processing triggers for man-db ... Processing triggers for desktop-file-utils ... Processing triggers for bamfdaemon ... Rebuilding /usr/share/applications/bamf.index... Processing triggers for gnome-menus ... Processing triggers for mintsystem ... Errors were encountered while processing: /var/cache/apt/archives/firefox_18.0~a2~hg20121027r113701-0ubuntu1~umd1~precise_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) sudo apt-get -f install 0 upgraded, 0 newly installed, 0 to remove, and 38 not upgraded Ideas? Tomcat6 only deploys my web application successfully in Firefox, not Chrome, so I'm really hoping to resolve this dependency issue.
Seems like Firefox is trying to do something with /usr/lib/firefox/extensions, which is owned by mint-search-addon. The fact that the directory doesn't exist is not relevant, regarding dependencies. Do you have mint-search-addon installed? Is your system up to date? If both are true, try purging mint-search-addon.
Firefox circular-dependency hell on Linux Mint 13
1,399,366,660,000
I'm running a wheezy:armhf chroot using qemu user emulation on my jessie:x86_64 system. Somehow, a git clone on a particular private repository will hang inside the chroot, while succeed natively. This might be a bug, who knows? To improve my karma, I want to find out what's going on! As a side-note: the hang I'm experiencing is occurring with git-2.0 inside jessie:armel chroot as well... The hang does not occur inside a full-system-emulation. So I went on digging in the wheezy:armhf rabbithole, just because I had to choose one... I cannot test on a native machine... So. There is no git-dbg packet, I roll my own. Inside the wheezy:armhf chroot: sudo apt-get install build-essential fakeroot sudo apt-get build-dep git apt-get source git && cd git-1.7.10.4 DEB_CFLAGS_APPEND="-fno-stack-protector" DEB_CXXFLAGS_APPEND="-fno-stack-protector" DEB_BUILD_MAINT_OPTIONS=hardening=-stackprotector,-fortify DEB_BUILD_OPTIONS="noopt nostrip nocheck" fakeroot dpkg-buildpackage -j´getconf _NPROCESSORS_ONLN` sudo dpkg -i ../git_1.7.10.4-1+wheezy1_armhf.deb As far as I read the gcc-documentation, setting DEB_CFLAGS_APPEND and DEB_CXXFLAGS_APPEND additionally with -fno-stack-protector is not needed, but anyhow, want to be sure) Then, using qemu's builtin gdb_stub inside the chroot I'm doing: QEMU_GDB=1234 git clone /path/to/breaking/repo /tmp/bla Debugging inside the qemu throws an unsupported syscal 26 error. Firing up gdb-multiarch outside the chroot, to connect: gdb-multiarch -q (gdb) set architecture arm # prevents "warning: Architecture rejected target-supplied description" (gdb) target remote localhost:1234 (gdb) set sysroot /opt/chroots/wheezy:armhf (gdb) file /opt/chroots/wheezy:armhf/usr/bin/git Reading symbols from /opt/chroots/wheezy:armhf/usr/bin/git...done. # good! has debug symbols! (gdb) list # works! code is not stripped (gdb) step Cannot find bounds of current function # meh... (gdb) backtracke #0 0xf67e0c90 in ?? () #1 0x00000000 in ?? () # wtf? Giving a continue to let the clone happen will result in a hang, sending a ctrl-c is ignored. Generating a core-file and loading it into gdb (inside the chroot) will give me a corrupt stack: gdb -q /usr/bin/git qemu_git_20140514-160951_22373.core Reading symbols from /usr/bin/git...done. [New LWP 22373] Cannot access memory at address 0xf67fe948 Cannot access memory at address 0xf67fe944 (gdb) bt #0 0xf678b3e4 in ?? () #1 0xf678b3d4 in ?? () #2 0xf678b3d4 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?) Now I'm lost. Where is the problem? Did I miss some detail in the qemu-user-emulation? Do I have to use a completely emulated arm-machine? A misunderstanding in cross-debugging? gdb-multiarch limitations? The creation of debug-packages? Thanks for any suggestions, pointers, hints, tips, comments and what-not. My best guess in the moment is based on the fact that git does a clone (I can see two processes/threads), but the QEMU_GDB environment variable is unset by qemu after using. Hence only the initial process is going to gdb. See here for example. But still: I should be able to properly debug the parent process? I can easily cross-debug a hello-world MWE.
Turns out that this particular hang of "git clone" is a qemu-related problem... Other problems in the qemu-user-emulation prevail, so I have to fall back to full-system emulation... ;-( Using a qemu-user-static, compiled from their git (the qemu-2.0.0+dfsg-4+b1 currently in jessie has less fixes and won't work for my case...): git clone git://git.qemu-project.org/qemu.git $HOME/qemu.git && cd $HOME/qemu.git ./configure --static --disable-system --target-list=arm-linux-user --prefix=$HOME/qemu.install --disable-libssh2 make && make install sudo cp $HOME/qemu.install/bin/qemu-arm /opt/chroots/wheezy:armhf/usr/bin/qemu-arm-static so... However, I'm still not able to get backtrace of complex programs...
Backtrace of "git clone" running inside qemu-user-emulation based arm-chroot
1,399,366,660,000
It is not about the common download & 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!
If you're running a reasonably recent version of Debian or other distribution using apt, you can use apt-get for this. Put the following settings in a file called apt-get.conf to make it not use Dir::Etc::main "."; Dir::Etc::Parts "./apt.conf.d"; Dir::Etc::sourcelist "./sources.list"; Dir::Etc::sourceparts "./sources.list.d"; Dir::State "./apt-tmp"; Dir::State::status "./apt-tmp/status"; Dir::Cache "./apt-tmp"; Prepare some necessary files: mkdir -p apt-tmp/lists/partial touch apt-tmp/status apt-get -c apt.conf update >/dev/null Then you can download packages to the current directory with apt-get -c apt.conf download $packages With old versions of apt-get that lack the download command, you can use apt-get -c apt.conf install -d $packages to download packages and their dependencies into apt-tmp/archives.
How to download packages from a command-line given repository?
1,399,366,660,000
I am trying to remove Dropbox from my computer. So far I have done the following: sudo aptitude remove dropbox sudo aptitude purge dropbox But this didn't get rid of it 100% oshiro@debian:~$ locate dropbox /usr/share/nmap/scripts/broadcast-dropbox-listener.nse /var/cache/apt/archives/dropbox_1.6.1_i386.deb /var/lib/apt/lists/linux.dropbox.com_debian_dists_wheezy_Release /var/lib/apt/lists/linux.dropbox.com_debian_dists_wheezy_Release.gpg /var/lib/apt/lists/linux.dropbox.com_debian_dists_wheezy_main_binary-i386_Packages oshiro@debian:~$ I know I can delete each of those manually, but wanted to know if that is the correct way of removing a .deb installed application?
You have already completely removed Dropbox from your computer, at least in ways that manifest themselves by a file whose name contains dropbox. You may have other traces of your use of Dropbox remaining, for example in your browser history. When it comes to file names, check Dropbox as well (locate -i dropbox will do it). None of the files you list are caused by even a partial installation of Dropbox. /usr/share/nmap/scripts/broadcast-dropbox-listener.nse is part of nmap. It's the component that allows nmap to recognize a Dropbox server on the machine that it's scanning. It is completely unrelated to your use of Dropbox. /var/cache/apt/archives/dropbox_1.6.1_i386.deb is the Debian package file for Dropbox. It is in the cache of downloaded package files. You can remove it manually or call apt-get clean (or the corresponding command in another APT frontend) to empty the cache. The files in /var/lib/apt/lists are available package sources from linux.dropbox.com. These lists are updated by apt-get update (or the corresponding command in another APT frontend). To get rid of this file (which you don't need any more if you aren't going to reinstall Dropbox), edit /etc/apt/sources.list or a file in /etc/apt/sources.list.d and remove the line(s) that mention linux.dropbox.com, then run apt-get update.
How to remove Dropbox
1,399,366,660,000
So, for now, let's say we only need this to work for debian-based systems (but I will need to be able to do it for yum in the future). The best I have right now is dpkg-query. So, for example, if I run this: dpkg-query --show I'll get a list like this (with a few thousand entries): ... sudo 1.8.17p1-2 ... vim 2:7.4.1829-1 ... There is no naming convention though. Some of the packages have the version number in them, some of them have the architecture. ex gcc-4.9-base:amd64, but what I want would only have gcc 4.9. Ideally, I would like to be able to get vendor, product, and version information for all of the software installed. Is there any way to do this natively, or does it have to be some kind of "fuzzy" match? I'm open to alternative ways of querying the package manager, or some other method that I am not thinking of. I am not able to install additional packages to accomplish this goal (though, I would be interested to see how they work if that exists).
This will list the source packages and versions corresponding to the installed binary packages: dpkg-query --show -f '${source:Package} ${source:Version}\n' | sort -u This is the closest match to individual pieces of software you can get automatically: you'll only see gcc-4.9 once, with the associated version, instead of all the corresponding binary packages. You can't easily retrieve "vendor" information, you'd need to look at the package details (apt-cache show ...) or the licensing information (in /usr/share/doc/<package>/copyright — it should point to the "upstream" project, i.e. the "vendor"); this isn't guaranteed to be in machine-readable format so there will be some human parsing involved. You'll still find some source packages whose name contains the (major) version, e.g. gcc-4.9, gcc-5 etc.; these are unavoidable when packages are designed so that major versions are co-installable, as is the case for GCC. The equivalent RPM command is rpm --qf "%{SOURCERPM}\n" -qa | sort -u
What's the most robust way to list installed software in debian based distros?
1,399,366,660,000
Given a random .DEB file, how do we check if installation will be successfully completed without actually installation on device? Please see the following snippet: root@VirtualBox:/Folder# dpkg -i mysql-workbench_6.2.3+dfsg-7_armhf.deb Selecting previously unselected package mysql-workbench. (Reading database ... 48937 files and directories currently installed.) Preparing to unpack mysql-workbench_6.2.3+dfsg-7_armhf.deb ... Unpacking mysql-workbench (6.2.3+dfsg-7) ... dpkg: dependency problems prevent configuration of mysql-workbench: mysql-workbench depends on libatkmm-1.6-1 (>= 2.22.1); however: Package libatkmm-1.6-1 is not installed. mysql-workbench depends on libcairo2 (>= 1.14.0); however: Package libcairo2 is not installed. mysql-workbench depends on libcairomm-1.0-1 (>= 1.6.4); however: Package libcairomm-1.0-1 is not installed. mysql-workbench depends on libctemplate2; however: Package libctemplate2 is not installed. mysql-workbench depends on libgdal1h (>= 1.8.0); however: Package libgdal1h is not installed. mysql-workbench depends on libgdk-pixbuf2.0-0 (>= 2.22.0); however: Package libgdk-pixbuf2.0-0 is not installed. mysql-workbench depends on libgl1-mesa-glx | libgl1; however: Package libgl1-mesa-glx is not installed. Package libgl1 is not installed. mysql-workbench depends on libglibmm-2.4-1c2a (>= 2.42.0); however: Package libglibmm-2.4-1c2a is not installed. mysql-workbench depends on libgnome-keyring0 (>= 2.22.2); however: Package l dpkg: error processing package mysql-workbench (--install): dependency problems - leaving unconfigured Processing triggers for mime-support (3.58) ... Processing triggers for shared-mime-info (1.3-1) ... Errors were encountered while processing: mysql-workbench root@VirtualBox:/Folder# echo $? 1 root@VirtualBox:/Folder# dpkg --dry-run -i mysql-workbench_6.2.3+dfsg-7_armhf.deb (Reading database ... 49115 files and directories currently installed.) Preparing to unpack mysql-workbench_6.2.3+dfsg-7_armhf.deb ... root@VirtualBox:/Folder# echo $? 0 root@VirtualBox:/Folder# dpkg --dry-run --simulate -i mysql-workbench_6.2.3+dfsg-7_armhf.deb (Reading database ... 49115 files and directories currently installed.) Preparing to unpack mysql-workbench_6.2.3+dfsg-7_armhf.deb ... root@VirtualBox:/Folder# echo $? 0 root@VirtualBox:/Folder# When I use the dpkg -i option, the command fails with a return value of 1, but the same command as a --dry-run returns zero. Adding the --simulate option also doesn't seem to change behaviour. Any pointers on how to consistently check if installation of a .DEB file will go through properly, without actually installing the package? I am running this on a Raspberry Pi emulator. root@VirtualBox:/Folder# cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)" NAME="Raspbian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
To determine whether a package can be installed without needing other dependencies to be installed too, your best bet is to use the “simulate” mode with apt: apt -s install ./mysql-workbench_6.2.3+dfsg-7_armhf.deb (note the ./ which is significant). This will output the dpkg operations which would be performed by the real installation. Package installations are marked with Inst; if there’s more than one of these, the package can’t be installed on its own. Now, on to the meaty part... You can’t use dpkg for this, not because dpkg doesn’t know about dependencies (it most definitely does), but because dependencies aren’t strong enough. When a package depends on another, the dependency doesn’t prevent the package from being installed if it’s not satisfied, it prevents it from being configured. See section 7.2 of Debian Policy: A Depends field takes effect only when a package is to be configured. It does not prevent a package being on the system in an unconfigured state while its dependencies are unsatisfied, and it is possible to replace a package whose dependencies are satisfied and which is properly installed with a different version whose dependencies are not and cannot be satisfied; when this is done the depending package will be left unconfigured (since attempts to configure it will give errors) and will not function properly. You can see this in your own test: the process fails with dpkg: dependency problems prevent configuration of mysql-workbench Note “configuration”, not “installation”. If you look at the output of dpkg -l mysql-workbench, you should see iU, which means the package is installed but not configured. When you enable “simulate” mode in dpkg, it basically runs in read-only mode. It does this by setting a f_noact flag; you can look for this in the source code. When installing packages, simulation goes through the installation motions (without writing anything), and proceeds to the configuration phase; but that just fakes success, which is the only thing that a simulation can do — configuration involves running maintainer scripts in the package, and it would be difficult to ensure that those scripts didn’t make changes, or ensure that their success could be determined without allowing them to make changes. So in your case, the simulation installs the package, which succeeds (as in your non-simulated test), and fakes the configuration. Thus no error is detected...
dpkg --dry-run option is not simulating installation properly
1,399,366,660,000
I am trying to understand how APT works, and here is where I got stuck - who determines what packages are installed, on day-one? It seems that one of the rules is, based on the current snapshot of the system, apt upgrade will install up to the Recommended dependencies of the installed packages. So, from a minimum set of 'core' packages and some 'higher-level' packages, apt upgrade/dist-upgrade should be able to grow and fill the blanks. Questions are: Is there a standard list of default packages? (Debian FAQ says a default installation includes packages with priority equal or higher than Standard. Does that define the standard list?) Is this configurable or hard coded into apt? Is there a way to go back to this standard list? meaning a single command to reverse all manual installs/uninstalls and their dependencies? Does this standard package list depend on my local hardware setup, aside from architecture? (e.g., what video card I have.) Which config file tells apt to install Recommended packages? Suppose sometime after my fresh install, a package with Standard priority is added to a repository included in my sources.list file. Will that package be installed on my box next time I run apt update && apt upgrade?
See Is there any "base" Debian metapackage? It’s embedded in the Debian installer and the tools it uses (tasksel in particular). The installer installs the essential packages and their dependencies, and tasksel installs the standard-priority packages if the corresponding task is selected. See Is there a command that outputs ONLY the packages explicitly installed by the user? (ubuntu/debian) No. It’s the default, and can be configured in the APT configuration files under /etc/apt or modified using a command-line option (see Why install-recommends default is true? for details). No, you’d have to run tasksel again.
Debian default installation package list?
1,399,366,660,000
I'm trying to recover from a faulty installation, and want to remove some packages. But I can't. # apt autoremove offending-package dpkg: warning: 'start-stop-daemon' not found in PATH or not executable (My PATH is fine.) According to packages.debian.org, start-stop-daemon should be in /sbin/. It isn't there! What should I do?
Another way to do this is first create a dummy /usr/local/sbin/start-stop-daemon that does nothing:#!/bin/sh exec true then simply reinstall the dpkg package:aptitude reinstall dpkg then (of course) remove the dummy /usr/local/sbin/start-stop-daemon. Installing the dpkg package does not in fact require start-stop-daemon at any point. It is simply the case that the dpkg command, that is run to reinstall its own package, checks that start-stop-daemon is on the command search path in case a package installation/deinstallation script happens to use it.
Debian Stretch - where did start-stop-daemon go, and how do I get it back?
1,399,366,660,000
All logs of dpkg are saved at /var/log/dpkg . The thing is if you are on Debian testing or/and Unstable/Sid the churn of packages are going to be much more than in a stable release. Now while in a stable release the churn is not so much and 7-8 log files should be in a position to serve . But in testing this simply proves to be too little. For instance at my own end - ┌─[shirish@debian] - [~] - [10114] └─[$] zgrep " install " /var/log/dpkg.log.8.gz | tail -1 2016-05-31 12:26:29 install gnuplot-qt:amd64 <none> 4.6.6-3 Now while this is somewhat useful, if I want to go back till a year, all of that info. is lost. How can I prevent it from happening in the future ? It would be better if the change were only limited to dpkg logs rather than all the logs.
You edit the file /etc/logrotate.d/dpkg, there should be a section there similar to this : /var/log/dpkg.log { monthly rotate 12 compress delaycompress missingok notifempty create 644 root root } You change the rotate 12 to rotate 24 to keep 2 years of logs, or rotate 36 to keep 3 years of logs.
Is there a way to have past logs for 1-2 years in dpkg?
1,399,366,660,000
I've been trying to install Percona Toolkit onto my Debian (wheezy) server. I downloaded it as per the instructions: wget percona.com/get/percona-toolkit.deb then installed it sudo dpkg -i percona-toolkit.deb But it told me there were missing dependencies that weren't installed, and wouldn't be installed. I have been downloading these one by one, but each one seems to have a missing dependency of it's own. I've also noticed that most of these are installed, but the toolkit requires a later version. In one case the only version I could find suggested it was designed for the next release of Debian. So far I have downloaded: libio-socket-ssl-perl_2.002-2_all.deb libnet-ssleay-perl_1.65-1+b1_amd64.deb libterm-readkey-perl_2.30-4+b2_amd64.deb and now it wants perl (>= 5.20.0-4) perlapi-5.20.0 libc6 (>= 2.14) Is there an easy way to get the system to download / install all of these in one go, and is it likely to cause stability issues if I install versions higher than the default that are already installed? UPDATE - output from apt-get -f install: sudo apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following packages will be REMOVED: libio-socket-ssl-perl libnet-ssleay-perl percona-toolkit 0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. 3 not fully installed or removed. After this operation, 7,319 kB disk space will be freed. Do you want to continue [Y/n]? y (Reading database ... 26051 files and directories currently installed.) Removing percona-toolkit ... Removing libio-socket-ssl-perl ... Removing libnet-ssleay-perl ... Processing triggers for man-db ...
First try installing by which will fail. dpkg -i percona-toolkit.deb Then do following to install and fix the missing dependencies. apt-get install --fix-missing -f Then try again to install the .deb package dpkg -i percona-toolkit.deb
Debian - get all dependencies updated when they 'wont be installed'
1,399,366,660,000
I'm "upgrading" to a new distro (from Linux Mint 15 -> 16) by performing a fresh installation to a new drive, and referencing my original drive as needed. I've currently booted to my new installation (Linux Mint 16), and I've mounted my original drive (Linux Mint 15), so I can access all the raw data just fine. It'd be convenient if I could see the packages that I had installed previously without the (admittedly minor) hassle of swapping my cables and rebooting back and forth. Basically I'm looking for an alternative to dpkg --get-selections (or apt equivalents, etc) that I can use on a non-running drive, such as a raw file location where this info may be stored. (Edit: By "non-running" I mean that it is attached and running, but was not booted, and is mounted on /mnt/old or some such.) Is this a Thing That Can Be Done?
Assume you mean with non-running that it is attached and running, but was not booted, and mounted on /mnt/old: dpkg --root=/mnt/old --get-selections should work. You can also boot the old partitions once and redirect the output of dpkg --get-selections to a file ones and read from that.
is it possible to determine installed packages on a secondary mounted drive?
1,399,366,660,000
My Linux Mint 15 broke and there seems to be no way to fix it. I cannot boot it so I haven't got access to the terminal. What I'm going to do is make a backup of /home with a flash disk running Mint (done that) and reinstall Mint -> restoring /home, but I'd like to get a list of installed programs so I can reinstall them. I know: dpkg --get-selections exists, but that requires running the program from within the system, which I can't do because I can't boot it. Is there any way to get the list or send the command from the Mint from the flash disk?
/var/log/dpkg.log* You could also just mount the parition that contains root (/) and copy the files /var/log/dpkg.log*. These files will contain all the applications that were installed on your system. Just grep through the files looking for the word "installed": $ grep " installed" dpkg.log*|tail -5 dpkg.log.1:2013-09-06 21:29:36 status installed libopenipmi0:amd64 2.0.18-0ubuntu4 dpkg.log.1:2013-09-06 21:29:36 status installed openipmi:amd64 2.0.18-0ubuntu4 dpkg.log.1:2013-09-06 21:29:36 status installed ipmitool:amd64 1.8.11-5ubuntu1 dpkg.log.1:2013-09-06 21:29:36 status installed ureadahead:amd64 0.100.0-12build1 dpkg.log.1:2013-09-06 21:29:37 status installed libc-bin:amd64 2.15-0ubuntu20 You can filter this output down to the actual package name + version: $ grep " installed" dpkg.log*|awk '{print $5, $6}'|head -5 man-db:amd64 2.6.3-1 ureadahead:amd64 0.100.0-12build1 bamfdaemon:amd64 0.3.4-0ubuntu1 desktop-file-utils:amd64 0.20-0.1ubuntu1 gnome-menus:amd64 3.6.0-0ubuntu1 dpkg .list files Also you can get the list of .list files, which are the names of the packages installed: $ ls -l /var/lib/dpkg/info/*.list | head -5 -rw-r--r-- 1 root root 628 Oct 17 2012 /var/lib/dpkg/info/account-plugin-aim.list -rw-r--r-- 1 root root 868 Oct 6 02:44 /var/lib/dpkg/info/account-plugin-facebook.list -rw-r--r-- 1 root root 802 Oct 6 02:44 /var/lib/dpkg/info/account-plugin-flickr.list -rw-r--r-- 1 root root 840 Oct 6 02:44 /var/lib/dpkg/info/account-plugin-google.list -rw-r--r-- 1 root root 936 Oct 6 02:44 /var/lib/dpkg/info/account-plugin-icons.list To show all the installed applications just remove | head -5 which shows the first 5 results.
List of installed programs without running a program in the system
1,363,800,322,000
(similar to the question Uninstalling default VBoxGuestAdditions on Debian but a Ubuntu install, and the solution there isn't working for me?) and really the issue seems to be with dpkg/apt-get not virtualbox or its linux guest additions: host:/media/VBOXADDITIONS_4.2.10_84104$ dpkg -l | grep virtualbox rc virtualbox-guest-utils 4.1.12-dfsg-2ubuntu0.2 x86 virtualization solution - non-X11 guest utilities rc virtualbox-guest-x11 4.1.12-dfsg-2ubuntu0.2 x86 virtualization solution - X11 guest utilities host:/media/VBOXADDITIONS_4.2.10_84104$ sudo apt-get remove virtualbox-guest-utils virtualbox-guest-x11 Reading package lists... Done Building dependency tree Reading state information... Done Package virtualbox-guest-utils is not installed, so not removed Package virtualbox-guest-x11 is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded. host:/media/VBOXADDITIONS_4.2.10_84104$ sudo sh ./VBoxLinuxAdditions.run Verifying archive integrity... All good. Uncompressing VirtualBox 4.2.10 Guest Additions for Linux.......... VirtualBox Guest Additions installer You appear to have a version of the VBoxGuestAdditions software on your system which was installed from a different source or using a different type of installer. If you installed it from a package from your Linux distribution or if it is a default part of the system then we strongly recommend that you cancel this installation and remove it properly before installing this version. If this is simply an older or a damaged installation you may safely proceed. Do you wish to continue anyway? [yes or no] no Cancelling installation. so dpkg sees the virtualbox-guest-utils and virtualbox-guest-x11 but apt-get can't remove them?!
rc virtualbox-guest-utils 4.1.12-dfsg-2ubuntu0.2 The first two flags in this output tell you exactly what is going on: The 'r' means the package is in remove state. It's still technically installed, but most of it is actually gone. The 'c' means that the configuration files are still installed. Read man dpkg-query for more information if you're interested. This state (rc) is common - pretty much any time you remove a package with configuration files, it'll end up in this state. To fix it, use the --purge option to either dpkg or apt-get remove to clean these entries up.
dpkg sees them, but apt-get can't remove them?
1,363,800,322,000
I had put up a query before, and then wanted to put leafpad in editor list but wasn't able. [$] sudo update-alternatives --set editor /usr/bin/leafpad update-alternatives: error: alternative /usr/bin/leafpad for editor not registered; not setting Having a look-see saw this list - └─[$] sudo update-alternatives --config editor There are 8 choices for the alternative editor (providing /usr/bin/editor). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/le 60 auto mode 1 /bin/ed -100 manual mode 2 /bin/nano 40 manual mode 3 /usr/bin/emacs24 0 manual mode 4 /usr/bin/le 60 manual mode 5 /usr/bin/ne 20 manual mode 6 /usr/bin/nedit 40 manual mode 7 /usr/bin/vim.basic 30 manual mode 8 /usr/bin/vim.tiny 15 manual mode Press <enter> to keep the current choice[*], or type selection number: ^C Have no idea why leafpad can't be registered as a valid editor. If you do get dumped to console and can't use graphical editor for whatever reason, you could always run sudo update-alternatves --config editor and fix the same. Is this a bug or something that needs to be fixed either at leafpad or at update-alternatives/dpkg side ?
The syntax is usually update-alternatives --install link name path priority (plus a few optional arguments that I omitted). So you could do like this: update-alternatives --install /usr/bin/editor editor /usr/bin/leafpad 0 Then you can re-run that same command and choose leafpad to be your editor. In my example I gave it a priority of zero. You can choose something different. It only affects when the alternative goes to automatic mode. Don't give Leafpad a high priority, though. You don't want a graphical editor being the default choice in case anything goes wrong and the package is automatically reconfigured.
Putting a new/graphical editor in editor list
1,363,800,322,000
I recently ran a command to install a package on Ubuntu 16.04 with apt-get % sudo apt-get install <package> apt-get was unable to install, it printed some status messages, with the last line being: [ output truncated... ] E: Unable to correct problems, you have held broken packages. I understand that apt and dpkg has a system of marking packages, where you can denote a preference regarding a package's install status. you can view this list with dpkg -l So all packages in the resulting list whose status is "desired" or "install me" could be used to recreate the install state of applications on another system. Does held broken packages have something to do with this? i.e. my packages install preferences as shown by dpkg -l express a state of packages such that if apt-get were to install them - the end result would have dependency conflicts? What does it mean to have held broken packages?
That message indicates that apt didn't changed anything and the broken packages it tried to solve were kept in the same state. In this case "held" is used as "keep". If I had to reword it it would say: Unable to correct the problems, packages are left unchanged.
What does the apt-get message "held broken packages" mean?
1,363,800,322,000
From man dpkg (1.16.16 (i386) on a Debian (7) based Linux Distro): --status-fd n Send machine-readable package status and progress information to file descriptor n I read this as: "forward machine readable code, such as with generated through printf to a file descriptor". I (think) to know the file descriptors stdin (0), stdout (1), and stderr (2). Trying to look up some examples I found next to nothing but bug reports, with file descriptors partly consisting of two digits (possibly more…). This extended my knowledge about file descriptors, which lead to more questions. Thus: Question: How is dpkg option --status-fdused? An actual example and a some notes of what happens would help me a lot in understanding
The option --status-fd tells dpkg to report the progress in a way that other programs can parse, for example to present nice progress reports to the user in a GUI. The argument to --status-fd is a file descriptor, i.e. number that designates an open file. Simplifying things a bit: When a process opens a file for the first time, that file gets assigned descriptor number 0. The next time, the file is assigned descriptor number 1, and so on. The open system call returns the file descriptor. When the process wants to perform an operation on the file, such as reading or writing from it, it designates the file by its descriptor, e.g. read(0, addr, 10) means “read 10 bytes from descriptor 0 and put them at memory address addr”. Each process has its own file descriptors: file descriptor n in process p bears no relation with file descriptor n in process q. Processes inherit their parent's file descriptors when they are created. By convention, processes are executed with file descriptors 0, 1 and 2 already open. 0 is to be used for input, 1 for normal output and 2 for error messages. Redirection opens a file on a particular descriptor. For example, in a shell script or on the command line, mycommand <somefile connects file descriptor number 0 (standard input) so somefile (which is opened for reading) instead of whatever it was before (the terminal, if the command is executed in a terminal). You can prepend a descriptor number to the redirection operator: mycommand 3<somefile connects file descriptor number 3 to somefile (most commands won't do anything with that file descriptor). When dpkg is installing, upgrading or removing packages, it executes various other commands in the packages' pre/post install/removal scripts. Some of these commands may read input or display messages, so dpkg keeps the standard descriptors connected to whatever they were connected to when it was invoked. Since the standard file descriptors are already taken, dpkg allows the caller to specify a different one for the status reports. You could put the status reports in a file, for example: dpkg --status-fd 3 -i somefile.deb 3>/tmp/dpkg.status In another terminal, run tail -n +1 -f /tmp/dpkg.status and watch the status messages coming. Often the front-end that calls dpkg and wants status reports will open a pipe (a unidirectional communication channel) before it runs dpkg, and pass the file descriptor to write end of the pipe as the argument of --status-fd. The front-end then reads from the read end of the pipe and gets status messages as they are produced, without risking them getting mixed up with anything else.
understanding "dpkg --status-fd n"
1,363,800,322,000
When I remove packages from my system with APT-based programs, they often leave behind some kind of residue (referred to as "residual config") that seems to serve no purpose other than annoying me. Cleaning these is normally quite trivial: just purge them in Synaptic or run aptitude purge '?config-files'. Some packages are more persistent. Purging them with Synaptic returns the message "ignoring request to remove [package] which is not installed" and Aptitude does likewise, also using the words "not installed". I want a way to remove these unusually persistent packages. Specific examples of this behavior: a previous Ubuntu setup did this with fglrx and fglrx-updates, depending on with one I had installed. My current Mint 14 install is doing it with libav-tools, which I replaced with ffmpeg from the official Launchpad PPA. I think that I have had this problem with other packages too, but I don't remember specifically. I don't know what they have in common, unless they share a bug in the package design and their maintainers just need to use lintian. Bonus points for a solution that uses Synaptic.
Okay, I was able to find my own solution (ironically) because Gilles wasn't explaining himself properly and making me research his cryptic comments. Step 1: use dpkg -L $package or Synaptic's Properties dialog to find the file that didn't get purged with the rest of the package. I don't know why a file might not be purged properly, but that's what causes this problem. In my case it was /etc/avserver.conf. Step 2: install the offending package. This way the package manager will think it fixed the problem itself. Step 3: run sudo rm $offendingfile to delete the file that the package manager doesn't want to. Step 4: purge the package again. All package managers will recognize that nothing remains, because everything really is gone this time. Except for that one rm, this works with Synaptic, so I can give myself those bonus points.
How do I remove persistent config data from APT?
1,363,800,322,000
I am testing out the build of a .deb package on different distributions using test-kitchen. The built .deb file installs the command to /usr/bin fine on both Debian and Ubuntu. My problem is that the man pages don't get installed on Ubuntu. The contents of the built .deb file on Ubuntu is: kitchen@ceddd8d3564c:/opt/workspace$ dpkg -c $(find . -name \*.deb) drwxr-xr-x 0/0 0 2018-06-08 14:24 ./ drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/ drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/bin/ -rwxr-xr-x 0/0 33742 2018-06-08 14:24 ./usr/bin/git-secret drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/share/ drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/share/man/ drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/share/man/man7/ -rw-r--r-- 0/0 5298 2018-06-08 14:24 ./usr/share/man/man7/git-secret.7 drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/share/man/man1/ -rw-r--r-- 0/0 1355 2018-06-08 14:24 ./usr/share/man/man1/git-secret-add.1 -rw-r--r-- 0/0 819 2018-06-08 14:24 ./usr/share/man/man1/git-secret-init.1 -rw-r--r-- 0/0 1440 2018-06-08 14:24 ./usr/share/man/man1/git-secret-hide.1 -rw-r--r-- 0/0 1734 2018-06-08 14:24 ./usr/share/man/man1/git-secret-tell.1 -rw-r--r-- 0/0 931 2018-06-08 14:24 ./usr/share/man/man1/git-secret-clean.1 -rw-r--r-- 0/0 936 2018-06-08 14:24 ./usr/share/man/man1/git-secret-remove.1 -rw-r--r-- 0/0 959 2018-06-08 14:24 ./usr/share/man/man1/git-secret-list.1 -rw-r--r-- 0/0 1246 2018-06-08 14:24 ./usr/share/man/man1/git-secret-cat.1 -rw-r--r-- 0/0 843 2018-06-08 14:24 ./usr/share/man/man1/git-secret-usage.1 -rw-r--r-- 0/0 1337 2018-06-08 14:24 ./usr/share/man/man1/git-secret-reveal.1 -rw-r--r-- 0/0 1445 2018-06-08 14:24 ./usr/share/man/man1/git-secret-changes.1 -rw-r--r-- 0/0 998 2018-06-08 14:24 ./usr/share/man/man1/git-secret-killperson.1 -rw-r--r-- 0/0 940 2018-06-08 14:24 ./usr/share/man/man1/git-secret-whoknows.1 drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/share/doc/ drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/share/doc/git-secret/ -rw-r--r-- 0/0 149 2018-06-08 14:24 ./usr/share/doc/git-secret/changelog.gz kitchen@ceddd8d3564c:/opt/workspace$ The install command is sudo dpkg --force-all --install $(find . -name \*.deb) which outputs: (Reading database ... 41209 files and directories currently installed.) Preparing to unpack .../git-secret_0.2.4_all.deb ... Unpacking git-secret (0.2.4) over (0.2.4) ... Setting up git-secret (0.2.4) ... Processing triggers for man-db (2.8.3-2) ... After that the man git-secret and man git-secret-init report "No manual entry for git-secret-init". Things are working on Debian latest with the same package: kitchen@c71479c4f76c:/opt/workspace$ dpkg -c $(find . -name \*.deb) drwxr-xr-x 0/0 0 2018-06-08 14:24 ./ drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/ drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/bin/ -rwxr-xr-x 0/0 33742 2018-06-08 14:24 ./usr/bin/git-secret drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/share/ drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/share/man/ drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/share/man/man7/ -rw-r--r-- 0/0 5298 2018-06-08 14:24 ./usr/share/man/man7/git-secret.7 drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/share/man/man1/ -rw-r--r-- 0/0 1355 2018-06-08 14:24 ./usr/share/man/man1/git-secret-add.1 -rw-r--r-- 0/0 819 2018-06-08 14:24 ./usr/share/man/man1/git-secret-init.1 -rw-r--r-- 0/0 1440 2018-06-08 14:24 ./usr/share/man/man1/git-secret-hide.1 -rw-r--r-- 0/0 1734 2018-06-08 14:24 ./usr/share/man/man1/git-secret-tell.1 -rw-r--r-- 0/0 931 2018-06-08 14:24 ./usr/share/man/man1/git-secret-clean.1 -rw-r--r-- 0/0 936 2018-06-08 14:24 ./usr/share/man/man1/git-secret-remove.1 -rw-r--r-- 0/0 959 2018-06-08 14:24 ./usr/share/man/man1/git-secret-list.1 -rw-r--r-- 0/0 1246 2018-06-08 14:24 ./usr/share/man/man1/git-secret-cat.1 -rw-r--r-- 0/0 843 2018-06-08 14:24 ./usr/share/man/man1/git-secret-usage.1 -rw-r--r-- 0/0 1337 2018-06-08 14:24 ./usr/share/man/man1/git-secret-reveal.1 -rw-r--r-- 0/0 1445 2018-06-08 14:24 ./usr/share/man/man1/git-secret-changes.1 -rw-r--r-- 0/0 998 2018-06-08 14:24 ./usr/share/man/man1/git-secret-killperson.1 -rw-r--r-- 0/0 940 2018-06-08 14:24 ./usr/share/man/man1/git-secret-whoknows.1 drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/share/doc/ drwxr-xr-x 0/0 0 2018-06-08 14:24 ./usr/share/doc/git-secret/ -rw-r--r-- 0/0 149 2018-06-08 14:24 ./usr/share/doc/git-secret/changelog.gz kitchen@c71479c4f76c:/opt/workspace$ Installed the same way: kitchen@c71479c4f76c:/opt/workspace$ sudo dpkg --force-all --install $(find . -name \*.deb) Selecting previously unselected package git-secret. (Reading database ... 29069 files and directories currently installed.) Preparing to unpack .../git-secret_0.2.4_all.deb ... Unpacking git-secret (0.2.4) ... Setting up git-secret (0.2.4) ... Processing triggers for man-db (2.7.6.1-2) ... kitchen@c71479c4f76c:/opt/workspace$ Works: kitchen@c71479c4f76c:/opt/workspace$ man -w git-secret-init /usr/share/man/man1/git-secret-init.1 kitchen@c71479c4f76c:/opt/workspace$ man -w git-secret /usr/share/man/man7/git-secret.7 kitchen@c71479c4f76c:/opt/workspace$ The version of Debian that works is: kitchen@c71479c4f76c:/opt/workspace$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 9.4 (stretch) Release: 9.4 Codename: stretch kitchen@c71479c4f76c:/opt/workspace$ The version of Ubuntu which doesn't is: kitchen@ceddd8d3564c:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04 LTS Release: 18.04 Codename: bionic kitchen@ceddd8d3564c:~$ Why don't the man pages install on Ubuntu?
Your dpkg configuration on your Ubuntu system, namely the path-exclude=/usr/share/man/* directive in /etc/dpkg/dpkg.cfg.d/excludes, instructs dpkg to not install manpages. If you do want to install manpages, remove the corresponding line and install the package again.
manual pages of built .deb install on Debian but not Ubuntu
1,363,800,322,000
I am creating a .deb package that needs a MySQL database. I am building the package using dpkg-deb --build. While installing I want my post install script to execute an SQL script to set up the database like so: cat setup.sql | mysql -u root -p I am currently putting setup.sql into the "DEBIAN" folder of my package. What path do I need to specify in my post install script to find this SQL script? I know I could embed the SQL contents into my post-install script but I want to keep them separate for code maintenance reasons.
You can’t easily (if at all) access files you add to DEBIAN in a package built with dpkg-deb -b — those files end up in the control information area of the binary package, they aren’t installed as such (in fact, I’m not sure non-standard files are even included in the package; standard files end up in /var/lib/dpkg/info). You should instead install your script in /usr/share/yourpackage (replacing yourpackage with the name of your package). Then your postinst can access it there. Ideally, you’d use dbconfig-common instead; that supports a wide variety of use-cases and database configurations. It would involve more work up-front but would result in a much more versatile package.
Where do temporary files go while installing a .deb package?
1,363,800,322,000
I have Debian Jessie (amd64 with i386 multiarch) installed on my system. But there are some packages not available for installation, although they should. I am trying to install mysql-client, but I get this error: $ apt-get install mysql-client Reading package lists... Done Building dependency tree Reading state information... Done Package mysql-client is a virtual package provided by: mysql-client-5.5 5.5.57-0+deb8u1 [Not candidate version] mysql-client-5.5 5.5.55-0+deb8u1 [Not candidate version] E: Package 'mysql-client' has no installation candidate Trying to install mysql-client-5.5 tells a bit more: $ apt-get install mysql-client-5.5 Reading package lists... Done Building dependency tree Reading state information... Done Package mysql-client-5.5 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 My sources.list looks like this: deb http://ftp.de.debian.org/debian/ jessie main contrib non-free deb http://security.debian.org/ jessie/updates main contrib non-free deb http://ftp.de.debian.org/debian/ jessie-updates main contrib non-free deb https://dl.winehq.org/wine-builds/debian/ jessie main How can I fix this strange behaviour? UPDATE Doing a apt-cache search mysql only prints these few packages. That does not seem correct to me. akonadi-backend-mysql - MySQL storage backend for Akonadi libreoffice-base-drivers - Database connectivity drivers for LibreOffice libmysqlclient18 - MySQL database client library mysql-common - MySQL database common files, e.g. /etc/mysql/my.cnf mysql-server-core-5.5 - MySQL database server binaries php5-sqlite - SQLite module for php5 libqt4-sql-mysql - Qt 4 MySQL database driver librdf0 - Redland Resource Description Framework (RDF) library rsyslog - reliable system and kernel logging daemon
[Note: the solution was discovered in the Update 2 data, and explained at the bottom, apt pinning.] Diagnosing this issue requires determining where the failure is happening. First, try this, it appears that something is wrong in terms of your sources, so just replace them with these, then debug backwards once you have a working setup again: https://packages.debian.org/search?keywords=mysql-client&searchon=names&suite=oldstable&section=all Exact hits Package mysql-client jessie (oldstable) (database): MySQL database client (metapackage depending on the latest version) 5.5.57-0+deb8u1 [security]: all also provided by: mysql-client-5.5 Other hits Package mysql-client-5.5 jessie (oldstable) (database): MySQL database client binaries 5.5.57-0+deb8u1 [security]: amd64 arm64 armel armhf i386 mips mipsel powerpc ppc64el s390x This shows the packages in question are in old stable. Change your sources.list to this: #deb http://ftp.de.debian.org/debian/ jessie main contrib non-free #deb http://security.debian.org/ jessie/updates main contrib non-free #deb http://ftp.de.debian.org/debian/ jessie-updates main contrib non-free # try these instead: deb http://mirrors.kernel.org/debian jessie main contrib non-free deb http://security.debian.org/ jessie/updates main contrib non-free # and your wine repo deb https://dl.winehq.org/wine-builds/debian/ jessie main Save, then: apt-get update Then: apt-cache search mysql If this does not now show your mysql-client, I believe something very difficult to debug is corrupted in your system. Also, show in the full results of: apt-get update not just the last line, the entire thing, that may show errors you are missing. You can also always check what your local apt knows, with something like this: apt-cache show mysql-client and carefully examine the output. also: apt-cache policy mysql-client It's clear that your apt update is failing to update for whatever reason, I suggest the above change of repos to remove some variables from the question. [Updated] Note, I corrected a line in sources.list update yours, but your paste shows that was the only item failing, which means your primary jessie main contrib non-free local database is not for some reason updating correctly. Modify the sources.list, run apt-get update again, and look for errors again. It's clear your apt package database is failing to update. [Update 2] If apt-get update is working and not showing errors, and if you see the end result: 18.9 MB updated which your paste does show in the end, this strongly suggests that the issue is a failure to write the data to disk, in a way that apt itself is not able to be aware of in order to show error messages due to that failure. Check: dmesg | grep apt-get for any error messages as well. Check the system with df -hT to make sure the /var partition apt is writing the update data to is not full. Run a fsck on the partition that contains /var. Note that reinstalling will not fix hardware failures, so it's probably a better idea to figure out why it's failing than to reinstall hoping that will resolve the issues. Did anything or anyone change the permissions of the apt database? Check the following (note in particular the size of the files): ls -l /var/cache/apt # the results should look like this: drwxr-xr-x 3 root root 147456 Jul 22 16:50 archives -rw-r--r-- 1 root root 32808269 Aug 13 16:15 pkgcache.bin -rw-r--r-- 1 root root 32088021 Aug 13 16:15 srcpkgcache.bin Further, the last modified date should change every time you run apt-get update. Further checks: ls -l /var/lib/apt/lists/ should show all your repos and their associated data that was grabbed from apt-get update, or in your case, apparently grabbed but not updated. Repeat the search: apt-cache search mysql-client which should either show nothing, as was your case until now, or it should show something. Next: check that you have not set apt preferences to use a previous distribution or some other unremembered event in /etc/apt: cd /etc/apt cat apt.conf apt.conf.d/* preferences preferences.d/* This should return any configurations set in those files (for example): APT::Default-Release "buster"; APT::Get::AutomaticRemove "0"; APT::Get::HideAutoRemove "1"; [UPDATE 3 - Solved?] And the user configurations from the /etc/apt cat above show the problem, which was obvious as soon as I saw it, but not obvious to guess, though the hint of running Jessie, old stable, after new stable, Stretch, was released should have been enough to check the pinning without the other tests: // Use apt bandwidth limit feature, this example limits the download // speed to 70kb/sec //Acquire::http::Dl-Limit "70"; // Pre-configure all packages with debconf before they are installed. // If you don't like it, comment it out. DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";}; Package: * Pin: release a=stable [***** my emphasis] Pin-Priority: 900 Package: * Pin: release o=Debian Pin-Priority: -10 cat: preferences.d/*: No such file or directory Now it makes sense, no technical issues, no hardware issues, yet apt is showing no packages. Why? Because your system is pinned to stable, which is stretch, not jessie. Change the pinning, first locate the file that has that pinning in it: grep -snR 'Pin: release a=stable' /etc/apt Then change 'stable' to 'jessie' and everything should work again. Except I believe you need to change it to (note the n instead of a, n is the name of the release): Pin: release n=jessie And maybe add in /etc/apt/apt.conf this line, though I don't believe it's necessary in your case. APT::Default-Release "jessie"; https://manpages.debian.org/stretch/apt/apt_preferences.5.en.html Note that jessie I don't believe had all the .d directories yet, so it's hard to remember where its files should go, probably in the .d/ directories will work fine. The Default-Release is set in: /etc/apt/apt.conf.d/80Basics The Pinning is in: /etc/apt/preferences.d/80Basics In your case, the pinnning is in /etc/apt/preferences Basically you told apt to pin to stable, and it dutifully is doing what you told it to do, only you don't have stable in your sources, you have what is now old stable. So apt when you ask it about packages, dutifully informs, after you update jessie sources, that there are basically no packages to be found. No errors are reported because no error occurred, the update worked fine, the package database was updated fine, the package lists all updated, but sadly, none of them contain stretch (stable) data. That's the risk of using 'stable' instead of the actual distribution name in that, it's very easy to forget you did it, and even more confusing when stable changes to old stable, or EOL stable. Note that generally you can use sid/testing/stable in your sources, but I've found that those can fail at times when testing rolls to new testing, and stable becomes old stable, so the actual names are my preferences except of course for sid, which never changes. I believe this is the solution, as you can see, reinstalling is almost never the solution, and I was increasingly beginning to suspect you had something configured somewhere that you'd forgotten about, since everything is working, apparently. I believe that pinning is going to be in /etc/apt/preferences (since preferences.d didn't exist in your jessie). APT PINNING: https://wiki.debian.org/AptPreferences As a a result, I use a more conservative "only if I say so" approach to a mixed distribution, with a Pin file like this: Package: * Pin: release a=testing Pin-Priority: 900 Package: * Pin: release o=Debian Pin-Priority: -10 Thus all debian packages are defaulted to priority -10, while testing receives a 900 point bonus. This invokes the behaviors: From apt_preferences(5) 500 < P <=990 : causes a version to be installed unless there is a version available belonging to the target release or the installed version is more recent [...] P < 0 : prevents the version from being installed [...] P < 0 : prevents the version from being installed As you can see, you told apt to basically ignore everything that is not stable (-10), and to only use stable (900), so apt did what you told it to do. Given this was a stable, not sid or testing installation, I wouldn't in general use that -10 pinning, I'd use something like 100 or 200. But I'd only use pinning if I was actually running various pools, like stretch and jessie, or sid and testing, there's no point beyond confusing yourself to using it if you are only using Jessie, and even then, apt basically ignores the pinning and uses the Default-Release anyway now, for example, I have my testing pinned to 900, but set to default release, so apt-cache policy show this: apt-cache policy nano nano: Installed: 2.7.4-1 Candidate: 2.8.6-1 Version table: 2.8.6-2 300 300 http://mirrors.kernel.org/debian unstable/main i386 Packages 2.8.6-1 990 990 http://mirrors.kernel.org/debian buster/main i386 Packages *** 2.7.4-1 100 100 /var/lib/dpkg/status As you can see, the pinning value is 990, which isn't something I did, it's something apt does when you declare the default-release explicitly. https://manpages.debian.org/stretch/apt/apt_preferences.5.en.html The stretch man page for preferences is pretty clear.
Why are some packages not available in my Debian Jessie installation?
1,363,800,322,000
If I mark a package as hold with echo "xyz hold" | sudo dpkg --set-selections and afterwards explicitly use apt upgrade xyz=1.2.3 the package is marked as install in dpkg --get-selections. Is there any way to "permanently" mark a package as hold? - I want to update it, but always manually and never as part of another update. I tried to look online, but there's 100 posts that teaches you how to hold a package, I know that. I also tried man apt which sends you to man apt-get 8 but upgrade doesn't really specify anything about hold-packages (or suddenly unholding them..) - so I'm also happy if you can provide resources about the behaviour. It kind of tripped me a little when I upgraded 3 packages in a row, to a specific "not-latest" version, and .. the last one got the specified version, but the others were suddenly "latest." I can see in the output that apt upgrade did show me that it was also going to upgrade the other packages.. I just don't want to write a new script like.. upgrade(){ apt-get upgrade $1=$2 echo "$1 hold" | dpkg --set-selection } ..... or is that the solution I'm looking for? This question was originally posted on "askubuntu," but since it didn't get any traffic they suggested that I deleted the question and posted it here. A user did suggest using apt-mark. But it does not solve my problem it just simplifies holding packages.
I don’t think there’s a way to do this with package holds; but there is a different way of preventing upgrades: you can pin a package with priority -1. Create a file in /etc/apt/preferences.d containing Package: xyz Pin: version * Pin-Priority: -1 xyz will then never be a candidate for upgrades, unless a specific version is requested.
Upgrading a package marked as hold, marks it as install in dpkg --get-selections
1,363,800,322,000
Through updating debian OS on various hosts (apt-get dist-upgrade), I've seen many often small variations of the same screen; when a configuration file has been modified, it will tell you a new version is available, and ask you to fix the problem: you've modified the file and apt/dpkg cannot reliably integrate your changes with the new version. Now this options menu is different between various files. Sometimes even within the same package. Some files will have a "package configuration" console UI, others will use plain console output. The options available in the package configuration UI are not always the same. The name of the modified/new version file is not always the same. The location where the new file is stored is not always the place where it should be (sometimes it's in 'tmp'.). The naming scheme for the new file isn't consistent either (some packages use a random name, some use -new, others -dpkg-new, and so on.) Some packages refuse to tell you where the dpkg default is. Some packages don't provide you with the previous version with extension dpkg-old or -old or -dist or -dpkg-dist or -old-nameofpackage, but others do. (So in some cases you can manually 3-way merge, in other cases you can't). Some packages add a handy 'do a 3 way merge between versions' (which is always the first thing I try as it can often automatically solve the problem: most changes in the config files are usually just typo fixes in comments. The program or way side-by-side differences are shown can vary between packages/files too. So I thought the entire purpose of a package management system is to create a consistent way of installing and uninstalling programs. Simple to manage for the user. What went wrong here; why is this so horrible in its UI/UX? Is there anything a user can do to change/modify apt so at least 'do a 3-way merge' is available The new files are always renamed/placed in a consistent way? Having to re-read and figure out exactly what to do with each and every config file manually because of 1,000 tiny variations of doing the same thing when it boils down to the same rote procedure is painful. To illustrate what I mean, here's two from an upgrade; Configuration file '/etc/ssh/ssh_config' ==> Modified (by you or by a script) since installation. ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. A new version (/tmp/tmp.3RoEfdEm3M) of configuration file /etc/ssh/sshd_config is available, but the version installed currently has been locally modified. What do you want to do about modified configuration file sshd_config? install the package maintainer's version keep the local version currently installed show the differences between the versions show a side-by-side difference between the versions show a 3-way difference between available versions do a 3-way merge between available versions start a new shell to examine the situation Those options in the second variant? They're not always there in that order. It feels almost like this is just made to trip you up.
I’ll address the “user-facing” concerns in your question first: 'do a 3-way merge' is availble This can’t be controlled by users, it depends on how the package manages its configuration files (see below). The new files are always renamed/placed in a consistent way? No, but it shouldn’t matter in practice. In particular, the temporary files shown for example in your second example (the sshd_config one) really are temporary files: they are a variant of the configuration file made available so that the comparison tools etc. can find the data they need to compare. (The user experience could be improved here by not showing the temporary file name by default, and only displaying it if the user starts a shell “to examine the situation”.) As for why this happens, in Debian specifically, it’s because configuration files can be handled in a variety of ways. The package manager, dpkg, provides its own management of configuration files, as you expect. This is what produces the first variant in your example (the ssh_config upgrade). It only has two pieces of information to work with: the configuration file as it exists currently on disk, and the new configuration file shipped in the package it’s trying to install. As a result, it can’t offer three-way merges. For package maintainers it’s very simple to use (in fact in most cases it requires no work at all). dpkg’s configuration-file handling produces consistent file names after the fact: files ending in .dpkg-dist and .dpkg-old depending on whether the user kept the existing file (in which case, the new file is kept for later reference, with the .dpkg-dist extension) or installed the new one (in which case, the old file is kept with the .dpkg-old extension). To improve this situation, the ucf tool was developed. It stores the original version of configuration files, which is why it can provide three-way comparisons and merges. However it requires some work from package maintainers, which is why many packages don’t use it. Further, support for three-way merges is optional. You can see openssh-server’s ucf integration here. On top of all that, there’s debconf, the Debian configuration management system. This is what packages which require interaction during installation are supposed to use, but again, this requires work from package maintainers, so while it is now very common, there are still some exceptions (including very old packages which haven’t been updated to use debconf). Of course, some maintainers don’t like any of the above, or developed their own solution before some of the above were available, so a few packages do their own thing. Joey Hess wrote about his involvement in the VA Linux box set of Debian from 1999, which gives some context around the creation of debconf and the revamping of package configuration.
What is the motivation or cause behind inconsistent configuration file modification screens?
1,363,800,322,000
The man page isn't clear on that. How would I use a signing hook? Especially using the parameter without the config file. What is the meaning of foo in the documentation? For example in --signing-hook-foo? Do I replace foo with my bash script? The would seem very odd and against all conventions that I know. For example, would this be the way you are supposed to use it? echo "#!/usr/bin/env bash" > /signing-hook-script.sh echo "(pwd; ls -la; tree /) > /output.txt" >> /signing-hook-script.sh chmod +x /signing-hook-script.sh debuild -i -S --signing-hook-/signing-hook-script.sh
Well spotted, the manpage is incorrect. debuild --help shows the appropriate syntax: --dpkg-buildpackage-hook=HOOK --clean-hook=HOOK --dpkg-source-hook=HOOK --build-hook=HOOK --binary-hook=HOOK --dpkg-genchanges-hook=HOOK --final-clean-hook=HOOK --lintian-hook=HOOK --signing-hook=HOOK --post-dpkg-buildpackage-hook=HOOK These hooks run at the various stages of the dpkg-buildpackage run. For details, see the debuild manpage. They default to nothing, and can be reset to nothing with --foo-hook='' So your example would be debuild --signing-hook=/signing-hook-script.sh -i -S (debuild options must be specified before dpkg-buildpackage options).
How to use debuild hooks (--signing-hook-foo etc)
1,363,800,322,000
I have VPS instances from three different providers, and those from two providers will prompt for a restart of affected services when running apt-get upgrade. VPS instances from one provider do NOT prompt during the upgrade, which then requires me to go and restart services afterwards manually. I've seen mention of this setting elsewhere, but it doesn't seem to be present on any of my systems: DEBIAN_FRONTEND=noninteractive I don't know if it is relevant, but all of these VPS instances originally had Debian 7 and were upgraded a couple months ago to Debian 8. Prior to that, I don't remember ANY of them prompting to restart services, so I suspect this behavior is new to Debian 8. So how do I get ALL of my systems to prompt me for restarting services during an upgrade? Bonus: is there a way to tell apt-get to always restart services without even prompting?
The needrestart package will implement what you are describing once installed.
How to make Debian prompt before restarting services after package upgrades?
1,363,800,322,000
I am on kali linux and when I run apt-get update it returns this: W: Unknown flag value: yes W: You may want to run apt-get update to correct these problems after running apt-get update several times it's still the same issue
I think there is something wrong with the: deb http://repo.kali.org/kali kali-bleeding-edge main I think you should wait for kali.org to fix it.
apt-get returns strange error
1,363,800,322,000
I've had to download and install a version of a library from its source code repository. The problem is is that other packages from the Kubuntu package manager require this library to be installed. Right now I'm working with ffmpeg, but I've had to do it before (e.g. OpenCV) and I'm looking into the best way of doing this for the future... So what I'm trying to do is create a debian package that I can install with dpkg using checkinstall. I've since decompressed the deb file to modify it trying to get it working correctly The problem is, ffmpeg is split into multiple packages in the package manager and I don't want to have to write the 5/6 packages to replace each and every one if I don't have to. I have made sure it is properly compiled with everything that is required for all these packages. I've been trying to use the "Requires" and "Replaces" but it just doesn't seem to work correctly. When I try to install VLC afterwards, it asks to install all the ones from the package manager. I've also made sure the version number is later than the ones in the package manager. Here's what's written in my deb control file. As far as I can see, this is all recognised in the muon package manager. Package: ffmpeg Priority: extra Section: checkinstall Installed-Size: 172216 Maintainer: root@skund Architecture: amd64 Version: 8:1.2.1-git-2 Provides: ffmpeg,libav-tools,libpostproc52,libavdevice53,libavutil51,libavformat53,libavcodec53,libswscale2 Replaces: ffmpeg,libav-tools,libpostproc52,libavdevice53,libavutil51,libavformat53,libavcodec53,libswscale2 Description: Package created with checkinstall 1.6.2 And here it is installed in the package manager: Does anyone have any ideas on getting this working?
Well, for one thing, Provides: does not work with dependencies that specify a version. From the Debian Policy Manual, "Virtual packages - Provides": If a relationship field has a version number attached, only real packages will be considered [...]. In other words, if a version number is specified, this is a request to ignore all Provides for that package name and consider only real packages. Dependencies on libraries are almost always versioned. So that's just not going to work. Instead, you could: Download the Debian package (apt-get source PACKAGE) and update it for the latest ffmpeg (and, indeed, you could even send patches required to the Debian bug tracker). Of course you'll need to update the sonames of the libraries (I bet the ABI changed), and probably rebuild a lot of stuff that depends on ffmpeg. Some of that may require source changes if the API changed. Or, the easy way: install it to /usr/local. You can build a .deb of that, and give it a different package name (e.g., local-ffmpeg). You can then install it alongside the Debian-provided ffmpeg, and not worry about all the above. You could also use stow to install it in /usr/local.
Replacing Multiple Debian Packages from Compiled Source
1,363,800,322,000
So, I recently acquired a brand new Nokia N900 phone off of an online auction site for a fairly reasonable price. The N900 is a Linux phone, and it came out a long time ago, but it's only just now within my budget. I've spent the past day struggling with it. Its version of apt is particularly frustrating. The point I'm at now is, I can't get dpkg to properly configure a package because of how some guy at Nokia decided the phone shouldn't have any files whatsoever in /usr/share/doc. Apparently. And the --configure of this particular package demands that a file be put into /usr/share/doc and then "optified", which is a Nokia Linux term I don't really understand, but seems mainly to have to do with treating /opt/maemo as if it were the root directory when it comes to certain types of files. Needless to say, this documentation can not be "optified"... I don't really care why, I just want to be able to: Decompress the .deb file myself. Look at the script that tells dpkg where to put things. Modify the script and/or move those files around myself. Do whatever else is necessary so that the right files are in the right place, myself. Inform the list of packages that this package has been 'installed'. Get on with my life, knowing a lot more about .debs than I currently do.
You could modify the .deb file by hand, and then install it as if were the original one. You could take a look to the official reference The steps I did in some moment in the past, could be summarized as: Create a working directory: mkdir work cd work Make sure that a copy of the .deb file is in that directory. Decompress the .deb file: ar x $DEB_FILE Remove the .deb file from here: rm $DEB_FILE Decompress the data file: mkdir data cd data tar zxf ../data.tar.gz cd .. Decompress the control file: mkdir control cd control tar zxf ../control.tar.gz cd .. Do whatever change you have to do, for example, modify at least one of the files inside control directory: control/preinst control/postinst control/prerm control/postrm Update into control/md5sums the md5 checksums of the files you modified. Compress again the .deb file: cd control tar zcf control.tar.gz * mv control.tar.gz .. cd .. rm -rf control cd data tar zcf data.tar.gz * mv data.tar.gz .. cd .. rm -rf data ar r $DEB_FILE debian-binary control.tar.gz data.tar.gz
Install a .deb completely 'by hand'
1,363,800,322,000
I'm trying to port some scripts from Ubuntu to Centos6 (for docker) Now I'm having trouble trying to replicate this in Centos (which I am not very familiar with) dpkg-divert --local --rename --add /sbin/initctl
There is no equivalent tool to this in RPM packaging that I've ever seen. You control where files get installed via the .spec file. The only thing you can do at install time is override the prefix. $ sudo rpm --prefix=/home/dir/ some.rpm
RPM alternative to dpkg-divert
1,363,800,322,000
I'm trying to limit the risk in using third-party APT repositories. The scenario I'm trying to protect against is a malicious package being introduced into a third-party repo with a newer version than the version I have installed from Debian. Lately whenever I've added a new APT source, I've used APT pinning to make only certain packages installable from that source, like so: Package: * Pin: origin debian.nabijaczleweli.xyz Pin-Priority: -1 Package: systemd-zram Pin: origin debian.nabijaczleweli.xyz Pin-Priority: 500 Note that I am using Pin: origin <hostname> rather than Origin: <tag> to do this. If I understand correctly, the origin tag is controlled by the repo itself (in the Releases file) and can easily be set to debian, either maliciously or because of ignorance. (I have seen this in the wild.) By contrast, the origin hostname is derived from the URI specified in sources.list. This seems to work just fine, and now I want to apply this to all my third-party APT sources. To do this, I need to know which packages I've installed from each third-party repository. The problem is, I can't seem to find a way to get a list of installed packages and their origin URIs or hostnames. Aptitude is happy to show you Origin URI on its package information screen¹, but does not include a search predicate for it nor will it display it in package lists. dpkg-query and apt-cache can give me a lot of information about packages, but I haven't yet found a way to get the origin URI or hostname. I assume I could parse the contents of /var/lib/apt/lists/*_Packages myself, using the first part of the filename as the origin hostname, but I'd prefer not to subject myself to that. So: Is this scenario even worth considering? Maybe there are so many ways that a compromised repo can screw me over that I should learn to stop worrying and love the bomb. Am I correct that the Releases file's Origin field is less reliable an indication of a package's provenance than the origin hostname used in Pin: origin <hostname>? Is there a way to get a list of all installed packages along with their origin hostnames? Thanks! ¹The screenshot on that page is too old to depict the Origin-URI field being shown, but modern versions of Aptitude show the complete URI of the package here.
Seems aptitude is dumb... for the logic you want. A workaround is to resort to Python: import apt CACHE = apt.Cache() for pkg in CACHE: if not pkg.installed: continue for orig in pkg.candidate.origins if pkg.candidate else []: if len(orig.site) == 0: continue print(pkg, pkg.candidate.version, orig.site) UPDATE The package apt comes with: bash# dpkg -S /usr/lib/python3/dist-packages/apt/__init__.py python3-apt: /usr/lib/python3/dist-packages/apt/__init__.py
How can I list all installed packages along with their APT origin hostnames (not their origin tags)?
1,363,800,322,000
I'm trying to install packages to get a webcam stream running on my raspberry pi. All of a sudden, apt-get is totally busted -- every time I try to install, reinstall or purge something that might fix the problem, I get the following error: dpkg: unrecoverable fatal error, aborting: files list for package 'gnome-themes-standard-data' is not a regular file E: Sub-process /usr/bin/dpkg returned an error code (2) Which is remarkably frustrating! I have no idea what this error is, what caused it, or how to fix it, but it's totally stopped me in my tracks. I've tried apt-get update which runs to completion, but I can't upgrade or purge the problem package. It breaks even using -f and aptitude instead of apt-get. Here's me trying to install ffmpeg: pi@raspberrypi:/var/backups$ sudo apt-get install ffmpeg Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libav-tools libavdevice53 libavfilter2 libjack-jackd2-0 libopencv-core2.3 libopencv-imgproc2.3 Suggested packages: jackd2 The following NEW packages will be installed: ffmpeg libav-tools libavdevice53 libavfilter2 libjack-jackd2-0 libopencv-core2.3 libopencv-imgproc2.3 0 upgraded, 7 newly installed, 0 to remove and 150 not upgraded. Need to get 0 B/2,235 kB of archives. After this operation, 5,970 kB of additional disk space will be used. Do you want to continue [Y/n]? Y Selecting previously unselected package libjack-jackd2-0:armhf. dpkg: unrecoverable fatal error, aborting: files list for package 'gnome-themes-standard-data' is not a regular file E: Sub-process /usr/bin/dpkg returned an error code (2) pi@raspberrypi:/var/backups$ sudo apt-get purge gnome-themes-standard-data Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: gnome-themes-standard* gnome-themes-standard-data* 0 upgraded, 0 newly installed, 2 to remove and 150 not upgraded. After this operation, 3,892 kB disk space will be freed. Do you want to continue [Y/n]? Y dpkg: unrecoverable fatal error, aborting: files list for package 'gnome-themes-standard-data' is not a regular file E: Sub-process /usr/bin/dpkg returned an error code (2) pi@raspberrypi:/var/backups$ sudo apt-get update Hit http://mirrordirector.raspbian.org wheezy InRelease Hit http://archive.raspberrypi.org wheezy InRelease Hit http://mirrordirector.raspbian.org wheezy/main armhf Packages Hit http://archive.raspberrypi.org wheezy/main armhf Packages Hit http://mirrordirector.raspbian.org wheezy/contrib armhf Packages Hit http://mirrordirector.raspbian.org wheezy/non-free armhf Packages Hit http://mirrordirector.raspbian.org wheezy/rpi armhf Packages Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB Ign http://archive.raspberrypi.org wheezy/main Translation-en Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en_GB Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en Ign http://mirrordirector.raspbian.org wheezy/main Translation-en_GB Ign http://mirrordirector.raspbian.org wheezy/main Translation-en Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en_GB Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en_GB Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. pi@raspberrypi:/var/backups$ sudo dpkg --configure -a pi@raspberrypi:/var/backups$ sudo apt-get update Hit http://mirrordirector.raspbian.org wheezy InRelease Hit http://archive.raspberrypi.org wheezy InRelease Hit http://mirrordirector.raspbian.org wheezy/main armhf Packages Hit http://archive.raspberrypi.org wheezy/main armhf Packages Hit http://mirrordirector.raspbian.org wheezy/contrib armhf Packages Hit http://mirrordirector.raspbian.org wheezy/non-free armhf Packages Hit http://mirrordirector.raspbian.org wheezy/rpi armhf Packages Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB Ign http://archive.raspberrypi.org wheezy/main Translation-en Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en_GB Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en Ign http://mirrordirector.raspbian.org wheezy/main Translation-en_GB Ign http://mirrordirector.raspbian.org wheezy/main Translation-en Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en_GB Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en_GB Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en Reading package lists... Done pi@raspberrypi:/var/backups$ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: apt apt-utils binutils cups-bsd cups-client cups-common curl debian-reference-common debian-reference-en dmsetup dpkg dpkg-dev e2fslibs e2fsprogs gdb gdbserver gvfs gvfs-backends gvfs-common gvfs-daemons gvfs-fuse gvfs-libs idle idle-python3.2 idle3 ifupdown initramfs-tools initscripts iptables isc-dhcp-client isc-dhcp-common iso-codes krb5-locales libapt-inst1.5 libapt-pkg-dev libapt-pkg4.12 libarchive12 libavahi-client3 libavahi-common-data libavahi-common3 libavahi-glib1 libc-bin libc-dev-bin libc6 libc6-dev libcairo-gobject2 libcairo2 libcomerr2 libcups2 libcupsimage2 libcurl3 libdbus-glib-1-2 libdevmapper-event1.02.1 libdevmapper1.02.1 libdpkg-perl libgail-3-0 libgcrypt11 libgl1-mesa-glx libglapi-mesa libglib2.0-0 libglib2.0-data libgnutls26 libgssapi-krb5-2 libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 libgtk-3-0 libgtk-3-bin libgtk-3-common libgudev-1.0-0 libicu48 libjavascriptcoregtk-1.0-0 libjavascriptcoregtk-3.0-0 libjson0 libk5crypto3 libkrb5-3 libkrb5support0 liblapack3 liblapack3gf libldap-2.4-2 liblvm2app2.2 libnewt0.52 libobrender27 libobt0 libpixman-1-0 libpoppler19 libprocps0 libproxy0 libqt4-network libqt4-svg libqt4-xml libqtcore4 libqtdbus4 libqtgui4 libsmbclient libsmpeg0 libss2 libssl1.0.0 libsystemd-login0 libudev0 libwbclient0 libwebkitgtk-1.0-0 libwebkitgtk-1.0-common libwebkitgtk-3.0-0 libwebkitgtk-3.0-common libwebp2 libxml2 libxslt1.1 linux-libc-dev locales lxtask multiarch-support openbox openssh-client openssh-server openssl perl perl-base perl-modules pistore poppler-utils procps python python-minimal python-numpy python-rpi.gpio python3 python3-minimal python3-numpy python3-rpi.gpio python3.2 python3.2-minimal rsyslog samba-common sgml-base smbclient ssh sudo sysv-rc sysvinit sysvinit-utils tasksel tasksel-data tzdata udev whiptail x11-common xserver-common xserver-xorg xserver-xorg-core xserver-xorg-input-all 150 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/118 MB of archives. After this operation, 742 kB of additional disk space will be used. Do you want to continue [Y/n]? Y Extracting templates from packages: 100% Preconfiguring packages ... dpkg: unrecoverable fatal error, aborting: files list for package 'gnome-themes-standard-data' is not a regular file E: Sub-process /usr/bin/dpkg returned an error code (2) pi@raspberrypi:/var/backups$ Is this fixable or do I have to flatten and reimage Wheezy on my SD card? Any help is greatly appreciated.
The files list for that package is stored in /var/lib/dpkg/info/gnome-themes-standard-data.list; it is quite surprising this is anything other than a normal file. I'd suggest ls -l or stat on it, to figure out what it is. If you can explain why its something other than a plain file (say, you symlink'd it somewhere), then undo that. If you didn't do anything to it, or its showing as something crazy, then I suggest an fsck. If its missing entirely, you can probably grab a new copy from the .deb (extract it using dpkg-deb or ar and tar), but that could leave some cruft on your system (if the installed list didn't match exactly what was in the one from the package).
apt-get won't install: dpkg: files list for package 'gnome-themes-standard-data' is not a regular file
1,363,800,322,000
What is the standard way to share code between the dpkg scripts (preinst, postinst, prerm, postrm)? I can see how to share code between just postinst and prerm (by installing it as part of the package), but can't see any way to share with preinst and postrm.
I'm pretty sure there's nothing to be done. You can rely on a Pre-Depend:, but these are to be avoided unless absolutely necessary, as they're a heavy burden on the dependency chain. You can pre-process the scripts, if there's code to be shared. The debhelper tools already do this, inserting boilerplate into the various maintainer scripts. It's rare to need to do complicated things in preinst or postinst. The main adhockery tends to be handling tricky upgrades, and that's usually custom code in a preinst.
Sharing code between dpkg scripts
1,363,800,322,000
I'm making a very basic Debian repo for a client. Started with a bash script, but decided a Makefile would eliminate duplicated work. I've hammered out a working Makefile, but it works only if I make all. For some reason, a straight make only builds the first deb. make clean does nothing. What am I doing wrong? MFGR:=MyCoolEmployer MAJOR:=1 MINOR:=0 REVISION:=1000 VERSION:=$(MAJOR).$(MINOR)-$(REVISION) MODELS:=SpiffyModel1 SpiffyModel2 COMMON:=common SOFT_TARGETS:=$(COMMON) $(MODELS) SOFT_TARGET_FOLDERS:=$(patsubst %, $(MFGR)-%_$(VERSION), $(SOFT_TARGETS)) DEBs := $(patsubst %, %.deb, $(SOFT_TARGET_FOLDERS)) REPO_DEBs :=$(patsubst %, Repo/binary/%, $(DEBs)) REPO=repo.zip PACKAGES_GZ := Repo/binary/Packages.gz %.deb: % dpkg-deb --build $< $(REPO_DEBs): $(DEBs) cp $^ Repo/binary/ $(PACKAGES_GZ): $(REPO_DEBs) dpkg-scanpackages Repo/binary /dev/null | gzip -9c > $@ $(REPO): $(REPO_DEBs) $(PACKAGES_GZ) cd Repo; zip -r -v -0 ../$@ . ; cd .. TARGETS: $(REPO) $(PACKAGES_GZ) $(REPO_DEBs) $(DEBs) all: TARGETS clean: rm -f $(TARGETS) This assumes the packages exist as folders named MyCoolEmployer-PACKAGENAME_1.0-1000
Your question contains its own answer.  By default, make processes only the first entry in the Makefile.  You need to put the "all" entry first.
Makefile for a simple Debian Repo
1,363,800,322,000
I am trying to write a non-interactive system update script. Question: if the following works well: yes | dpkg --configure -a will the following work also very well?: yes | apt-get install --fix-broken
You have -y or --yes or --assume-yes parameters in apt-get. Try something like sudo apt-get install -y <package-name> Details: The manual page of apt-get (You can also refer to manual page with man apt-get command) mentions: -y, --yes, --assume-yes Automatic yes to prompts. Assume "yes" as answer to all prompts and run non-interactively. If an undesirable situation, such as changing a held package or removing an essential package, occurs then apt-get will abort. Configuration Item: APT::Get::Assume-Yes. Contrary to this parameter, you also have --assume-no Automatic "no" to all prompts. Configuration Item: APT::Get::Assume-No. Edit For Vlastimil's comment, I tried sudo apt-get install --fix-broken --assume-yes And it works. The --fix-broken part of the command can be replaced with -f and --assume-yes with -y or --yes for convenience. This will not install any package in perticular but "can omit any packages to permit APT to deduce a likely solution", as mentioned on the manual page.
yes | apt-get install --fix-broken
1,363,800,322,000
I asked this question. While I got the answer (and am beating myself why didn't I try to pipe the output via cat or cat -n as shared by Stephen). Is there a way to make an alias or something so that whenever I run $ dpkg -L $PACKAGENAME I get the listing with line numbers, is that possible?
The alias part: alias dpkgnum='function __dpkgnum { dpkg -L $1 | nl;};__dpkgnum' As noted on comments, including just the function in .bashrc or .bash_aliases file, without alias will also work. function dpkgnum { dpkg -L $1 | nl;} #call it by terminal $: dpkgnum pkgname In this case the function will not be visible as an alias but as a system function and can be listed (among other system vars) with declare.
How to tack to dpkg -L output with line numbers?
1,363,800,322,000
I'm currently trying to get some info about the installed pakages und systems that use dpkg. So I tried to use dpkg-query. Most placeholders work fine and I get what I need, however I noticed that the placeholders Filename, MD5sum and Size are always empty. Simple command to see the issue: dpkg-query -W -f '"location":"${Filename}","md5":"${MD5sum}","size":"${Size}"\\n' This will result in loads of lines of just "location":"","md5":"","size":""
As mentioned in the manpage, these fields are “internal, front-end related”. In fact they’re only used in dselect. This means you can’t rely on them in dpkg-query, by default. They correspond to values stored in the “available” database, /var/lib/dpkg/available; dpkg-query by default only considers /var/lib/dpkg/status nowadays. You can add the --load-avail option to merge the information from the “available” database, in theory — but that requires using dselect as your package installation tool, since /var/lib/dpkg/available is only kept up-to-date by dselect. If you use APT this won’t work, as described in the documentation for the -p command: Users of APT-based frontends should use apt-cache show package-name instead as the available file is only kept up-to-date when using dselect. It might help if I expand a bit on the meaning of the fields: Filename, MD5sum and Size (and MSDOS-Filename) all give information on the file containing a package (its filename, checksum and size). They aren’t germane to the packages themselves, so the status database doesn’t need them and doesn’t store them. A package, installed or otherwise, remains the same regardless of where its package file lives and what its characteristics are. That information is only useful for front-ends which retrieve packages and provide them to dpkg.
dpkg-query placeholders "Filename", "MD5sum" and "Size" are always empty
1,363,800,322,000
I just installed the latest Debian version (8.4) on a virtual machine, and everything went fine. I then installed nginx server from the Debian repos and I got version 1.6.2, while the latest version available is 1.10, so I'd like to update it. The way I tried to do it is maybe wrong but it's all I've found so far. I first updated my repositories by adding the nginx repo to the sources.list file this way : sudo sh -c "echo 'deb http://nginx.org/packages/debian/ `lsb_release -cs` nginx' >> /etc/apt/sources.list" sudo sh -c "echo 'deb-src http://nginx.org/packages/debian/ `lsb_release -cs` nginx' >> /etc/apt/sources.list" curl http://nginx.org/keys/nginx_signing.key | apt-key add - sudo apt-get update Then, I tried to install latest nginx version with this command: sudo apt-get install nginx And I get this issue : root@Debian:/#LANG=C apt-get install nginx Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: nginx-common nginx-full Use 'apt-get autoremove' to remove them. The following packages will be upgraded: nginx 1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. Need to get 0 B/739 kB of archives. After this operation, 2421 kB of additional disk space will be used. Reading changelogs... Done (Reading database ... 140333 files and directories currently installed.) Preparing to unpack .../nginx_1.10.0-1~jessie_i386.deb ... Unpacking nginx (1.10.0-1~jessie) over (1.6.2-5+deb8u1) ... dpkg: error processing archive /var/cache/apt/archives/nginx_1.10.0-1~jessie_i386.deb (--unpack): trying to overwrite '/etc/default/nginx', which is also in package nginx-common 1.6.2-5+deb8u1 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing: /var/cache/apt/archives/nginx_1.10.0-1~jessie_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1) How can I solve this?
The basic error is this (emphasis mine): dpkg: error processing archive /var/cache/apt/archives/nginx_1.10.0-1~jessie_i386.deb (--unpack): trying to overwrite '/etc/default/nginx', which is also in package nginx-common 1.6.2-5+deb8u1 This means that the new package you are installing is trying to overwrite a file provided by another package (your installed nginx-common ) and dpkg is afraid that will break stuff and refuses to do it. The simple solution is to completely remove nginx-common packages and then install the new version again: sudo apt-get purge nginx-common sudo apt-get install nginx
Updating Nginx server to 1.10 on Debian 8.4
1,363,800,322,000
According to man dpkg I can use DPKG_HOOK_ACTION to get the current dpkg action being run in my dpkg hook script --pre-invoke=command --post-invoke=command Set an invoke hook command to be run via “sh -c” before or after the dpkg run for the unpack, configure, install, triggers-only, remove and purge dpkg actions. This option can be specified multiple times. The order the options are specified is preserved, with the ones from the configuration files taking precedence. The environment variable DPKG_HOOK_ACTION is set for the hooks to the current dpkg action. Note: front-ends might call dpkg several times per invocation, which might run the hooks more times than expected. but it doesn't seem to work in this hook command. Any idea what is wrong here? $ cat /etc/apt/apt.conf.d/99testhook DPkg::Pre-Invoke {"echo This is testhook. Current action is $DPKG_HOOK_ACTION; exit 0";}; $ sudo apt-get install screen ... Fetched 628 kB in 0s (4,366 kB/s) This is testhook. Current action is Selecting previously unselected package screen.
This only applies to commands specified by the --pre-invoke and --post-invoke options, not when the commands are set in the configuration. This can be demonstrated by putting your echo command into a script: # cat > /tmp/pre-invoke.sh <<'EOF' #!/bin/sh echo This is testhook. Current action is $DPKG_HOOK_ACTION; exit 0 EOF # chmod +x /tmp/pre-invoke.sh # dpkg --pre-invoke=/tmp/pre-invoke.sh -i /var/cache/apt/archives/rsync_3.1.1-2+b1_amd64.deb This is testhook. Current action is install (Reading database ... 113857 files and directories currently installed.) Preparing to unpack .../rsync_3.1.1-2+b1_amd64.deb ... Unpacking rsync (3.1.1-2+b1) over (3.1.1-2+b1) ... Setting up rsync (3.1.1-2+b1) ... Restarting rsync daemon: rsync. Processing triggers for man-db (2.6.7.1-1) ...
Dpkg env variable DPKG_HOOK_ACTION is not set in hook script
1,363,800,322,000
In Kubuntu 17.10 I had SafeQ client installed for printing management. I needed to install two deb packages, libcrafter_0.0.2_all.deb and ysoft-client_4.0-87_all.deb from here. However, now in Kubuntu 18.04 I can't install those two packages. For libcrafter_0.0.2_all.deb if I do sudo dpkg -i libcrafter_0.0.2_all.deb I get dpkg: error processing archive libcrafter_0.0.2_all.deb (--install): parsing file '/var/lib/dpkg/tmp.ci/control' near line 3 package 'libcrafter': error in 'Version' field string '0.0.2-': revision number is empty Errors were encountered while processing: libcrafter_0.0.2_all.deb How can I install this, no metter what? I tried also sudo dpkg --force-all -i libcrafter_0.0.2_all.deb 'Revision number is empty' shouldn't be a reason for not installing. This package is done by some student for his bachelor theses and I don't think it will be updated.
Unfortunately the libcrafter package wasn’t built correctly: its version is given as “0.0.2-”, which isn’t an acceptable version number in Debian (as specified in the relevant section of Debian policy). Older versions of dpkg accepted such version numbers, but that was fixed in version 1.18.19 (and I’m surprised you were able to install the packages in 17.10 since it has dpkg 1.18.24). However this is fixable: Download the existing package. Extract it: dpkg-deb -R libcrafter_0.0.2_all.deb libcrafter-0.0.2 Fix its version number and a couple of other issues with the package: sed -i 's/0.0.2-$/0.0.2-1/;s/all$/amd64/;s/java$/libs/' libcrafter-0.0.2/DEBIAN/control Rebuild the package: dpkg-deb -b libcrafter-0.0.2 . Install the resulting package: sudo dpkg -i libcrafter_0.0.2-1_amd64.deb Clean up: rm -rf libcrafter_0.0.2_all.deb libcrafter-0.0.2 (leaving the new package for later re-use).
Can't install a package with 'revision number is empty' message
1,363,800,322,000
I'm trying to install openssh server on a router and need a MIPS compiled binary. I've downloaded the one from here but encounter an error upon extraction: $ sudo dpkg --unpack openssh-server_6.0p1-4+deb7u2_mips.deb dpkg: error processing openssh-server_6.0p1-4+deb7u2_mips.deb (--unpack): package architecture (mips) does not match system (amd64) Errors were encountered while processing: openssh-server_6.0p1-4+deb7u2_mips.deb dpkg is also prompting me for administrative privileges which suggests that it's trying to install the package, not extract it. I cannot extract/install the .deb file on the router as it does not have dpkg or any package utility. I can only copy the server as is and issue a number of commands to create the appropriate directories and keys. What am I missing?
I've found the answer: dpkg -x openssh-server_6.0p1-4+deb7u2_mips.deb openssh_mips_outdir
Unpacking a .deb file containing a MIPS binary
1,363,800,322,000
I have a .deb file and its SHA1 checksum information. How do I check the .deb file's authenticity using this checksum before installing? There's many entries on Google for "how to verify checksums for installed packages" which is mind-boggingly useless yet none for checking BEFORE installing. Bonus points if you can explain why people are checking files AFTER installing them.
To check whether your package matches the SHA1 sum you have, run sha1sum /path/to/package.deb and compare the output. If you have the sum in a file of the form sum package.deb you can run sha1sum -c shafile to check the sum directly. To determine the authenticity of the package, you’ll need to determine the authenticity of the SHA1 sum. People check MD5 sums after installation for a variety of reasons; the one that makes sense in my opinion is to check for involuntary corruption (e.g. after disk errors, or an operator error). The MD5 sums available after installation are shipped in the package and are stored locally, so they don’t provide any external authentication.
SHA1 verification of external deb package before install
1,363,800,322,000
I am building a script to automatically deploy a .net core worker service app as systemd service unit/daemon. I wanted to double check: using solely dpkg, there is no other way to upgrade/update a package other than removing it first and then installing - is this correct ? I read that dpkg -i will upgrade the package if it is already installed, but if the check is dependent on the .deb file name, than it does not help me, since the .deb file name contains the version in it and the version is incremented, meaning the new version .deb file name will never be the one currently installed. So the way to go is removing and installing afterwards ? This is the way I am currently doing it. Removing a package works by package name. Wanted to double check if there is no shortcut.
dpkg -i will upgrade a package if it’s already installed, no need to remove it first. The package is checked using the metadata it contains (e.g. the package name as shown by dpkg -l after installation), not the file name.
Upgrading/Updating package using dpkg only
1,363,800,322,000
Package version 1.14.2-2+deb10u1 is installed and 1.14.2-2+deb10u1 is the latest version in the repository at time of writing. dpkg -l | grep nginx-extras ii nginx-extras 1.14.2-2+deb10u1 amd64 nginx web/proxy server (extended version) apt update apt dist-upgrade --simulate Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages will be upgraded: nginx-extras 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Inst nginx-extras [1.14.2-2+deb10u1] (1.14.2-2+deb10u1 Debian:10.3/stable, Debian-Security:10/stable [amd64]) Conf nginx-extras (1.14.2-2+deb10u1 Debian:10.3/stable, Debian-Security:10/stable [amd64]) Yet, APT wants to upgrade. Why? How can I let APT know that the system is already upgraded? Why not just do the upgrade? I don't want to needlessly upgrade using APT. Because that would overwrite my local changes. Background: I manually downloaded (apt source nginx-extras), compiled, made local changes, installed the package[s] using dpkg and apt. The package source folder debian/changelog matches web repository repository changelog file.
This happens because your installed package doesn’t match the packages available from the repositories, even though they have the same versions. (As A.B figured out, this appears to be based on the installed size of the package: if the installed package’s version is identical to that available from the repositories, but its installed size is different, apt will want to replace the package with the version available from the repositories. The installed size is listed in Packages for remote packages, and /var/lib/dpkg/status for installed packages. All this of course is also subservient to package pin priorities.) Whenever you build a package locally, especially if you make changes to it, it’s a good idea to update the changelog as if you were doing a non-maintainer upload: dch -n "Summary of your changes" dch -r ignored That way apt won’t try to replace your package with the packages in the repositories, until the latter are updated.
Why APT wants to upgrade already up to date package?
1,363,800,322,000
I am packaging my first debian project, and I have things 100% worked out with gnu-make (anything is possible here, for me, and so my difficulties right now are exclusively in navigating the dpkg/debuild system). I have, right now, just some dummy compilations in place with the following rules file and compatibility: // debian/compat 10 // debian/rules #!/usr/bin/make -f %: dh $@ override_dh_auto_install: cat binaries.txt | xargs -I arg install -D -m 0755 arg $$(pwd)/debian/package/opt/package/arg Assume that all compilations and source files are managed via make in the directory containing debian directory perfectly -- I have a minimal case that works just as expected. // binaries.txt foo bar is just a binaries file that lists out the dummy binaries my trivial make process produces. I am attempting to code a deb_helper symlink to symlink my binaries in /opt/package to /usr/local/bin according to the documentation here: https://manpages.debian.org/stretch/dpkg/dpkg-maintscript-helper.1.en.html But I am not having much luck. What is the procedure on this?
If you want to ship symlinks in your package, I would recommend using dh_link. The easiest way to do that is to list the symlinks you want in debian/links (or debian/package.links if your source package builds multiple binary packages): opt/package/bin/foo usr/bin/foo opt/package/bin/bar usr/bin/bar Debian packages aren’t supposed to ship any files under /usr/local so the build tools don’t support that too well. If you don’t need anything else in /opt/package, you could install your binaries directly to /usr/bin. You can also use dh_install to simplify your installation, by listing the binaries you want to install in debian/install: foo opt/package/bin bar opt/package/bin or foo usr/bin bar usr/bin You can then drop the dh_auto_install override.
Dpkg Debuild dh_helper: How to symlink binaries installed in /opt/package to /usr/local/bin?
1,363,800,322,000
I recently ran into the following situation: I could not boot my computer normally. (I was shown a blinking cursor after the boot-loader and Ubunutu load screen but before the login page while never reaching the login page.) I was able to enter recovery mode. If I fully continued the boot, I could get to a terminal where I could add/remove any packages with apt-get. Before fully booting into recovery mode, I was shown a menu where one of the options was dpkg which would repair installed packages. If I selected this option, the system calculated that a repair could be made if I reinstalled 103 packages. However saying yes to that operation ran into network issues when trying to download the packages for re-installation. I was able to resolve the situation by looking at the list of packages being offered to repair and then by using the "throw a dart and pray" strategy, I opted to run sudo apt-get install --reinstall ubuntu-gnome-desktop from the prompt offered after fully entering recovery mode. This ended up triggering a re-install of 103 packages. Once this was done, I could boot Ubuntu normally. The question I have is: What command could I have entered at the command prompt when booted which would have performed the same operation as the dpkg menu option?
This feature is provided by the friendly recovery menu, and in particular its dpkg plugin (which adds a menu entry titled “Repair broken packages”, translated appropriately in whatever language the user configured the system to use). This plugin uses two different approaches to repair broken packages: if dist-upgrader is available, it uses that to repair the system, by running env RELEASE_UPGRADER_NO_SCREEN=1 python3 /usr/lib/python3/dist-packages/DistUpgrade/dist-upgrade.py \ --partial --frontend DistUpgradeViewText \ --datadir /usr/share/ubuntu-release-upgrader otherwise, it runs dpkg --configure -a apt-get update apt-get install -f apt-get dist-upgrade To achieve the same effect as the menu selection, you should try the first command using dist-upgrader, and if that fails because it doesn’t exist, run the four commands starting with dpkg --configure -a. Note that both these options don’t just repair broken packages, they upgrade the system to the latest versions of the packages available in whatever release is installed. (This is necessary because repairing the broken packages might involve installing missing packages, and that can only be done using the current versions of the packages from the configured repositories.)
What command is run when the dpkg option is selected in recovery mode?
1,363,800,322,000
For some reason I'm getting a weird error when trying to install libpng12-0 from a .deb file. Command: dpkg -i libpng12-0_1.2.50-2+deb8u3_amd64.deb; apt-get install -f Error: Setting up apache2 (2.4.25-3+deb9u2) ... info: Executing deferred 'a2enconf apache2-doc' for package apache2-doc ERROR: Conf apache2-doc does not exist! dpkg: error processing package apache2 (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: apache2 E: Sub-process /usr/bin/dpkg returned an error code (1) apache2-doc is installed (checked with: apt policy apache2-doc) The .deb file I'm trying to install: https://packages.debian.org/jessie/amd64/libpng12-0/download
Purge and reinstall package, maybe the installation was corrupt. apt-get purge apache2-doc apt-get install apache2-doc dpkg -i libpng12-0_1.2.50-2+deb8u3_amd64.deb; apt-get install -f
ERROR: Conf apache2-doc does not exist! When installing libpng12-0
1,435,234,766,000
This question explains how to find out if a given Debian package has been installed, but it does not take into account "synonyms" when installing via apt-get. For instance, if I try apt-get install libncurses-dev, apt-get replies: Note, selecting 'libncurses5-dev' instead of 'libncurses-dev' And then it installs that package (libncurses5-dev), which is fine by me. But what if I want to make a script to detect if the package has already been installed? dpkg -s libncurses-dev replies that the package is not installed, which is indeed correct, since it's libncurses5-dev that was installed. But I'd like my script to detect that, in this case, it no longer needs to install libncurses-dev. I could not find an option in apt-get to check if the given package or one of its providers has already been installed, such that my script would work when checking for libncurses-dev as well as for libncurses5-dev.
If you want to write a script to check to see if package libncurses-dev or its alias has been installed, consider the following program flow: Check if the package has been installed with dpkg using the exact name, libncurses-dev in this case. If the above does not evaluate to true, then search apt for the package you are looking for using the non-aliased name: $ apt-cache search libncurses-dev libncurses5-dev - developer's libraries for ncurses It appears that apt-cache search will return the 'alias' if the package has one. If #1 evaluates false and #2 returns an alias, just grab the package's alias and try #1 again. Check dpkg again with the alias name of the package, in this case it would be libncurses5-dev. If dpkg does not find the package by an alias (actually a superseded package) then it must not be installed.
apt - checking if a similar package has been installed
1,435,234,766,000
I followed an online article to remove my Apache from my system. I removed Apache through these commands sudo apt-get purge apache2 apache2-utils sudo rm -rf /etc/apache2-bin sudo apt-get autoremove Then in the article they mentioned to remove the files and directories of the results of whereis apache2. After running the command whereis apache2 I found /usr/sbin/apache2/usr/share/apache2 /usr/lib/apache2 /usr/share/man/man8/apache2.8.gz /etc/apache2 I removed the above directories and files through command sudo rm -rf file_or_directory_name. Then I tried sudo apt-get install apache2 I clicked 'y' when the system asked do you want to continue?. Then the error came: Setting up apache2 (2.4.7-1ubuntu4.4) ... cp: cannot stat ‘/usr/share/apache2/default-site/index.html’: No such file or directory dpkg: error processing package apache2 (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: apache2 E: Sub-process /usr/bin/dpkg returned an error code (1) I tried sudo apt-get install apache2 again after running the sudo apt-get update command, but still got the same error results.
To recover /usr/share/apache2/default-site/index.html you need to re-install apache2-data. Given your current situation, try sudo apt-get purge apache2-data sudo apt-get install apache2 Presumably your system ended up in that state because apt-get autoremove didn't uninstall apache2-data, but your rm -rf removed the files it contained. Then apt-get install apache2 would reckon that apache2-data was still installed and didn't need to be re-installed, but its files were gone...
Error while installing Apache; error is "E: Sub-process /usr/bin/dpkg returned an error code (1)"
1,435,234,766,000
I am trying to remove fglrx-driver as part of an upgrade from wheezy to jessie. Running apt-get dist-upgrade failed with the following message: fglrx-driver ... dpkg: error processing fglrx-driver (--remove): subprocess installed post-removal script returned error exit status 20 Errors were encountered while processing: fglrx-driver E: Sub-process /usr/bin/dpkg returned an error code (1) I tried running sudo apt-get remove fglrx* but got the same message. How do I get around this? Do I need to somehow "unload" the driver? If so, how?
Deleted /etc/X11/xorg.conf, restarted in recovery mode and then it worked.
How do I remove a driver when apt-get remove fails?
1,435,234,766,000
I sometimes download .deb packages from the internet and install them with dpkg -i package.deb If the packages have unmet dependencies. How can I install the dependencies automatically (similar to apt-get install package, and mark these dependencies as installed automatically instead of manually.
The usual way to handle this is to just do #dpkg -i packagename and then resolve the dependencies after the event by doing #apt-get -f install If the dependencies cannot be satisfied, apt will normally remove the package for you. Of course, if it doesn't you can do so yourself. This procedure should not mark the packages as manually installed.
Install downloaded packages with dependencies
1,435,234,766,000
I am logged in as a user on an CentOS version 6.9 HPC. When I try the ls command, I get: /usr/local/bin/ls: line 96: dpkg: command not found Abort, this script is only intended for Ubuntu-like distros When I open the corresponding ls file, line 96 has the line: # (internal) The architecture of the local system arch=$(dpkg --print-architecture) I understand that dpkg is a Debian thing which is why it wouldn't work on CentOS. But why is the dpkg there in the first place. And how do I run a simple ls?
From the question text, it is evident that the ls command is picked up from the /usr/local/bin directory, which means that this directory is found earlier in the PATH variable's value than e.g. /usr/bin and /bin. Changing the ordering of the variable's value in your shell's startup files, possibly by prepend /bin and /usr/bin to it, should stop your shell from using ls from /usr/local/bin, assuming that there is an ls command in /bin or /usr/bin. PATH=/bin:/usr/bin:$PATH The reason why /usr/local/bin/ls is a shell script (possibly a copy of the Ubuntu-specific script found here, which, although not malware, is not at all related to the ls command in any way) is still a mystery, as is whether this anomality is limited to the ls executable or whether it extends to other files and directories under /usr/local.
CentOS ls uses dpkg
1,435,234,766,000
I'm trying to get a list of packages installed which come from my company's private apt repository. This works: #!/bin/bash fqdn=$1 for pkg in $(dpkg-query --show | awk '{print $1;}'); do if apt-cache showpkg $pkg | grep -q $fqdn; then echo $pkg fi done But running it on a system with ~3466 (dpkg -l | wc -l) packages installed takes 1m45.812s. That's an awful long time to display a "Scanning locally for installed packages" to my users. Is there a better way to do this? I tried replacing apt-cache showpkg with apt show to read the APT-Sources: line. This warns about apt's unstable CLI interface and takes 15m35.913s.
Don’t loop over the packages: dpkg -l | awk '/^ii/ { print $2 }' | xargs apt-cache showpkg | awk "/^Package:/ { package = \$2 } /$1/ { print package }" | uniq This takes a couple of seconds on my system, with over 6,000 installed packages, and doesn’t involve using /var/lib/apt directly. There are a few limitations, notably that it doesn’t check which version is currently installed v. which one are available from the repositories, and also that Debian doesn’t provide any way to determine which repository a package was actually installed from.
apt: Query installed packages from a specific source
1,435,234,766,000
I have found that using sudo apt install ./<package_name_here>.deb fails with E: Failed to fetch file:<path_to_package>/<package_name_here>.deb File not found - <path_to_package>/<package_name_here>.deb (13: Permission denied) when a containing directory of ./<package_name_here>.deb has permissions set to 700. However, there is no issue when using sudo dpkg -i ./<package_name_here>.deb Is this a bug of apt or am I doing something wrong? lubuntu 20.04 apt 2.0.2 (amd64) dpkg 1.19.7 (amd64)
Since version 1.1, apt uses an unprivileged user (_apt) to download packages. This includes local package retrieval, unless (in theory) the package isn’t world-readable; there have been bugs with this in the past (see #805069), this could be a variant... You can disable this by setting APT::Sandbox::User to root: apt -o APT::Sandbox::User=root ...
Why are directory permissions preventing "sudo apt install" using a file?
1,435,234,766,000
I am looking to automate some package installations via bash script; they will be installed to a pre-existing chroot'd filesystem. Some of the packages however involve interactive user input (i.e. ddclient asks to select a dynamic DNS service provider), which I haven't been able to automate as easily. debconf preseeding seems to be the most common way to automate interactive package installations, but all the examples I've read imply that it's for an entire Debian installation rather than just individual packages. I've been following this How to automate interactive Debian package installations but it doesn't really explain the specifics. Thanks in advance!
Short of using a “proper” deployment and configuration management tool such as Ansible or Salt, debconf preseeding can be perfectly sufficient for pre-configuring Debian packages. It’s not at all limited to full blown installations; it can be applied to any number of packages. The simplest way to get started with it is to manually configure the packages you want to install, by installing the package and answering the questions. Then run debconf-get-selections (from the debconf-utils package); that will list all the settings that are stored, including those for the packages you just installed, along with the question text in comments — so you can easily find the questions you want to preseed. The format is <package> <debconf key> <type> <value> For example # System's default paper size: # Choices: letter, a4, note, legal, executive, halfletter, halfexecutive, 11x17, statement, folio, quarto, 10x14, ledger, tabloid, a0, a1, a2, a3, a5, a6, a7, a8, a9, a10, b0, b1, b2, b3, b4, b5, c5, DL, Comm10, Monarch, archE, archD, archC, archB, archA, flsa, flse, csheet, dsheet, esheet libpaper1 libpaper/defaultpaper select a4 Store the settings you want to preseed in a file, then run debconf-set-selections (in the debconf package) on the target system, either with the file available locally and named as the first argument, or its contents piped: cat preseed-file | ssh remotehost debconf-set-selections Do this before installing the packages on the target system.
Automating the installation of individual debian 8 packages with interactive prompts
1,435,234,766,000
I have a fresh install of Raspbian on a raspberry pi 3. It boots fine, and I am able to perform any function that I can think of with one exception: any attempt to install or remove a package results in the error "Files list file for package 'qdbus' is missing final newline". Indeed the file at /var/lib/dpkg/info/qdbus.list is full of garbage. What I tried so far: Adding a newline to the file. $sudo apt-get clean - did nothing. Delete qdbus.list - a different file is indicated as corrupted, I got as far as deleting about 25 files before things like ssh stopped working and I had to re-install the OS. Reinstall the OS from a fresh, hash-checked download of the latest version $sudo dpkg --configure -a - did nothing. Any help would be appreciated.
I have encountered same problem. And I solved this by downgrading raspbian jessie. http://downloads.raspberrypi.org/raspbian/images/raspbian-2017-06-23/ Remove your current version probably raspbian-2017-07-05/ and downgrade to raspbian-2017-06-23/. It will require a lot more time to update and upgrade packages but works fine for me.
Files list file for package 'qdbus' is missing final newline (Raspbian)
1,435,234,766,000
I want to install openssh-server on my server, but it shows me : apt-get install openssh-server Reading package lists... Done Building dependency tree Reading state information... Done openssh-server is already the newest version. You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: upstart : Depends: ifupdown (>= 0.6.10ubuntu5) E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). when I try to apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following packages were automatically installed and are no longer required: python-numpy python-gobject-2 python-gobject-dev libpython2.7 docbook-xml docbook-xsl python-dev libgirepository-1.0-1 liblapack3gf libffi-dev libquadmath0 libffi5 python-gi libssl-dev python2.6-dev libglade2-0 libblas3gf gir1.2-glib-2.0 python-gobject sgml-data libgfortran3 python2.7-dev Use 'apt-get autoremove' to remove them. The following extra packages will be installed: ifupdown Suggested packages: ppp rdnssd The following packages will be upgraded: ifupdown 1 upgraded, 0 newly installed, 0 to remove and 325 not upgraded. 9 not fully installed or removed. Need to get 0 B/48.3 kB of archives. After this operation, 43.0 kB disk space will be freed. Do you want to continue [Y/n]? y y Reading changelogs... Done debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline dpkg: dependency problems prevent configuration of plymouth: plymouth depends on upstart-job; however: Package upstart-job is not installed. Package upstart which provides upstart-job is not configured yet. plymouth depends on udev (>= 166-0ubuntu4); however: Package udev is not configured yet. dpkg: error processing plymouth (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of mountall: mountall depends on udev; however: Package udev is not configured yet. mountall depends on plymouth; however: Package plymouth is not configured yet. dpkg: error processing mountall (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of initscripts: initscripts depends on upstart; however: Package upstart is not configured yet. initscripts depends on mountall (>= 2.28); however: Package mountall is not configured yet. dpkg: error processing initscripts (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: plymouth mountall initscripts E: Sub-process /usr/bin/dpkg returned an error code (1) so I tried to install deb files with dpkg -i --force-overwrite but again shows me error. lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 6.0.10 (squeeze) Release: 6.0.10 Codename: squeeze apt-cache policy Package files: 100 /var/lib/dpkg/status release a=now 500 http://ftp.debian.org/debian/ jessie-backports/main Translation-en 100 http://ftp.debian.org/debian/ jessie-backports/main i386 Packages release o=Debian Backports,a=jessie-backports,n=jessie-backports,l=Debian Backports,c=main origin ftp.debian.org 100 http://ftp.debian.org/debian/ jessie-backports/main amd64 Packages release o=Debian Backports,a=jessie-backports,n=jessie-backports,l=Debian Backports,c=main origin ftp.debian.org 500 http://deb.debian.org/debian-security/ stable/updates/main Translation-en 500 http://deb.debian.org/debian-security/ stable/updates/main i386 Packages release v=8,o=Debian,a=stable,n=jessie,l=Debian-Security,c=main origin deb.debian.org 500 http://deb.debian.org/debian-security/ stable/updates/main amd64 Packages release v=8,o=Debian,a=stable,n=jessie,l=Debian-Security,c=main origin deb.debian.org 500 http://deb.debian.org/debian/ stable-updates/non-free Translation-en 500 http://deb.debian.org/debian/ stable-updates/main Translation-en 500 http://deb.debian.org/debian/ stable-updates/contrib Translation-en 500 http://deb.debian.org/debian/ stable-updates/non-free i386 Packages release o=Debian,a=stable-updates,n=jessie-updates,l=Debian,c=non-free origin deb.debian.org 500 http://deb.debian.org/debian/ stable-updates/contrib i386 Packages release o=Debian,a=stable-updates,n=jessie-updates,l=Debian,c=contrib origin deb.debian.org 500 http://deb.debian.org/debian/ stable-updates/main i386 Packages release o=Debian,a=stable-updates,n=jessie-updates,l=Debian,c=main origin deb.debian.org 500 http://deb.debian.org/debian/ stable-updates/non-free amd64 Packages release o=Debian,a=stable-updates,n=jessie-updates,l=Debian,c=non-free origin deb.debian.org 500 http://deb.debian.org/debian/ stable-updates/contrib amd64 Packages release o=Debian,a=stable-updates,n=jessie-updates,l=Debian,c=contrib origin deb.debian.org 500 http://deb.debian.org/debian/ stable-updates/main amd64 Packages release o=Debian,a=stable-updates,n=jessie-updates,l=Debian,c=main origin deb.debian.org 500 http://deb.debian.org/debian/ stable/non-free Translation-en 500 http://deb.debian.org/debian/ stable/main Translation-fr 500 http://deb.debian.org/debian/ stable/main Translation-en 500 http://deb.debian.org/debian/ stable/contrib Translation-en 500 http://deb.debian.org/debian/ stable/non-free i386 Packages release v=8.8,o=Debian,a=stable,n=jessie,l=Debian,c=non-free origin deb.debian.org 500 http://deb.debian.org/debian/ stable/contrib i386 Packages release v=8.8,o=Debian,a=stable,n=jessie,l=Debian,c=contrib origin deb.debian.org 500 http://deb.debian.org/debian/ stable/main i386 Packages release v=8.8,o=Debian,a=stable,n=jessie,l=Debian,c=main origin deb.debian.org 500 http://deb.debian.org/debian/ stable/non-free amd64 Packages release v=8.8,o=Debian,a=stable,n=jessie,l=Debian,c=non-free origin deb.debian.org 500 http://deb.debian.org/debian/ stable/contrib amd64 Packages release v=8.8,o=Debian,a=stable,n=jessie,l=Debian,c=contrib origin deb.debian.org 500 http://deb.debian.org/debian/ stable/main amd64 Packages release v=8.8,o=Debian,a=stable,n=jessie,l=Debian,c=main origin deb.debian.org Pinned packages: any idea ?
You may want to try purging the installation and cleaning up apt a bit. Try: sudo apt-get remove openssh-server openssh-client --purge && sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get update If you don't have any reason not to upgrade packages then also try: sudo apt-get dist-upgrade You can then try installing the packages again to see if this resolved the issue: sudo apt-get install openssh-server openssh-client Edit: Noticed that ubuntu is referenced in the error: upstart : Depends: ifupdown (>= 0.6.10ubuntu5) Check your sources.list file and sources.list.d directory files for any references to ubuntu. If there are comment them out and try the above commands again. If any ubuntu PPA's or ubuntu .deb packages are installed this could also cause issues.
How to install openssh-server on my server?
1,435,234,766,000
I want to script a test for a debian package being installed. Searching using dpkg-query, will return an error if no packages match. But if I want to detect that specifically, and abort on any other errors (e.g. resource exhaustion), I don't know how to do that.
dpkg-query is quite simple, you can quickly skim the manpage and find it has no option to implement this directly. So dpkg-query -W -f '${Package} ${State}\n' | grep "^my-package .* installed" The problem then reduces to catching error codes in a pipeline. Apparently strict error handling in Unix shell gets awkward. I was naively hoping for one-liners :). set -e function pkg_is_installed() { PKG="$1" LISTF=$(mktemp) dpkg-query -W -f '${Package} ${State}\n' >$LISTF grep "^${PKG} .* installed$" $LISTF >/dev/null GREP_RC=$? rm $LISTF # for even moar strict error handling test $GREP_RC == 0 -o $GREP_RC == 1 return $GREP_RC } I believe this will print any errors that occur to stderr, while avoiding printing a message when the only "error" is that dpkg hasn't (yet) seen the requested package.
Script a test for installed debian package - error handling?
1,435,234,766,000
[Reposted from askubuntu.com] I can't install any software. I think this dates from an unexpected power loss a few days ago. When I try sudo apt-get install gparted I see Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libpython2.7-minimal mime-support python2.7-minimal Use 'apt-get autoremove' to remove them. The following extra packages will be installed: busybox-initramfs cpio dmsetup fontconfig fontconfig-config fonts-dejavu-core initramfs-tools initramfs-tools-bin initscripts klibc-utils kmod libatk1.0-0 libatk1.0-data libatkmm-1.6-1 libavahi-client3 libavahi-common-data libavahi-common3 libcairo2 libcairomm-1.0-1 libcgmanager0 libcups2 libdatrie1 libdbus-1-3 libdevmapper1.02.1 libexpat1 libffi6 libfontconfig1 libfreetype6 libgcrypt11 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libglib2.0-0 libglibmm-2.4-1c2a libgnutls26 libgpg-error0 libgraphite2-3 libgssapi-krb5-2 libgtk2.0-0 libgtk2.0-common libgtkmm-2.4-1c2a libharfbuzz0b libjasper1 libjbig0 libjpeg-turbo8 libjpeg8 libk5crypto3 libkeyutils1 libklibc libkmod2 libkrb5-3 libkrb5support0 libncursesw5 libnih-dbus1 libnih1 libp11-kit0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpangomm-1.4-1 libparted0debian1 libpixman-1-0 libpng12-0 libprocps3 libsigc++-2.0-0c2a libtasn1-6 libthai-data libthai0 libtiff5 libudev1 libx11-6 libx11-data libxau6 libxcb-render0 libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxml2 libxrandr2 libxrender1 module-init-tools procps shared-mime-info ucf udev Suggested packages: libarchive1 xfsprogs reiserfsprogs reiser4progs jfsutils ntfs-3g dosfstools yelp kpartx dmraid gpart bash-completion cups-common rng-tools gnutls-bin krb5-doc krb5-user librsvg2-common gvfs libjasper-runtime ttf-baekmuk ttf-arphic-gbsn00lp ttf-arphic-bsmi00lp ttf-arphic-gkai00mp ttf-arphic-bkai00mp parted nparted libparted0-dev libparted0-i18n Recommended packages: psmisc dbus libglib2.0-data hicolor-icon-theme libgtk2.0-bin krb5-locales libgpm2 xml-core The following NEW packages will be installed busybox-initramfs cpio dmsetup fontconfig fontconfig-config fonts-dejavu-core gparted initramfs-tools initramfs-tools-bin initscripts klibc-utils kmod libatk1.0-0 libatk1.0-data libatkmm-1.6-1 libavahi-client3 libavahi-common-data libavahi-common3 libcairo2 libcairomm-1.0-1 libcgmanager0 libcups2 libdatrie1 libdbus-1-3 libdevmapper1.02.1 libexpat1 libffi6 libfontconfig1 libfreetype6 libgcrypt11 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libglib2.0-0 libglibmm-2.4-1c2a libgnutls26 libgpg-error0 libgraphite2-3 libgssapi-krb5-2 libgtk2.0-0 libgtk2.0-common libgtkmm-2.4-1c2a libharfbuzz0b libjasper1 libjbig0 libjpeg-turbo8 libjpeg8 libk5crypto3 libkeyutils1 libklibc libkmod2 libkrb5-3 libkrb5support0 libncursesw5 libnih-dbus1 libnih1 libp11-kit0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpangomm-1.4-1 libparted0debian1 libpixman-1-0 libpng12-0 libprocps3 libsigc++-2.0-0c2a libtasn1-6 libthai-data libthai0 libtiff5 libudev1 libx11-6 libx11-data libxau6 libxcb-render0 libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxml2 libxrandr2 libxrender1 module-init-tools procps shared-mime-info ucf udev 0 to upgrade, 92 to newly install, 0 to remove and 0 not to upgrade. 1 not fully installed or removed. Need to get 0 B/14.2 MB of archives. After this operation, 59.9 MB of additional disk space will be used. Do you want to continue? [Y/n] y Extract templates from packages: 100% Preconfiguring packages ... dpkg: error: duplicate file trigger interest for filename `/usr/lib/gio/modules' and package `libglib2.0-0' E: Sub-process /usr/bin/dpkg returned an error code (2) This is after trying several fixes, I have eliminated other errors which were occuring previously but I did not record them. I have tried the procedure in https://askubuntu.com/questions/134842/dpkg-error-duplicate-file-trigger-interest-for-filename-usr-lib-gio-modules but I don't know how to use sed (nor, really, what it is). The command suggested there is sed -n -e"s,/,\\\\\\\\/,g; s/:$(dpkg --print-architecture)$//p " \ /var/lib/dpkg/triggers/File \ | while read line; do sudo sed -i -e"/^$line$/d" /var/lib/dpkg/triggers/File done When I paste that block into the terminal, or run it as a separate script, I get no feedback; the terminal sends me straight back to the prompt instantly, and when I try again to install gparted, I get exactly the same messages as mentioned. I have tried to look directly at /usr/lib/gio/modules but I can't see /usr/lib/gio; it appears to not exist! I'm running Linux Mint 17.2 64-bit, uname -r gives 3.16.0-38-generic
It is a well-known problem, probably a dpkg or some installscript bug. /var/lib/dpkg/triggers/File contain a list of files and triggers (in the installscript) to use with. This file should be a simple text file, without any duplicated entries. Edit it with a text editor, and check. If there are duplicates, fix them (make a backup from this before that).
dpkg: error: duplicate file trigger interest for filename `/usr/lib/gio/modules' and package `libglib2.0-0'
1,435,234,766,000
I've deleted a file in /etc provided by package packageA. Is there a way that I can reinstall only that file, provided I know where it is and which package provides it? I'm running Ubuntu 12.04 and 14.04 on my servers.
First, you can find out which package provides the file: dpkg -S /path/to/file Then you can download the current version of the package. apt-get download package-name If for some reason you need the version of the package that you'd initially installed, you'll have to look it up in the APT logs in /var/log/apt/ or /var/log/dpkg.log* (if they haven't aged away). Once you've determined the version number, or the date, you can look for it on snapshot.debian.org (Debian) or Launchpad (Ubuntu). Once you've downloaded the .deb package, you can extract it into a temporary directory with dpkg-deb -x package_name-1.42.deb If you want to print out the content of just one file, you can use dpkg-deb --fsys-tarfile package_name-1.42.deb | tar xO ./path/to/file You can copy the content into place, but beware that some files need to have specific permissions. To extract a file with the right permissions, you'll need to extract it as root. You can use dpkg-deb -x and then copy the file: # as root dpkg-deb -x package_name-1.42.deb cp -p path/to/file /path/to/file Or you can extract the tarball (replace sudo by su or whatever method you use to gain root): dpkg-deb --fsys-tarfile package_name-1.42.deb | sudo tar x -C / ./path/to/file Alternatively, you can reinstall the whole package. If the file is a conffile (i.e. if it's marked as a configuration file to be preserved on upgrades), you'll need instruct dpkg to restore the modified or missing file. It's a little easier to deal with a missing conffile, because you may want to preserve modifications to other conffiles. So if the file is a conffile that you've modified the file and want to restore to its pristine state, rename your version first so that the conffile doesn't exist. Then run dpkg -i --force-confmiss package_name-1.42.deb You can use apt-get to download and reinstall the package in one go. If you want to restore a conffile, instruct apt-get to pass the extra option to dpkg. apt-get --reinstall -o 'DPkg::options="--force-confmiss"' install package_name To avoid this and other difficulties in the future, install etckeeper (apt-get install etckeeper), edit /etc/etckeeper/etckeeper.conf to select your favorite supported version control system, and run etckeeper init. Modifications in /etc will be saved in version control. Run etckeeper commit with a meaningful log message when you change configuration files. Then, if you want to undo a modification in /etc, you can restore an old revision of the affected file.
Get package version of file
1,435,234,766,000
I would like to install .deb file via dpkg in Arch Linux. This .deb file needs many dependencies. I don't want to install dependencies one by one manually. How do I force dpkg to install all dependencies?
Unfortunately there's no way to have dpkg automatically install dependencies - it just doesn't support that. There are other tools on Debian/Ubuntu systems to do that (eg, apt-get, aptitude, gdebi) - are any of those available for Arch? If so, you'd be better off using one of those. Alternatively, if you have access to a Debian/Ubuntu system, you can get a list of dependencies there (using apt-cache depends <packagename) and then once you have them on your Arch system, use dpkg -i <packages> to install them in one step.
How to force `dpkg` to install dependencies [closed]
1,435,234,766,000
I'm building an embedded system based on debian 7, and I'd like to make the most out of busybox that comes with debian. The problem is default busybox build in debian seems quite minimal, for example it does not even include passwd. On the other hand I don't want to build busybox from busybox.net sources for stability and update issues. So how can I build and install a bigger busybox from debian source package?
If you need a .deb customized on the fly mkdir /tmp/bb cd /tmp/bb apt-get source busybox sudo apt-get build-dep busybox cd busybox-1.20.0/ fakeroot debian/rules build make -C debian/build/deb/ menuconfig # enable passwd fakeroot debian/rules binary but probably the best would be to add a custom package inside debian/control and the relative config under debian/config/pkg/ (I'm not using Debian 7 but guess it is similar) edit You can use fakeroot debian/rules debian/build/deb/.built and fakeroot debian/rules binary-arch_busybox to build the deb target only
How to custom build debian's busybox?
1,435,234,766,000
I'm doing unattended / non-interactive package installations via DEBIAN_FRONTEND=noninteractive apt-get install -y my_package This works as attended in most cases, but still gives me an interactive prompt if there is config file conflict, e.g. something like this: Configuration file '/etc/foo' ==> Modified (by you or by a script) since installation. ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation I know that I can choose the answer to this by passing a suitable dpkg option to apt-get via -o, e.g. DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Options::=--force-confdef install -y my_package However, the corresponding options offered by dpkg seem not to include a way to abort the installation upon a conflict, which is what I would need. How can I non-interactively install a package via apt-get and fail if a config conflict is encountered? The following would also be acceptable to me: Non-interactively check before calling apt-get whether there will be a conflict Keep the versions of the config files on disk (like --confold) but then exit with a non-zero exit code or having another way of detecting this afterwards.
I haven’t checked this in your scenario, but dpkg should abort if it needs to ask for information and can’t read from its standard input; so DEBIAN_FRONTEND=noninteractive apt-get install -y my_package < /dev/null should abort with an error if there’s a configuration file conflict. If that doesn’t work, you can always look for leftovers from conflicts: depending on your --conf options, dpkg will either leave the old version with a .dpkg-old suffix, or the new version with a .dpkg-new suffix. You can therefore look for new .dpkg-* files in /etc after an installation attempt to determine whether there were any conflicts.
Force non-interactive `apt-get install` to fail on config file conflict
1,435,234,766,000
I'm currently building a large project that contains sources written in few languages such as C,C++ & Python. I recently managed to (painfuly) handle autotools to make a proper install. Next step is to create .deb because our project is meant to run on debian stretch. I tried several ways to do this but i can't get it working whether the way. Tree .deb generated by checkinstall : unpack/ ├── etc │   └── nina │   ├── auto_blacklist.txt │   ├── blacklist.txt │   ├── conf │   ├── keywords.txt │   ├── rubbish_links.txt │   └── whitelist.txt └── usr ├── local │   ├── bin │   │   ├── geckodriver │   │   └── nina │   ├── lib │   │   └── python2.7 │   │   └── dist-packages │   │   ├── nina.py │   │   ├── nina_py_installed_files.txt │   │   ├── Uinput_wrapping_module-2.0.egg-info │   │   └── uinput_wrapping_module.so │   └── share │   └── man │   └── man1 │   └── nina.1.gz └── share └── doc └── nina ├── COPYING ├── doc │   ├── Doxyfile │   └── nina.1 ├── README └── README.md Tree .deb generated by debhelper (v9): unpack/ ├── etc │   └── nina │   ├── auto_blacklist.txt │   ├── blacklist.txt │   ├── conf │   ├── keywords.txt │   ├── rubbish_links.txt │   └── whitelist.txt └── usr ├── bin │   └── nina ├── lib │   └── python2.7 │   └── dist-packages │   └── nina.py └── share ├── doc │   └── nina │   ├── changelog.Debian.gz │   └── copyright └── man └── man1 └── nina.1.gz As you can see it's not quite the same (sic). I'm more or less understanding what checkinstall does : it runs make install commands and just get files outputs to place it where it's installing on MY machine. debhelper seems to be a way more proper tool here. (installing in /usr/lib and not /usr/local/lib, allow us to sign packages & so on.) and i'd prefer to use it but it's not working as expected to do. And on huge plus on debhelper way is that it's actually handling dependancies specified in debian/control and stuff. But checkinstall doesn't. What debhelper is not doing : Getting some binary (geckodriver) from internet source and placing it in /usr/bin installing an homemade python module Those actions are performed in my Makefile.am by overriding install-exec-local: (& respectively uninstall-local:) methods and executing some bash commands. --- So my question is : how could i keep best parts of those two packaging ways to made it "perfect" ?
Downloading things from the internet is something a Debian package build is not supposed to be doing. If you use some 'build in clean chroot' helper, it may not even be able to do so. However, plain dpkg-buildpackage should be able to do so. If your autotools build system does the right thing, then nothing should be needed; otherwise, you'll need to add the necessary commands to an override_dh_foo command (see 'man dh' on that). For Python modules, what you need to do is install the .py files from your build system, too, respecting $DESTDIR. If you do so, debhelper in dh mode should just DTRT. If none of that worked, please produce a minimal version of your package that exhibits the problem; otherwise this is very much a crystal ball problem.
Problems packing a .deb from autotools. (checkinstall, debhelper, ...)
1,435,234,766,000
When I'm trying to use apt-get install or upgrade I get that message! I tried this command sudo dpkg -C and got this results: The following packages are missing the list control file in the database, they need to be reinstalled: liba52-0.7.4 library for decoding ATSC A/52 streams dpkg: error: unable to check existence of `/var/lib/dpkg/info/network-manager-vpnc-gnome.list': Input/output error This is the results of this command: dmesg [ 3982.201148] ata1.00: failed command: READ FPDMA QUEUED [ 3982.201157] ata1.00: cmd 60/10:a0:00:6b:c5/00:00:18:00:00/40 tag 20 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 3982.201162] ata1.00: status: { DRDY ERR } [ 3982.201165] ata1.00: error: { UNC } [ 3982.205431] ata1.00: configured for UDMA/133 [ 3982.205450] sd 0:0:0:0: [sda] Unhandled sense code [ 3982.205455] sd 0:0:0:0: [sda] [ 3982.205458] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 3982.205461] sd 0:0:0:0: [sda] [ 3982.205464] Sense Key : Medium Error [current] [descriptor] [ 3982.205469] Descriptor sense data with sense descriptors (in hex): [ 3982.205472] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 3982.205485] 18 c5 6b 0a [ 3982.205492] sd 0:0:0:0: [sda] [ 3982.205495] Add. Sense: Unrecovered read error - auto reallocate failed [ 3982.205499] sd 0:0:0:0: [sda] CDB: [ 3982.205502] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 3982.205514] end_request: I/O error, dev sda, sector 415591178 [ 3982.205546] ata1: EH complete [ 3982.205596] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 3982.205609] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. [ 3984.800724] ata1.00: exception Emask 0x0 SAct 0x800000 SErr 0x0 action 0x0 [ 3984.800733] ata1.00: irq_stat 0x40000008 [ 3984.800739] ata1.00: failed command: READ FPDMA QUEUED [ 3984.800749] ata1.00: cmd 60/10:b8:00:6b:c5/00:00:18:00:00/40 tag 23 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 3984.800753] ata1.00: status: { DRDY ERR } [ 3984.800757] ata1.00: error: { UNC } [ 3984.803857] ata1.00: configured for UDMA/133 [ 3984.803882] sd 0:0:0:0: [sda] Unhandled sense code [ 3984.803886] sd 0:0:0:0: [sda] [ 3984.803890] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 3984.803893] sd 0:0:0:0: [sda] [ 3984.803896] Sense Key : Medium Error [current] [descriptor] [ 3984.803901] Descriptor sense data with sense descriptors (in hex): [ 3984.803904] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 3984.803917] 18 c5 6b 0a [ 3984.803924] sd 0:0:0:0: [sda] [ 3984.803927] Add. Sense: Unrecovered read error - auto reallocate failed [ 3984.803931] sd 0:0:0:0: [sda] CDB: [ 3984.803934] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 3984.803945] end_request: I/O error, dev sda, sector 415591178 [ 3984.803973] ata1: EH complete [ 3984.804040] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 3984.804058] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. [ 3987.434030] ata1.00: exception Emask 0x0 SAct 0x1000000 SErr 0x0 action 0x0 [ 3987.434038] ata1.00: irq_stat 0x40000008 [ 3987.434045] ata1.00: failed command: READ FPDMA QUEUED [ 3987.434055] ata1.00: cmd 60/10:c0:00:6b:c5/00:00:18:00:00/40 tag 24 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 3987.434059] ata1.00: status: { DRDY ERR } [ 3987.434063] ata1.00: error: { UNC } [ 3987.436514] ata1.00: configured for UDMA/133 [ 3987.436532] sd 0:0:0:0: [sda] Unhandled sense code [ 3987.436536] sd 0:0:0:0: [sda] [ 3987.436539] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 3987.436543] sd 0:0:0:0: [sda] [ 3987.436546] Sense Key : Medium Error [current] [descriptor] [ 3987.436551] Descriptor sense data with sense descriptors (in hex): [ 3987.436553] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 3987.436567] 18 c5 6b 0a [ 3987.436573] sd 0:0:0:0: [sda] [ 3987.436582] Add. Sense: Unrecovered read error - auto reallocate failed [ 3987.436586] sd 0:0:0:0: [sda] CDB: [ 3987.436588] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 3987.436600] end_request: I/O error, dev sda, sector 415591178 [ 3987.436627] ata1: EH complete [ 3987.436663] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 3987.436674] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. [ 4018.424628] ata1.00: exception Emask 0x0 SAct 0x8 SErr 0x0 action 0x0 [ 4018.424637] ata1.00: irq_stat 0x40000008 [ 4018.424643] ata1.00: failed command: READ FPDMA QUEUED [ 4018.424652] ata1.00: cmd 60/10:18:00:6b:c5/00:00:18:00:00/40 tag 3 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 4018.424657] ata1.00: status: { DRDY ERR } [ 4018.424660] ata1.00: error: { UNC } [ 4018.427241] ata1.00: configured for UDMA/133 [ 4018.427260] sd 0:0:0:0: [sda] Unhandled sense code [ 4018.427264] sd 0:0:0:0: [sda] [ 4018.427268] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 4018.427271] sd 0:0:0:0: [sda] [ 4018.427274] Sense Key : Medium Error [current] [descriptor] [ 4018.427279] Descriptor sense data with sense descriptors (in hex): [ 4018.427282] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 4018.427295] 18 c5 6b 0a [ 4018.427301] sd 0:0:0:0: [sda] [ 4018.427305] Add. Sense: Unrecovered read error - auto reallocate failed [ 4018.427309] sd 0:0:0:0: [sda] CDB: [ 4018.427312] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 4018.427324] end_request: I/O error, dev sda, sector 415591178 [ 4018.427356] ata1: EH complete [ 4018.427392] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 4018.427404] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. [ 4021.044847] ata1.00: exception Emask 0x0 SAct 0x10 SErr 0x0 action 0x0 [ 4021.044856] ata1.00: irq_stat 0x40000008 [ 4021.044863] ata1.00: failed command: READ FPDMA QUEUED [ 4021.044872] ata1.00: cmd 60/10:20:00:6b:c5/00:00:18:00:00/40 tag 4 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 4021.044877] ata1.00: status: { DRDY ERR } [ 4021.044880] ata1.00: error: { UNC } [ 4021.047478] ata1.00: configured for UDMA/133 [ 4021.047496] sd 0:0:0:0: [sda] Unhandled sense code [ 4021.047501] sd 0:0:0:0: [sda] [ 4021.047504] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 4021.047507] sd 0:0:0:0: [sda] [ 4021.047510] Sense Key : Medium Error [current] [descriptor] [ 4021.047518] Descriptor sense data with sense descriptors (in hex): [ 4021.047521] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 4021.047534] 18 c5 6b 0a [ 4021.047541] sd 0:0:0:0: [sda] [ 4021.047545] Add. Sense: Unrecovered read error - auto reallocate failed [ 4021.047549] sd 0:0:0:0: [sda] CDB: [ 4021.047551] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 4021.047563] end_request: I/O error, dev sda, sector 415591178 [ 4021.047591] ata1: EH complete [ 4021.047627] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 4021.047643] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. [ 4456.063628] ata1.00: exception Emask 0x0 SAct 0x4000 SErr 0x0 action 0x0 [ 4456.063637] ata1.00: irq_stat 0x40000008 [ 4456.063643] ata1.00: failed command: READ FPDMA QUEUED [ 4456.063656] ata1.00: cmd 60/10:70:00:6b:c5/00:00:18:00:00/40 tag 14 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 4456.063660] ata1.00: status: { DRDY ERR } [ 4456.063664] ata1.00: error: { UNC } [ 4456.066097] ata1.00: configured for UDMA/133 [ 4456.066114] sd 0:0:0:0: [sda] Unhandled sense code [ 4456.066118] sd 0:0:0:0: [sda] [ 4456.066121] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 4456.066124] sd 0:0:0:0: [sda] [ 4456.066127] Sense Key : Medium Error [current] [descriptor] [ 4456.066133] Descriptor sense data with sense descriptors (in hex): [ 4456.066135] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 4456.066148] 18 c5 6b 0a [ 4456.066155] sd 0:0:0:0: [sda] [ 4456.066158] Add. Sense: Unrecovered read error - auto reallocate failed [ 4456.066162] sd 0:0:0:0: [sda] CDB: [ 4456.066165] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 4456.066177] end_request: I/O error, dev sda, sector 415591178 [ 4456.066203] ata1: EH complete [ 4456.066241] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 4456.066252] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. [ 4458.620639] ata1.00: exception Emask 0x0 SAct 0x10000 SErr 0x0 action 0x0 [ 4458.620647] ata1.00: irq_stat 0x40000008 [ 4458.620653] ata1.00: failed command: READ FPDMA QUEUED [ 4458.620663] ata1.00: cmd 60/10:80:00:6b:c5/00:00:18:00:00/40 tag 16 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 4458.620667] ata1.00: status: { DRDY ERR } [ 4458.620671] ata1.00: error: { UNC } [ 4458.624534] ata1.00: configured for UDMA/133 [ 4458.624553] sd 0:0:0:0: [sda] Unhandled sense code [ 4458.624557] sd 0:0:0:0: [sda] [ 4458.624560] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 4458.624563] sd 0:0:0:0: [sda] [ 4458.624566] Sense Key : Medium Error [current] [descriptor] [ 4458.624571] Descriptor sense data with sense descriptors (in hex): [ 4458.624574] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 4458.624587] 18 c5 6b 0a [ 4458.624594] sd 0:0:0:0: [sda] [ 4458.624597] Add. Sense: Unrecovered read error - auto reallocate failed [ 4458.624601] sd 0:0:0:0: [sda] CDB: [ 4458.624604] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 4458.624616] end_request: I/O error, dev sda, sector 415591178 [ 4458.624644] ata1: EH complete [ 4458.624682] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 4458.624694] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. [ 4582.462663] ata1.00: exception Emask 0x0 SAct 0x2000 SErr 0x0 action 0x0 [ 4582.462671] ata1.00: irq_stat 0x40000008 [ 4582.462677] ata1.00: failed command: READ FPDMA QUEUED [ 4582.462695] ata1.00: cmd 60/10:68:00:6b:c5/00:00:18:00:00/40 tag 13 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 4582.462698] ata1.00: status: { DRDY ERR } [ 4582.462701] ata1.00: error: { UNC } [ 4582.465098] ata1.00: configured for UDMA/133 [ 4582.465111] sd 0:0:0:0: [sda] Unhandled sense code [ 4582.465114] sd 0:0:0:0: [sda] [ 4582.465116] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 4582.465119] sd 0:0:0:0: [sda] [ 4582.465121] Sense Key : Medium Error [current] [descriptor] [ 4582.465125] Descriptor sense data with sense descriptors (in hex): [ 4582.465127] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 4582.465137] 18 c5 6b 0a [ 4582.465142] sd 0:0:0:0: [sda] [ 4582.465145] Add. Sense: Unrecovered read error - auto reallocate failed [ 4582.465148] sd 0:0:0:0: [sda] CDB: [ 4582.465150] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 4582.465159] end_request: I/O error, dev sda, sector 415591178 [ 4582.465179] ata1: EH complete [ 4582.465226] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 4582.465234] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. [ 4758.761524] ata1.00: exception Emask 0x0 SAct 0x8000000 SErr 0x0 action 0x0 [ 4758.761532] ata1.00: irq_stat 0x40000008 [ 4758.761539] ata1.00: failed command: READ FPDMA QUEUED [ 4758.761549] ata1.00: cmd 60/10:d8:00:6b:c5/00:00:18:00:00/40 tag 27 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 4758.761553] ata1.00: status: { DRDY ERR } [ 4758.761557] ata1.00: error: { UNC } [ 4758.763977] ata1.00: configured for UDMA/133 [ 4758.763996] sd 0:0:0:0: [sda] Unhandled sense code [ 4758.764000] sd 0:0:0:0: [sda] [ 4758.764042] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 4758.764051] sd 0:0:0:0: [sda] [ 4758.764054] Sense Key : Medium Error [current] [descriptor] [ 4758.764060] Descriptor sense data with sense descriptors (in hex): [ 4758.764062] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 4758.764076] 18 c5 6b 0a [ 4758.764082] sd 0:0:0:0: [sda] [ 4758.764086] Add. Sense: Unrecovered read error - auto reallocate failed [ 4758.764090] sd 0:0:0:0: [sda] CDB: [ 4758.764093] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 4758.764105] end_request: I/O error, dev sda, sector 415591178 [ 4758.764133] ata1: EH complete [ 4758.764381] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 4758.764391] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. [ 4761.407790] ata1.00: exception Emask 0x0 SAct 0x8 SErr 0x0 action 0x0 [ 4761.407800] ata1.00: irq_stat 0x40000008 [ 4761.407806] ata1.00: failed command: READ FPDMA QUEUED [ 4761.407815] ata1.00: cmd 60/10:18:00:6b:c5/00:00:18:00:00/40 tag 3 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 4761.407820] ata1.00: status: { DRDY ERR } [ 4761.407823] ata1.00: error: { UNC } [ 4761.410215] ata1.00: configured for UDMA/133 [ 4761.410233] sd 0:0:0:0: [sda] Unhandled sense code [ 4761.410237] sd 0:0:0:0: [sda] [ 4761.410240] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 4761.410244] sd 0:0:0:0: [sda] [ 4761.410247] Sense Key : Medium Error [current] [descriptor] [ 4761.410252] Descriptor sense data with sense descriptors (in hex): [ 4761.410254] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 4761.410268] 18 c5 6b 0a [ 4761.410274] sd 0:0:0:0: [sda] [ 4761.410278] Add. Sense: Unrecovered read error - auto reallocate failed [ 4761.410282] sd 0:0:0:0: [sda] CDB: [ 4761.410285] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 4761.410297] end_request: I/O error, dev sda, sector 415591178 [ 4761.410322] ata1: EH complete [ 4761.410370] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 4761.410383] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. [ 4828.394331] ata1.00: exception Emask 0x0 SAct 0x4 SErr 0x0 action 0x0 [ 4828.394344] ata1.00: irq_stat 0x40000008 [ 4828.394350] ata1.00: failed command: READ FPDMA QUEUED [ 4828.394359] ata1.00: cmd 60/10:10:00:6b:c5/00:00:18:00:00/40 tag 2 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 4828.394364] ata1.00: status: { DRDY ERR } [ 4828.394368] ata1.00: error: { UNC } [ 4828.396963] ata1.00: configured for UDMA/133 [ 4828.396981] sd 0:0:0:0: [sda] Unhandled sense code [ 4828.396986] sd 0:0:0:0: [sda] [ 4828.396989] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 4828.396992] sd 0:0:0:0: [sda] [ 4828.396995] Sense Key : Medium Error [current] [descriptor] [ 4828.397000] Descriptor sense data with sense descriptors (in hex): [ 4828.397003] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 4828.397016] 18 c5 6b 0a [ 4828.397023] sd 0:0:0:0: [sda] [ 4828.397026] Add. Sense: Unrecovered read error - auto reallocate failed [ 4828.397030] sd 0:0:0:0: [sda] CDB: [ 4828.397033] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 4828.397045] end_request: I/O error, dev sda, sector 415591178 [ 4828.397075] ata1: EH complete [ 4828.397125] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 4828.397135] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. [ 4867.249634] ata1.00: exception Emask 0x0 SAct 0x40 SErr 0x0 action 0x0 [ 4867.249642] ata1.00: irq_stat 0x40000008 [ 4867.249651] ata1.00: failed command: READ FPDMA QUEUED [ 4867.249661] ata1.00: cmd 60/10:30:00:6b:c5/00:00:18:00:00/40 tag 6 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 4867.249666] ata1.00: status: { DRDY ERR } [ 4867.249669] ata1.00: error: { UNC } [ 4867.252373] ata1.00: configured for UDMA/133 [ 4867.252397] sd 0:0:0:0: [sda] Unhandled sense code [ 4867.252401] sd 0:0:0:0: [sda] [ 4867.252406] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 4867.252410] sd 0:0:0:0: [sda] [ 4867.252413] Sense Key : Medium Error [current] [descriptor] [ 4867.252418] Descriptor sense data with sense descriptors (in hex): [ 4867.252421] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 4867.252434] 18 c5 6b 0a [ 4867.252441] sd 0:0:0:0: [sda] [ 4867.252444] Add. Sense: Unrecovered read error - auto reallocate failed [ 4867.252448] sd 0:0:0:0: [sda] CDB: [ 4867.252451] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 4867.252464] end_request: I/O error, dev sda, sector 415591178 [ 4867.252490] ata1: EH complete [ 4867.252528] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 4867.252537] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. [ 4906.471548] ata1.00: exception Emask 0x0 SAct 0x20000000 SErr 0x0 action 0x0 [ 4906.471556] ata1.00: irq_stat 0x40000008 [ 4906.471563] ata1.00: failed command: READ FPDMA QUEUED [ 4906.471572] ata1.00: cmd 60/10:e8:00:6b:c5/00:00:18:00:00/40 tag 29 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 4906.471577] ata1.00: status: { DRDY ERR } [ 4906.471580] ata1.00: error: { UNC } [ 4906.474090] ata1.00: configured for UDMA/133 [ 4906.474112] sd 0:0:0:0: [sda] Unhandled sense code [ 4906.474116] sd 0:0:0:0: [sda] [ 4906.474119] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 4906.474123] sd 0:0:0:0: [sda] [ 4906.474126] Sense Key : Medium Error [current] [descriptor] [ 4906.474134] Descriptor sense data with sense descriptors (in hex): [ 4906.474137] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 4906.474150] 18 c5 6b 0a [ 4906.474157] sd 0:0:0:0: [sda] [ 4906.474161] Add. Sense: Unrecovered read error - auto reallocate failed [ 4906.474165] sd 0:0:0:0: [sda] CDB: [ 4906.474167] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 4906.474179] end_request: I/O error, dev sda, sector 415591178 [ 4906.474207] ata1: EH complete [ 4906.474252] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 4906.474261] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. [ 4970.648872] ata1.00: exception Emask 0x0 SAct 0x80000 SErr 0x0 action 0x0 [ 4970.648880] ata1.00: irq_stat 0x40000008 [ 4970.648887] ata1.00: failed command: READ FPDMA QUEUED [ 4970.648896] ata1.00: cmd 60/10:98:00:6b:c5/00:00:18:00:00/40 tag 19 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 4970.648901] ata1.00: status: { DRDY ERR } [ 4970.648904] ata1.00: error: { UNC } [ 4970.651990] ata1.00: configured for UDMA/133 [ 4970.652055] sd 0:0:0:0: [sda] Unhandled sense code [ 4970.652066] sd 0:0:0:0: [sda] [ 4970.652071] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 4970.652075] sd 0:0:0:0: [sda] [ 4970.652078] Sense Key : Medium Error [current] [descriptor] [ 4970.652083] Descriptor sense data with sense descriptors (in hex): [ 4970.652086] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 4970.652100] 18 c5 6b 0a [ 4970.652107] sd 0:0:0:0: [sda] [ 4970.652110] Add. Sense: Unrecovered read error - auto reallocate failed [ 4970.652114] sd 0:0:0:0: [sda] CDB: [ 4970.652117] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 4970.652129] end_request: I/O error, dev sda, sector 415591178 [ 4970.652158] ata1: EH complete [ 4970.652390] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 4970.652399] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. [ 4973.216988] ata1.00: exception Emask 0x0 SAct 0x800000 SErr 0x0 action 0x0 [ 4973.216996] ata1.00: irq_stat 0x40000008 [ 4973.217002] ata1.00: failed command: READ FPDMA QUEUED [ 4973.217012] ata1.00: cmd 60/10:b8:00:6b:c5/00:00:18:00:00/40 tag 23 ncq 8192 in res 41/40:00:0a:6b:c5/00:00:18:00:00/40 Emask 0x409 (media error) <F> [ 4973.217017] ata1.00: status: { DRDY ERR } [ 4973.217020] ata1.00: error: { UNC } [ 4973.221198] ata1.00: configured for UDMA/133 [ 4973.221216] sd 0:0:0:0: [sda] Unhandled sense code [ 4973.221221] sd 0:0:0:0: [sda] [ 4973.221224] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 4973.221227] sd 0:0:0:0: [sda] [ 4973.221230] Sense Key : Medium Error [current] [descriptor] [ 4973.221235] Descriptor sense data with sense descriptors (in hex): [ 4973.221238] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 4973.221251] 18 c5 6b 0a [ 4973.221257] sd 0:0:0:0: [sda] [ 4973.221261] Add. Sense: Unrecovered read error - auto reallocate failed [ 4973.221265] sd 0:0:0:0: [sda] CDB: [ 4973.221267] Read(10): 28 00 18 c5 6b 00 00 00 10 00 [ 4973.221279] end_request: I/O error, dev sda, sector 415591178 [ 4973.221307] ata1: EH complete [ 4973.221359] XFS (sda6): metadata I/O error: block 0x181300 ("xfs_trans_read_buf_map") error 5 numblks 16 [ 4973.221375] XFS (sda6): xfs_imap_to_bp: xfs_trans_read_buf() And for smartctl -A : bash: smartctl: command not found `
You've experienced (at least) a bad block on your disk. Unfortunately, it hit an XFS data structure, so you've lost some filesystem metadata. I hope you have backups. Check smartctl Hopefully you have smartctl installed (it needs to run as root, e.g., via sudo). If installed, it should give output like this: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000f 103 098 006 Pre-fail Always - 212688305 3 Spin_Up_Time 0x0003 094 094 000 Pre-fail Always - 0 4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 76 5 Reallocated_Sector_Ct 0x0033 002 002 036 Pre-fail Always FAILING_NOW 4015 7 Seek_Error_Rate 0x000f 084 060 030 Pre-fail Always - 291678490 9 Power_On_Hours 0x0032 052 052 000 Old_age Always - 42540 10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 39 183 Runtime_Bad_Block 0x0032 098 098 000 Old_age Always - 2 184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0 187 Reported_Uncorrect 0x0032 018 018 000 Old_age Always - 82 188 Command_Timeout 0x0032 100 097 000 Old_age Always - 25770393781 189 High_Fly_Writes 0x003a 084 084 000 Old_age Always - 16 190 Airflow_Temperature_Cel 0x0022 061 061 045 Old_age Always - 39 (Min/Max 38/39) 194 Temperature_Celsius 0x0022 039 040 000 Old_age Always - 39 (0 16 0 0 0) 195 Hardware_ECC_Recovered 0x001a 034 013 000 Old_age Always - 212688305 197 Current_Pending_Sector 0x0012 100 099 000 Old_age Always - 0 198 Offline_Uncorrectable 0x0010 100 099 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0 240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 42617 (160 246 0) 241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 3791056483 242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 1003117143 The exact attributes shown vary from disk to disk, but most all of them have a 197 and/or 198 telling you how many un-repaired bad sectors the disk knows about. In the above output, you can see #5 is FAILING_NOW, and it's type is Pre-fail. That means the disk firmware expects the disk to fail within 24 hours. If you have any failed attributes, especially pre-fail ones, I'd replace the disk (and if its still under warranty, you should be able to RMA it). If you do not have smartctl If you don't have smartctl, now is not the time to install it. Critical next step If you have any important files on the machine disk—especially ones that haven't already been backed up—attempt to copy them to a different disk, USB flash drive, network share, etc. Your filesystem has been damaged, and it's possible this is your last chance to do so easily. Use a live system to run smartctl, xfs_repair If you don't have smartctl installed, you can reboot (after copying off important data!) into a live system (from CD, USB stick, etc.) and run smartctl from there. You can also use xfs_repair from the live system to attempt filesystem repair. (Please read the manpage for xfs_repair first; I confess to not having much experience with XFS). Note that disks made in the last decade or two have spare sectors and will use on of them to replace the bad sector the next time it's written to. smartctl -A will normally have attributes showing how many times this has been done. After filesystem repair If there were important files you couldn't grab before, you can now try again. Depending on bad the damage was (how many files you lost, and which ones), you'll need to either re-install a few packages (using dpkg -i or apt-get install --reinstall) or, if it was bad, re-install the OS. Of course, if you have a recent full-system backup, probably easiest to restore from backup. How to prevent this in the future Using two disks (in a mdraid RAID1 mirror) allows the kernel to deal with bad blocks by reading the sector from the other disk. It then writes the correct data back, allowing the disk to use a spare sector. You can also run RAID1 between two partitions on the same disk, which will half your available space but protect against bad sectors (but not against the disk failing entirely). Some filesystems (e.g., btrfs with "duplicate" mode) can keep two copies of their metadata or your data, also protecting against bad sectors.
How fix E: Sub-process /usr/bin/dpkg returned an error code (2)?
1,435,234,766,000
Sometimes it seems useful to shift package's directories around between tmpfs / flash memory or ssd / hard disk. To manage flash lifetime, disk spin-up, or just free space. If you replace a directory used by a package with a symlink, will the package manager not become confused at times? E.g. consider debsums... Would bind-mounts would hide it better instead?
dpkg is apparently intended to support this. On the other hand, I believe systemd generally does not consider supporting symlinks like this. E.g. I am now seeing a warning on boot, when /var/log is a symlink: systemd-tmpfiles[432]: "/var/log" already exists and is not a directory. This is due to /usr/lib/tmpfiles.d/var.conf. As I understand it, this is set up as part of a concept that you can somehow boot /usr and have the rest of the system state initialized automatically. E.g. that if you simply wipe /etc and reboot, the system would be restored to system default settings. Another caveat - in case you're migrating from nested bind mounts. Make sure to take care of dependencies. At boot time mounts are normally ordered automatically, which is great. But it doesn't seem to magically work out, if mounts are depending on each other through symlinks instead of directly. (I believe this mounting at boot time was done by systemd). Possible reasons for wanting to use symlinks were dpkg won't be able to handle them gracefully, e.g. if a directory is changed on upgrade. They're treated as separate by fatrace, so it is harder to monitor writes to individual devices. (Technically this is not exactly the fault of fatrace; it is more a quirk of the kernel interface it uses). They're not great in df. And icinga's disk-space monitoring will alarm if the bind-mounted directory is not world-readable. If you try to bind-mount parts of a tmpfs, you're going down a rabbit-hole; you'll need a custom shell script which creates the directories first.
Use symlink to move directory created by .deb package - will anything break?
1,435,234,766,000
I have been running a rolling release distro for a couple of years now and switched from LXDE to GNOME to KDE over the years. As you can imagine over the time a lot of configuration files have been touched and lately the system has just gotten a bunch of small hiccups. GTK themes that have been configured years ago but aren't present any more/don't contain all elements. Configuration for the starting of certain daemons (ssh-askpass) that stopped working, etc... Instead of doing a full re-install (which I hate), I would much rather re-install every package on the system with their default configuration files. So I am looking for a dpkg or apt command that overwrites whatever configuration files might be present with the configuration files from the package. Or do you think that is a bad idea? I know that I will have to reconfigure certain things (network-manager, etc...) but I hope that it will still be much less work than a complete re-install. Thanks
You should take a look at apt-get install --reinstalland specify --force-confmiss as option - but this only reinstalls missing config files. apt-get --purge before will remove those config files. Explained here: https://askubuntu.com/a/67028/329633 and here: http://www.microkwen.com/2008/09/16/force-apt-get-to-reinstall-config-files/ and here: http://blog.mx17.net/2014/02/14/restore-etc-configuration-file-original-maintainer-version-debian/ EDIT: For user-specific configuration files and so-called dotfiles and -folders in /home the comment from @terdon is much better practice. Basically the ame applies for distro upgrades and fresh installations, or when your desktop or major applications suddenly fail - create a new user, test with it and then migrate your settings in batches (or get to know which can be safely copied over and which are conflicting, with experience you should know which are safe and which are not. Documentation what settings you customize based on a default installation help a lot in making up such a list.) Also configuration files/folders should never be deleted, renaming/moving them away is totally sufficient and also allows later for diagnosis and comparisons, or for incorporation of old settings into fresh configurations or new user accounts.
Restore original configuration for every package in system
1,435,234,766,000
I'm connected via SSH to a PC running Linux kernel 3.11.1: root@alix:~# uname -r 3.11.1 how can I find out which package installed this specific file or kernel version respectively? I tried root@alix:/boot# dpkg -S vmlinuz-3.11.1 dpkg-query: no path found matching pattern *vmlinuz-3.11.1* Other installed kernel versions can be found with dpkg -S: root@alix:/boot# dpkg -S vmlinuz-3.2.23 linux-image-3.2.23-ath5kmod: /boot/vmlinuz-3.2.23-ath5kmod My purpose: I would like to install the corresponding Linux headers for version 3.11.1 to compile a kernel module for it. apt-cache search linux-headers lists 15 different header versions but not that one for 3.11.1. Thank you very much.
You can list every installed package with dpkg -l and filter through the results with grep for the kernel packages dpkg -l | grep 'linux-image' dpkg -l | grep 'linux-image' | grep '3.11' To find the kernel headers package for your running kernel: apt-cache search linux-headers-`uname -r`
Debian: get package name for installed file
1,435,234,766,000
I have to remove all packages installed on a specific day. My solution is to look up the file /var/log/dpkg.log, find out the entry with the right date, extract the names of the packages and remove them. Can I be sure sure that, in this way, I will find all desired packages? Is there another way to do it, in a more secure/formal way?
/var/log/apt/history.log is usually better to use for multiple reasons for this, one is that it logs whether a package was installed automatically to satisfy dependencies or not. Say upgrades are installed on the same day and some of them have new dependencies. If you try to remove those, apt will recommend removing the upgraded packages too. You can always remove automatic dependencies of the removed packages after with apt-get autoremove. One downside of /var/log/apt/history.log is that it only logs packages installed via apt (command line or package manager), not those installed directly with dpkg. Another is that the log is horrific to parse: date=2014-02-26 awk '$1=="Start-Date:" && $2=="'"$date"'" && got_date="yes" {} got_date=="yes" && $1=="Install:" && got_date="no" { for(i=2; i<=NF; i++) { if( $i !~ /,|\)/ && $(i+2) !~ /^automatic\)/ ) print $i } }' \ /var/log/apt/history.log | xargs sudo apt-get -s remove Remove the -s from apt-get when you are sure you have what you want. Date format might vary with locale, so check your log to see. Also, apt-get autremove will not remove packages if another package suggests/recommends them (eg package is installed as a dependency, but kept due to a suggestion). Here is the command to get everything, beware this may remove more than you bargained for (for me this it actually wants to remove my desktop environment!): date=2014-02-26 awk '$1=="Start-Date:" && $2=="'"$date"'" && got_date="yes" {} got_date=="yes" && $1=="Install:" && got_date="no" { for(i=2; i<=NF; i++) { if( $i !~ /,|\)/ ) print $i } }' \ /var/log/apt/history.log | xargs sudo apt-get -s remove Again remove -s when happy.
debian: remove all packages installed on a specific day
1,435,234,766,000
For various reasons, I have a package on my Debian system which cannot configure itself properly. I know why and I don't want to correct the problem right now. However, I want to avoid apt trying to configure it each time I install an unrelated package (for at least 20 seconds). To do so, I would like to flag this package as being configured, even if it is not. That is, make apt believe that it is configured. How can I do that? Some context: if you must know, my mysql database is corrupted. I will fix that later, but I did upgrade my mysql-server package in the meanwhile, and since that time, as the configuring script cannot succeed to launch the db-server, it fails, making apt painful to use.
The easiest thing to do is let it configure it, but alter the configuration script to do nothing. When dpkg "configures" a package, what is really doing is executing the post installation script for the package. To force the configuration to succeed, you can alter the post installation script to make it a no-op script. The maintainer scripts are stored in /var/lib/dpkg/info. For your example, you can replace /var/lib/dpkg/info/mysql-server-5.5.postinst with the following: #!/bin/sh exit 0 Or you can simply add an exit 0 to the existing script.
Flag a package as being configured on Debian even if it's not
1,435,234,766,000
I've been trying to figure out package management in debian a little better. I figured out that you can list all the packages on your system by using the "apt-cache pkgnames" command: root@t500:/etc# apt-cache pkgnames | less aspell-ca libglobus-rls-client5 rkhunter libmpich-shmem1.0gf meep libspring-webmvc-portlet-2.5-java libindicate-doc libjetty-extra-java python-decoratortools tree-ppuzzle darkice cutter-testing-framework-bin aspell-bg libsmpeg0 libpng12-dev However, when I try to look up additional information about the packages in dpkg, the same package names are not listed: root@t500:/etc# dpkg-query -W meep No packages found matching meep. root@t500:/etc# dpkg-query -W darkice No packages found matching darkice. I had assumed that apt and dpkg they would at least utilize the same package names, is that not the case? Is there a way of figuring out what the dpkg name of an apt package is?
It's the same name, apt is just a frontend to dpkg. The issue here is that the commands don't do what you thing they do. As explained in man apt-cache: pkgnames [prefix] This command prints the name of each package APT knows. The optional argument is a prefix match to filter the name list. The output is suitable for use in a shell tab complete function and the output is generated extremely quickly. This command is best used with the --generate option. Note that a package which APT knows of is not necessarily available to download, installable or installed, e.g. virtual packages are also listed in the generated list. So, apt-cache pkgnames lists all packages available to the system, irrespective of whether those packages are installed or not. If you want to list installed packages only, you could use dpkg -l or dpkg-query -l: -l, --list [package-name-pattern...] List packages matching given pattern. If no package-name-pattern is given, list all packages in /var/lib/dpkg/status, excluding the ones marked as not-installed (i.e. those which have been previously purged). This means that it will also list those packages that have been removed if their configuration files are still present, i.e. if they were not purged. The second column of the dpkg-query -l output is the package status which can be any of Package status: n = Not-installed c = Config-files H = Half-installed U = Unpacked F = Half-configured W = Triggers-awaiting t = Triggers-pending i = Installed So, to find those packages that are currently installed, you will want to select those whose status is i. To do that, simply grep for lines whose 1st character is anything and whose second is i: dpkg-query -l | grep '^.i' You can easily check that the two commands are different and that apt-cache returns thousands more results than dpkg. For example, on my system: $ dpkg-query -l | grep '^.i' | wc -l 3938 $ apt-cache pkgnames | wc -l 39889
Naming conventions / translation between dpkg and apt packages?
1,435,234,766,000
When ever I updated packages, (they update) I receive the following message about TeXLive: dpkg: warning: parsing file '/var/lib/dpkg/status' near line 2888 package 'texlive-local': missing maintainer This doesn't mess up the packages downloading or upgrading. I would like to have this stop though. How can I do this?
The package texlive-local is malformed. The Maintainer field in packages is mandatory, even though it is not used for any technical reason — it's more of a social requirement to give some tracability to all packages. The lack of this field does not cause any problem, but it's something that shouldn't happen, so dpkg is warning you. All official packages do have that field. The warning message would go away if you removed the texlive-local package or if you upgraded to a version with a Maintainer field. I recommend that you recommend to the maintainer of that package to add a Maintainer field with their email address. It goes into debian/control in the source tree. In the meantime, you can get rid of the warning by editing the package database and adding that field manually. Edit /var/lib/dpkg/status, search for a line containing exactly Package: texlive-local, and add a line containing Maintainer: [email protected] just below (the address should be syntactically well-formed, but it doesn't have to be valid if you would prefer not to put somebody's name in there).
Ubuntu 12.04: updating package message
1,435,234,766,000
Suppose I have a debian package housing as follows: project_pkg/ .git project_0.0-1/ debian/ install ... project (git submodule with tagged commit) With the following install file: // .../debian/install #!/usr/bin/env bash find $(pwd)/project/path/to/binaries -type f -executable -printf "$(pwd)/project/path/to/binaries/%f usr/bin\n" And where the project has a make entrypoint such that make -C project build for example produces all the necessary files I would need to package. The make/build component of the entire packaging process works right now. However, ideally, I find all the necessary files I need to install from the install folder. I have a solution for now, which would involve copying the binaries in the project to the debian/tmp/ from either outside /debian or from /debian/rules. But I could just as easily set the dh_install to fetch the files from the project, if there was some way to do so.. A) Is there a way to get dh_install to fetch files from the project, B) Is simply running two find commands and copying the binaries to the debian/tmp dir the way to go? C) Should I just hack it and prefix the printf in the install find command with ../..
dh_install takes paths relative to the current directory, which is generally the top-level directory of the package. In your case that’s project_0.0-1, so your find invocations should output project/path/to/.... Yes, that would work too. I know I recommended dh_install, but the first rule of debhelper remains that it’s a tool at your service, and if you find it’s easier to skip it, you might as well do so: override_dh_install: install -d debian/package/usr/bin find project/path/to/binaries -type f -executable -exec install -t debian/package/usr/bin {} + \; I don’t think that would work. (In most cases I’d expect your main build to be capable of installing binaries to a given target, but that’s another discussion.)
Dpkg dh_install: copy files from the build directory rather than the debian/tmp dir?
1,435,234,766,000
Could dpkg, the Debian package manager, gain a noticeable performance improvement by using one of the AIO fsync() operations, instead of sync_file_range() + fsync()? The [proposed] fsync2() API is essentially identical to the existing AIO_FSYNC/AIO_FDSYNC API, except it's synchronous and that is what applications want to avoid. The only argument I've been presented with against [using] AIO_FSYNC is that "the implementation is just a workqueue", which is largely non-sensical because it is filesystem implementation independent but allows automatic kernel side parallelisation of all the fsync operations issued. This allows the filesystem(s) to then automatically optimise away unnecessary journal writes when completing concurrent fsync operations - XFS, ext4, etc already do this when user applications run fsync() concurrently from lots of processes/threads..... This simple implementation allows a simple "untar with aio fsync" workload (i.e."write many 4kB files and aio_fsync() in batches as we go, retiring completed fsync()s before we dispatch a new batch") workload on XFS to go from about 2000 files/s (synchronous write IO latency bound) to over 40,000 files/s (write iops bound on the back end storage). -- Dave Chinner The example workload has similarities with apt-get install or dpkg -i (partly depending on the size of files in the installed packages :-). dpkg must effectively fsync() all unpacked files, before it renames them into place. dpkg has been optimized using advice from Ted T'so. The optimization is to add calls to sync_file_range() at certain points. This system call does not provide the same guarantees as fsync(). Please read the documentation for sync_file_range() and notice the prominent warning :-). None of these operations writes out the file's metadata. Therefore, unless the application is strictly performing overwrites of already-instantiated disk blocks, there are no guarantees that the data will be available after a crash. dpkg triggers data writeback immediately after writing each file, using SYNC_FILE_RANGE_WRITE. It writes all the files for the package first. Then there is a second pass through the files, which waits for the data writeback using SYNC_FILE_RANGE_WAIT_BEFORE, calls fsync(), and finally renames the file into place. See commits: Disable usage of synchronous sync(2) by default Add new --force-unsafe-io to disable safe I/O operations on unpack On Linux initiate writeback of unpacked files ASAP On Linux finish writeback before fsync My hypothesis is that parallelising the fsync() operations instead could improve performance, by allowing more efficient batching of the metadata writes, particularly batching the associated barriers/disk cache flushes which are required to ensure on-disk metadata is consistent at all times. EDIT: It seems my hypothesis was too simple, at least when using the ext4 filesystem: The second series of sync_file_range() calls, with the operation SYNC_FILE_RANGE_WAIT_BEFORE, will block until the previously initiated writeback has completed. This basically ensures that the delayed allocation has been resolved; that is, the data blocks have been allocated and written, and the inode updated (in memory), but not necessarily pushed out to disk. The [fsync()] call will actually force the inode to disk. In the case of the ext4 file system, the first [fsync()] will actually push all of the inodes to disk, and all of the subsequent [fsync()] calls are in fact no-ops (assuming that files 'a', 'b', and 'c' are all on the same file system). But what it means is that it minimizes the number of (heavyweight) jbd2 commits to a minimum. It uses a linux-specific system call --- sync_file_range() --- but the result should be faster performance across the board for all file systems. So I don't consider this an ext4-specific hack, although it probably does makes things faster for ext4 more than any other file system. -- Ted T'so It might be that some other filesystem would benefit using AIO fsync() operations instead. bcachefs (under development) claims to isolate IO between different files much better than ext4. So that might be particularly interesting to test. It sounds as if ext4 might not be so well-optimized for a pure AIO fsync() pattern (I guess other filesystems could have the same constraint as well). If so, I suppose it would be possible to do all the same sync_file_range() calls first, then start off all the AIO fsync() operations as a second round, and finish up by renaming all the files into place as the fsync() operations complete. OLD: The first step in such an investigation should be measurement :-). It is possible to disable the fsync() part, using echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/force-unsafe-io. So far, I tried running apt-get install under strace -f -wc, in a Debian 9 container. E.g. installing the aptitude package using "unsafe io", there are only 495 synchronous fsync() calls. Whereas installing aptitude normally, there are 1011 fsync() calls. "unsafe io" also disabled the SYNC_FILE_RANGE_WAIT_BEFORE call, reducing the number of sync_file_range() calls from 1036 to 518. However, it was much less clear whether this reduced the average time taken. If it did, it does not seem to be by more than the random variation between runs. So far, I tested this on ext4 and XFS, on a mechanical HDD. apt-get says the total size of the 518 unpacked files was 21.7 MB (see output below). Regarding the 495 fsync() calls, which remained present even when requesting "unsafe io": On ext4, the strace output showed the time spent on the remaining fsync() calls as about 11 seconds. On XFS, the corresponding figure was about 7 seconds. In all cases, this was the majority of the time taken to install aptitude. So even if "unsafe io" is giving a small improvement for installing aptitude, it seems like you would need /var to be mounted on a significantly faster (lower latency) device than the rest of the system, before the difference would be really noticeable. But I am not interested in optimizing that niche case. Running under strace -f -y -e trace=fsync,rename showed that for the remaining fsync() calls, 2 of them were on /etc/ld.so.cache~, and 493 of them were to files inside /var/lib/dpkg/ i.e. the package database. 318 of the fsync() calls are under /var/lib/dpkg/updates/. These are increments to the dpkg database /var/lib/dpkg/status. The increments are rolled up into the main database ("checkpointed") at the end of the dpkg run. The following NEW packages will be installed: aptitude aptitude-common libboost-filesystem1.62.0 libboost-iostreams1.62.0 libboost-system1.62.0 libcgi-fast-perl libcgi-pm-perl libclass-accessor-perl libcwidget3v5 libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhttp-date-perl libhttp-message-perl libio-html-perl libio-string-perl liblwp-mediatypes-perl libparse-debianchangelog-perl libsigc++-2.0-0v5 libsqlite3-0 libsub-name-perl libtimedate-perl liburi-perl libxapian30 0 upgraded, 25 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/6000 kB of archives. After this operation, 21.7 MB of additional disk space will be used.
The question suggests this won't help on ext4 or XFS. I also tested with installing one much larger package (linux-image-4.9.0-9-amd64). It still seemed to take the same time, regardless of --force-unsafe-io. ext2 On ext2, --force-unsafe-io reduced the time to install linux-image from 50 seconds to 13 seconds. The kernel I ran the tests on was 5.0.17-200.fc29.x86_64, which uses CONFIG_EXT4_USE_FOR_EXT2. I tested ext2 using the userspace aio_fsync() implementation. However, the best improvement did not depend on using AIO fsync(). My improvement was actually due to a side-effect. I had changed dpkg to do all of the fsync() operations first, and then all of the rename() operations. Whereas the unpatched dpkg called rename() after each fsync(). I used AIO queue depths of up to 256. AIO fsync() with a queue depth of 1 was significantly slower than synchronous fsync() - it appears there was some overhead. The best improvement also required doing all the original SYNC_FILE_RANGE_WRITE operations first. The improved version installed linux-image in about 18 seconds. This order of operations is actually what Ted T'so originally suggested :-D. What happens is that on CONFIG_EXT4_USE_FOR_EXT2, fsync() also helpfully syncs the parent directory. You want to do all the file name manipulation first, so you can avoid multiple on-disk updates for each directory. I think this does not happen for the old CONFIG_EXT2 implementation, or for a normal ext4 filesystem. ext4: make fsync to sync parent dir in no-journal for real this time [...] This also includes ext2 default mode obviously. [...] https://elixir.bootlin.com/linux/v5.0.17/source/fs/ext4/fsync.c#L38 * If we're not journaling and this is a just-created file, we have to * sync our parent directory (if it was freshly created) since * otherwise it will only be written by writeback, leaving a huge * window during which a crash may lose the file. This may apply for * the parent directory's parent as well, and so on recursively, if * they are also freshly created. As before, replacing the fsync() stage with sync() appears to give disturbingly good performance, matching --force-unsafe-io :-). sync() or syncfs() seem to be very nice if you can get away with using them. btrfs When I started testing aio_fsync() on btrfs, I discovered that fsync() operations can cause rename() of the file to block, due to a recent data integrity fix. I decided I am not interested in btrfs. Why does rename() take longer when fsync() is called first?
Could AIO fsync improve dpkg performance?
1,435,234,766,000
The problem: Unable to install virtual box. I tried to install it using the following command: sudo apt install virtualbox Here is the outcome sudo: /etc/sudoers.d/README is world writable Reading package lists... Done Building dependency tree Reading state information... Done virtualbox is already the newest version (5.1.38-dfsg-0ubuntu1.16.04.1). 0 upgraded, 0 newly installed, 0 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] y Setting up virtualbox-ext-pack (5.1.38-0ubuntu1.16.04.1) ... removing old virtualbox extension packs virtualbox-ext-pack: downloading: http://download.virtualbox.org/virtualbox/5.1.38/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack The file will be downloaded into /usr/share/virtualbox-ext-pack License accepted. 0%... Progress state: NS_ERROR_FAILURE VBoxManage: error: Failed to install "/usr/share/virtualbox-ext-pack/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack" VBoxManage: error: The installer failed with exit code 1: VBoxExtPackHelperApp: error: World writable: '/usr' VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackManagerWrap, interface IExtPackManager VBoxManage: error: Context: "RTEXITCODE handleExtPack(HandlerArg*)" at line 1201 of file VBoxManageMisc.cpp Hash mismatch Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack: expected e93d87b0f5de50369baca0a48082236b947df5b922ffd0233c0fa92c1206defd, or wrong accept-license key, removing the file. dpkg: error processing package virtualbox-ext-pack (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: virtualbox-ext-pack E: Sub-process /usr/bin/dpkg returned an error code (1) Then I googled the solution and found similar problems: This topic provides the following solution sudo dpkg --configure -a sudo apt-get install -f Did NOT work. Here is the outcome. sudo: /etc/sudoers.d/README is world writable Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up virtualbox-ext-pack (5.1.38-0ubuntu1.16.04.1) ... removing old virtualbox extension packs virtualbox-ext-pack: downloading: http://download.virtualbox.org/virtualbox/5.1.38/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack The file will be downloaded into /usr/share/virtualbox-ext-pack License accepted. 0%... Progress state: NS_ERROR_FAILURE VBoxManage: error: Failed to install "/usr/share/virtualbox-ext-pack/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack" VBoxManage: error: The installer failed with exit code 1: VBoxExtPackHelperApp: error: World writable: '/usr' VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackManagerWrap, interface IExtPackManager VBoxManage: error: Context: "RTEXITCODE handleExtPack(HandlerArg*)" at line 1201 of file VBoxManageMisc.cpp Hash mismatch Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack: expected e93d87b0f5de50369baca0a48082236b947df5b922ffd0233c0fa92c1206defd, or wrong accept-license key, removing the file. dpkg: error processing package virtualbox-ext-pack (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: virtualbox-ext-pack E: Sub-process /usr/bin/dpkg returned an error code (1) This one offers the following solution: sudo dpkg --remove --force-remove-reinstreq virtualbox-ext-pack sudo apt-get update Did NOT work. Same outcome appears as I try to install virtualbox. Ths one provides another approach: sudo apt install virtualbox-ext-pack export http_proxy='http://proxyserveraddress:port' export https_proxy='https://proxyserveraddress:port' Did NOT work. Nothing changes. This link and This one offers following solution: sudo apt-get purge virtualbox sudo apt-get update sudo apt-get install virtualbox Did NOT work. Same error persists. Then I have seen this one which is offers a pretty extensive solution: # Oldfred's command list for cleaning and repairing #houseclean sudo apt-get autoclean # only removes files that cannot be downloaded anymore (obsolete) sudo apt-get clean #refresh sudo apt-get update #resync package index sudo apt-get upgrade #newest versions of all packages, update must be run first #would upgrade you to the latest kernel in the repositories #dist-upgrade is also able to remove existing packages if required sudo apt-get dist-upgrade # fix Broken packages -f sudo apt-get -f install sudo dpkg --configure -a # Remove lock # If you are absolutely sure you do not have another upgrade process running. # Locked dpkg - only if sure you are not running another update. sudo rm /var/lib/dpkg/lock sudo dpkg --configure -a # added zika's tip for problems with hash sum mismatch sudo rm /var/lib/apt/lists/* sudo apt-get update # added 2F4U's tips for Package Manager & Update Manager problems Does executing these commands help? cd /var/lib/apt sudo mv lists lists.old sudo mkdir -p lists/partial sudo apt-get update This will rebuild the cache. Starting from sudo apt-get dist-upgrade I get the following error: sudo: /etc/sudoers.d/README is world writable Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up virtualbox-ext-pack (5.1.38-0ubuntu1.16.04.1) ... removing old virtualbox extension packs virtualbox-ext-pack: downloading: http://download.virtualbox.org/virtualbox/5.1.38/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack The file will be downloaded into /usr/share/virtualbox-ext-pack License accepted. 0%... Progress state: NS_ERROR_FAILURE VBoxManage: error: Failed to install "/usr/share/virtualbox-ext-pack/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack" VBoxManage: error: The installer failed with exit code 1: VBoxExtPackHelperApp: error: World writable: '/usr' VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackManagerWrap, interface IExtPackManager VBoxManage: error: Context: "RTEXITCODE handleExtPack(HandlerArg*)" at line 1201 of file VBoxManageMisc.cpp Hash mismatch Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack: expected e93d87b0f5de50369baca0a48082236b947df5b922ffd0233c0fa92c1206defd, or wrong accept-license key, removing the file. dpkg: error processing package virtualbox-ext-pack (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: virtualbox-ext-pack E: Sub-process /usr/bin/dpkg returned an error code (1) Then I visited virtualbox page and followed the instructions for "Debian-based Linux distributions", more specifically: added deb https://download.virtualbox.org/virtualbox/debian <mydist> contrib to my /etc/apt/sources.list sudo apt-key add oracle_vbox_2016.asc sudo apt-get update -sudo apt-get install virtualbox-5.2 sudo: /etc/sudoers.d/README is world writable Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libgsoap8 libvncserver1 virtualbox-dkms Use 'sudo apt autoremove' to remove them. Recommended packages: libsdl-ttf2.0-0 The following packages will be REMOVED: virtualbox virtualbox-ext-pack virtualbox-qt The following NEW packages will be installed: virtualbox-5.2 0 upgraded, 1 newly installed, 3 to remove and 0 not upgraded. 1 not fully installed or removed. Need to get 73,7 MB of archives. After this operation, 87,3 MB of additional disk space will be used. This time I get a different error sudo: /etc/sudoers.d/README is world writable Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libgsoap8 libvncserver1 virtualbox-dkms Use 'sudo apt autoremove' to remove them. Recommended packages: libsdl-ttf2.0-0 The following packages will be REMOVED: virtualbox virtualbox-ext-pack virtualbox-qt The following NEW packages will be installed: virtualbox-5.2 0 upgraded, 1 newly installed, 3 to remove and 0 not upgraded. 1 not fully installed or removed. Need to get 73,7 MB of archives. After this operation, 87,3 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 https://download.virtualbox.org/virtualbox/debian xenial/contrib amd64 virtualbox-5.2 amd64 5.2.20-125813~Ubuntu~xenial [73,7 MB] Fetched 73,7 MB in 32s (2.245 kB/s) Preconfiguring packages ... (Reading database ... 330819 files and directories currently installed.) Removing virtualbox-ext-pack (5.1.38-0ubuntu1.16.04.1) ... 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Successfully uninstalled "Oracle VM VirtualBox Extension Pack". VBoxManage: error: The installer failed with exit code 1: VBoxExtPackHelperApp: error: World writable: '/usr' VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackManagerWrap, interface IExtPackManager, callee nsISupports VBoxManage: error: Context: "Cleanup()" at line 1251 of file VBoxManageMisc.cpp dpkg: error processing package virtualbox-ext-pack (--remove): subprocess installed pre-removal script returned error exit status 1 Removing virtualbox-qt (5.1.38-dfsg-0ubuntu1.16.04.1) ... dpkg: virtualbox: dependency problems, but removing anyway as you requested: virtualbox-ext-pack depends on virtualbox (<< 5.1.38-dfsg-z) | virtualbox-5.1; however: Package virtualbox is to be removed. Package virtualbox-5.1 which provides virtualbox is not installed. Package virtualbox-5.2 which provides virtualbox is not installed. Package virtualbox-5.1 is not installed. virtualbox-ext-pack depends on virtualbox (>= 5.1.38-dfsg-0~) | virtualbox-5.1; however: Package virtualbox is to be removed. Package virtualbox-5.1 which provides virtualbox is not installed. Package virtualbox-5.2 which provides virtualbox is not installed. Package virtualbox-5.1 is not installed. virtualbox-ext-pack depends on virtualbox (<< 5.1.38-dfsg-z) | virtualbox-5.1; however: Package virtualbox is to be removed. Package virtualbox-5.1 which provides virtualbox is not installed. Package virtualbox-5.2 which provides virtualbox is not installed. Package virtualbox-5.1 is not installed. virtualbox-ext-pack dep Removing virtualbox (5.1.38-dfsg-0ubuntu1.16.04.1) ... Processing triggers for man-db (2.7.5-1) ... Processing triggers for shared-mime-info (1.5-2ubuntu0.2) ... Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ... Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ... Processing triggers for mime-support (3.59ubuntu1) ... Processing triggers for hicolor-icon-theme (0.15-0ubuntu1.1) ... Errors were encountered while processing: virtualbox-ext-pack E: Sub-process /usr/bin/dpkg returned an error code (1) Finally, I downloaded the .deb file (for ubuntu 16.04 AMD64)from virtualbox page and executed sudo dpkg -i virtualbox-5.1_5.1.38-122592~Ubuntu~xenial_amd64.deb This results in the following: sudo: /etc/sudoers.d/README is world writable (Reading database ... 331301 files and directories currently installed.) Preparing to unpack virtualbox-5.1_5.1.38-122592~Ubuntu~xenial_amd64.deb ... Unpacking virtualbox-5.1 (5.1.38-122592~Ubuntu~xenial) over (5.1.38-122592~Ubuntu~xenial) ... Setting up virtualbox-5.1 (5.1.38-122592~Ubuntu~xenial) ... addgroup: The group `vboxusers' already exists as a system group. Exiting. Processing triggers for systemd (229-4ubuntu21.5) ... Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for hicolor-icon-theme (0.15-0ubuntu1.1) ... Processing triggers for shared-mime-info (1.5-2ubuntu0.2) ... Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ... Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ... Processing triggers for mime-support (3.59ubuntu1) ... but when I execute virtualbox I get the following error: VirtualBox: Error -610 in supR3HardenedMainInitRuntime! VirtualBox: dlopen("/usr/lib/virtualbox/VBoxRT.so",) failed: <NULL> VirtualBox: Tip! It may help to reinstall VirtualBox. So what else should I do to install virtual box and extension pack? Thanks to @GAD3R the problem has found. The problem is you have initially changed the permission of /usr and its sub-dir , your system become insucure , and the package connot be installed because of the write permission for "other" So I installed another ubuntu next to the troublesome one.
You recive this error : VirtualBox: Error -610 in supR3HardenedMainInitRuntime! VirtualBox: dlopen("/usr/lib/virtualbox/VBoxRT.so",) failed: <NULL> VirtualBox: Tip! It may help to reinstall VirtualBox. because the permission of the root partition is changed recursively to 777. Virtualbox set some restrictions for the file permission and ownership. Main.cpp : Hardening on UNIX-like OSes Check that all installed files and directories (both optional and mandatory ones) are owned by root:wheel and are not writable by anyone except root.
Virtualbox unable to install
1,418,657,498,000
I'm trying to list installed packages with custom format, dpkg-query -f '${Package}###${Version}\n' -W '*' But it also print those are removed. Is there any way to filter them out? I'm trying to avoid doing a grep -v '###$'
If you drop the package name pattern, dpkg-query will only list installed or configured packages: dpkg-query -f '${Package}###${Version}\n' -W This gives the same result as your putative grep.
dpkg-query show installed package only
1,418,657,498,000
I'm running Ubuntu 19.04. I recently needed to install a browser other than chromium or Firefox in order to play a flash video. I've now ended up with a much more complicated problem. Every time I try to do something with dpkg, I get an error code like: dpkg: error: dpkg frontend lock is locked by another process To try and fix this, I have tried commands such as: sudo dpkg -l | grep ^..r to figure out what the offending process is, but there's nothing there. I've also sudo rmed a bunch of folders like /var/lib/apt/lists/lock. No luck, and I have still not been able to install any packages. I cannot think of a reason behind this, except: I changed my sources.list file recently; and downloading the Chrome (the non-free) browser. I have no idea what the connection would be in either case though. Any ideas what I would be able to do to fix this?
When starting Ubuntu the autoupdate service will be executed automatically, that's why you received an error, the best practice is to let the auto-update complete this task. If you need to interrupt this task you can do: sudo pkill apt sudo pkill dpkg sudo dpkg --configure -a sudo apt update
What's wrong with my dpkg?
1,418,657,498,000
When I search for a list of packages, I usually use dpkg -l|grep string|cut -d" " -f3|xargs libdouble-conversion3:amd64 libestr0:amd64 libeval-closure-perl libio-stringy-perl libunistring2:amd64 liburi-perl libustr-1.0-1:amd64 libwind0-heimdal:amd64 libxstring-perl php-mbstring php7.0-mbstring php7.4-mbstring php8.2-mbstring is there a shorter way in bash to get this list?
dpkg-query allows formatting the output, when using -W instead of -l. E.g. dpkg-query -f='${binary:Package} ' -W 'pyth*' would list all binary packages starting with pyth and separate them by space, with their architecture when necessary. More details on possible formats in man dpkg-query. It might not necessarily be shorter, but you may define an alias based on it and hence just use the REGEX-query.
A shorter way to list all packages matching a string
1,418,657,498,000
After updating GNOME to 3.20.2 I had some problems with my touchpad so in that confusion I mistakenly deleted /usr/bin/touch and after that I even became more stupid and deleted /bin/touch. Now after this I can't seem to install any of the programs. Here's the error generated in installing a program.. user1@pqrx:~$ sudo apt-get install gir1.2-gtop-2.0 [sudo] password for user1: Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: gir1.2-gtop-2.0 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. Need to get 0 B/54.6 kB of archives. After this operation, 104 kB of additional disk space will be used. Selecting previously unselected package gir1.2-gtop-2.0:amd64. (Reading database ... 351267 files and directories currently installed.) Preparing to unpack .../gir1.2-gtop-2.0_2.34.0-1_amd64.deb ... Unpacking gir1.2-gtop-2.0:amd64 (2.34.0-1) ... Setting up gir1.2-gtop-2.0:amd64 (2.34.0-1) ... sh: 1: touch: not found update-kali-menu: error: Can't open /var/lock/kali-menu: No such file or directory E: Problem executing scripts DPkg::Post-Invoke '[ ! -x /usr/share/kali-menu/update-kali-menu ] || /usr/share/kali-menu/update-kali-menu wait_dpkg' E: Sub-process returned an error code Any help will be much appreciated.
I was very thankful for all the valuable time you guys spent answering my question and combining both the answers I found the best solution. IF you have messed up with the coreutils then the best thing to do is download the coreutils file from the repository. As we all know that .deb files are basically archive, open it with the file-roller and extract the package and replace the necessary files, set the required permissions and reboot. Its done.
Deleted /usr/bin/touch and /bin/touch. Can't seem to install anything now, nor create any files?
1,418,657,498,000
Sometimes I find myself installing a package and then trying to run a command using the same name, like with geoip-bin package: $ sudo apt install geoip-bin [...] $ geoip-bin geoip-bin: command not found How may I find all the commands associated with a given package?
dpkg -L -L, --listfiles package-name List files installed to your system from package-name. Two alternatives: Usually works just: dpkg -L byobu | egrep '/bin/|/sbin/' (or even with grep bin if you don't care getting some false positives). Or dpkg -L byobu | xargs which Or with some bash magic: for f in $(dpkg -L geoip-bin) ; do test -x $f -a ! -d $f && echo $f ; done Optionally you could add | grep "/usr/bin/" at the end to list executables files on that particular folder. geoiplookup was the command of geoip-bin. I also found this very useful to learn about other commands of any package.
How to find commands associated to a package? [duplicate]