package operation failed

Asked by brian porter

Get message 'package operation failed' when trying to update Ubuntu 24.04.1 LTS.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the full output of:

sudo apt update; df -h

Thanks

Revision history for this message
brian porter (briandjan-porter) said :
#2

Hit:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:2 http://gb.archive.ubuntu.com/ubuntu noble InRelease
Hit:3 http://gb.archive.ubuntu.com/ubuntu noble-updates InRelease
Hit:4 http://gb.archive.ubuntu.com/ubuntu noble-backports InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
8 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:97
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:97
W: Target Sources (universe/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:98
W: Target Sources (multiverse/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:99
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:71
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:71
W: Target Sources (universe/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:80
W: Target Sources (multiverse/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:88
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:75
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:75
W: Target Sources (universe/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:81
W: Target Sources (multiverse/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:89
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:71
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:71
W: Target Sources (universe/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:80
W: Target Sources (multiverse/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:88
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:75
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:75
W: Target Sources (universe/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:81
W: Target Sources (multiverse/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:89
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:97
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:97
W: Target Sources (universe/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:98
W: Target Sources (multiverse/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:99
df-h: command not found

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

1. There is a space character missing in the command, try again with
df -h

2. There seem to be some duplicates in your package management configuration.
What output do you receive for the command

cat -n /etc/apt/sources.list

Revision history for this message
brian porter (briandjan-porter) said :
#4

Hit:1 http://gb.archive.ubuntu.com/ubuntu noble InRelease
Hit:2 http://gb.archive.ubuntu.com/ubuntu noble-updates InRelease
Hit:3 http://gb.archive.ubuntu.com/ubuntu noble-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu noble-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
14 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:71
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:71
W: Target Sources (universe/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:80
W: Target Sources (multiverse/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:88
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:75
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:75
W: Target Sources (universe/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:81
W: Target Sources (multiverse/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:89
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:97
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:97
W: Target Sources (universe/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:98
W: Target Sources (multiverse/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:99
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:71
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:71
W: Target Sources (universe/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:80
W: Target Sources (multiverse/source/Sources) is configured multiple times in /etc/apt/sources.list:8 and /etc/apt/sources.list:88
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:75
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:75
W: Target Sources (universe/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:81
W: Target Sources (multiverse/source/Sources) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:89
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:97
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:97
W: Target Sources (universe/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:98
W: Target Sources (multiverse/source/Sources) is configured multiple times in /etc/apt/sources.list:38 and /etc/apt/sources.list:99
Filesystem Size Used Avail Use% Mounted on
tmpfs 377M 5.3M 372M 2% /run
/dev/sda1 455G 368G 64G 86% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 5.0M 8.0K 5.0M 1% /run/lock
tmpfs 377M 184K 377M 1% /run/user/1000
/dev/sdb1 15G 1.2G 14G 8% /media/brian/F09D-E7D9
brian@brian-HP-ProBook-450-G0:~/Desktop$ cat -n/etc/apt/sources.list
cat: invalid option -- '/'
Try 'cat --help' for more information.
brian@brian-HP-ProBook-450-G0:~/Desktop$ cat --help
Usage: cat [OPTION]... [FILE]...
Concatenate FILE(s) to standard output.

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

Please be more careful with the commands.
You skipped a space character also in the next command, please try again:

cat -n /etc/apt/sources.list

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

There is a space after "cat" and a space after "-n". If you copy and paste the command you are less likely to botch it

Revision history for this message
brian porter (briandjan-porter) said :
#7

brian@brian-HP-ProBook-450-G0:~/Desktop$ cat -n /etc/apt/sources.list
     1 # deb cdrom:[Ubuntu 14.04.3 LTS _Trusty Tahr_ - Beta amd64 (20150805)]/ trusty main restricted
     2 # deb cdrom:[Ubuntu 12.10 _Quantal Quetzal_ - Release i386 (20121017.2)]/ quantal main restricted
     3 # deb cdrom:[Ubuntu 12.10 _Quantal Quetzal_ - Release i386 (20121017.2)]/ quantal main restricted
     4
     5 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
     6 # newer versions of the distribution.
     7 deb http://gb.archive.ubuntu.com/ubuntu/ noble main restricted
     8 deb-src http://gb.archive.ubuntu.com/ubuntu/ noble restricted main multiverse universe #Added by software-properties
     9
    10 ## Major bug fix updates produced after the final release of the
    11 ## distribution.
    12 deb http://gb.archive.ubuntu.com/ubuntu/ noble-updates main restricted
    13 deb-src http://gb.archive.ubuntu.com/ubuntu/ noble-updates restricted main multiverse universe #Added by software-properties
    14
    15 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    16 ## team. Also, please note that software in universe WILL NOT receive any
    17 ## review or updates from the Ubuntu security team.
    18 deb http://gb.archive.ubuntu.com/ubuntu/ noble universe
    19 deb http://gb.archive.ubuntu.com/ubuntu/ noble-updates universe
    20
    21 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    22 ## team, and may not be under a free licence. Please satisfy yourself as to
    23 ## your rights to use the software. Also, please note that software in
    24 ## multiverse WILL NOT receive any review or updates from the Ubuntu
    25 ## security team.
    26 deb http://gb.archive.ubuntu.com/ubuntu/ noble multiverse
    27 deb http://gb.archive.ubuntu.com/ubuntu/ noble-updates multiverse
    28
    29 ## N.B. software from this repository may not have been tested as
    30 ## extensively as that contained in the main release, although it includes
    31 ## newer versions of some applications which may provide useful features.
    32 ## Also, please note that software in backports WILL NOT receive any review
    33 ## or updates from the Ubuntu security team.
    34 deb http://gb.archive.ubuntu.com/ubuntu/ noble-backports main restricted universe multiverse
    35 deb-src http://gb.archive.ubuntu.com/ubuntu/ noble-backports main restricted universe multiverse #Added by software-properties
    36
    37 deb http://security.ubuntu.com/ubuntu noble-security main restricted
    38 deb-src http://security.ubuntu.com/ubuntu noble-security restricted main multiverse universe #Added by software-properties
    39 deb http://security.ubuntu.com/ubuntu noble-security universe
    40 deb http://security.ubuntu.com/ubuntu noble-security multiverse
    41
    42
    43
    44 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
    45 # newer versions of the distribution.
    46
    47 ## Major bug fix updates produced after the final release of the
    48 ## distribution.
    49
    50 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    51 ## team. Also, please note that software in universe WILL NOT receive any
    52 ## review or updates from the Ubuntu security team.
    53
    54 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    55 ## team, and may not be under a free licence. Please satisfy yourself as to
    56 ## your rights to use the software. Also, please note that software in
    57 ## multiverse WILL NOT receive any review or updates from the Ubuntu
    58 ## security team.
    59
    60 ## N.B. software from this repository may not have been tested as
    61 ## extensively as that contained in the main release, although it includes
    62 ## newer versions of some applications which may provide useful features.
    63 ## Also, please note that software in backports WILL NOT receive any review
    64 ## or updates from the Ubuntu security team.
    65
    66
    67
    68
    69 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
    70 # newer versions of the distribution.
    71 deb-src http://gb.archive.ubuntu.com/ubuntu/ noble main restricted
    72
    73 ## Major bug fix updates produced after the final release of the
    74 ## distribution.
    75 deb-src http://gb.archive.ubuntu.com/ubuntu/ noble-updates main restricted
    76
    77 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    78 ## team. Also, please note that software in universe WILL NOT receive any
    79 ## review or updates from the Ubuntu security team.
    80 deb-src http://gb.archive.ubuntu.com/ubuntu/ noble universe
    81 deb-src http://gb.archive.ubuntu.com/ubuntu/ noble-updates universe
    82
    83 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    84 ## team, and may not be under a free licence. Please satisfy yourself as to
    85 ## your rights to use the software. Also, please note that software in
    86 ## multiverse WILL NOT receive any review or updates from the Ubuntu
    87 ## security team.
    88 deb-src http://gb.archive.ubuntu.com/ubuntu/ noble multiverse
    89 deb-src http://gb.archive.ubuntu.com/ubuntu/ noble-updates multiverse
    90
    91 ## N.B. software from this repository may not have been tested as
    92 ## extensively as that contained in the main release, although it includes
    93 ## newer versions of some applications which may provide useful features.
    94 ## Also, please note that software in backports WILL NOT receive any review
    95 ## or updates from the Ubuntu security team.
    96
    97 deb-src http://security.ubuntu.com/ubuntu noble-security main restricted
    98 deb-src http://security.ubuntu.com/ubuntu noble-security universe
    99 deb-src http://security.ubuntu.com/ubuntu noble-security multiverse
   100
   101

Revision history for this message
Manfred Hampl (m-hampl) said (last edit ):
#8

Open a terminal window and issue the command

sudo gnome-text-editor /etc/apt/sources.list

In the editor window that opens scroll down lo line 43 and delete everything from line 43 to the end of the file.

Then go back up to the start of the file and put a comment indicator (a # sign and a space character) in front of all lines that start with "deb-src", such that the lines 8, 13, 35 and 38 begin with
# deb-src

Then save the file and close the editor.

If you then run the command

sudo apt update

what output do you receive?

Can you help with this problem?

Provide an answer of your own, or ask brian porter for more information if necessary.

To post a message you must log in.