Could not perform immediate configuration on 'util-linux'
Messed up system, I guess.
I tried to do apt-get dist-upgrade -o APT::Immediate-Configure=0
but I got a dependency cycle error: E: Couldn't configure pre-depend multiarch-support for libnih-dbus1, probably a dependency cycle.
Then I tried to apt-get install -f libnih-dbus1
and got another error:
The following packages have unmet dependencies:
libc6-dev: Breaks: cmake (< 2.8.4+dfsg.1-5) but 2.8.1-4~lucid1 is to be installed
E: Broken packages`
Then I tried sudo apt-get install libc6-dev
which worked.
Then I did apt-get install util-linux -f -o APT::Immediate-Configure=0
which also worked fine.
So I think this problem is resolved now.
Related videos on Youtube
user2919681
Updated on September 18, 2022Comments
-
user2919681 almost 2 years
I have a quick question to you guys, i have created the CFG file which stores my database connection detail in two dimensional array. I then connect it to my PHP class file and make it launch the arrays stated in CFG file. As you can see below in my code:
cfg.php
<?php $cfg['db']['host'] = 'localhost'; $cfg['db']['user'] = 'root'; //your user name $cfg['db']['pass'] = ''; //your password $cfg['db']['db'] = 'db3'; //your database ?>
and my class file :
<?php require_once(dirname(__FILE__) . 'cfg.php'); class Database { private $dbConn; //stores the database connection public function __construct($dbConn) { global $cfg; mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die('Could not connect to MySQL server.'); mysql_select_db(DB_DATABASE)or die('Unable to select database: '); } }
What i want to ask you is: is this right way of doing this? also what do I need to add in my index to see that it is connected. and the output of the database content. Thank you in advance for taking time and reading my problem. Cheerio.
Edit :
<?php require_once(dirname(__FILE__) . 'cfg.php'); class Database { private $dbConn; //stores the database connection public function __construct($dbConn) { global $cfg; mysqli_connect($cfg['db']['host'], $cfg['db']['user'], $cfg['db']['pass']) or die('Could not connect to MySQL server.'); mysqli_select_db($dbConn, $cfg['db']['db']) or die('Unable to select database: '); } }
Does this looks better now? If yes. How do i connect it with the index.php file where my forms will be stored. say to output the message of (connected to database). Thank you.
EDIT: changed to mysqli and now when selecting the database it states that i am missing the database name. Not sure where to put that and how to alter it. Thank you.
EDIT: I am on my way to create functions for 'Select' 'Insert' and 'Delete' . If any of you can point me do a great source of information which will help me in my research it will be most appreciated.
-
nanofarad over 11 yearsMy answer doesn;t apply now. Honestly, I don't know what to do, so I deleted my answer.
-
Albert over 11 years@ObsessiveSSOℲ: It was still helpful, though, because of the
-O APT::Immediate-Configure=0
option. -
Royal Bg over 10 yearsYou are not using the array, but some constants? However, this is not the right way, even you would be using the array. Starting from using mysql_* and global variables is bad. On the other hand read about Dependency injection
-
zessx over 10 yearsPlease, stop using mysql_* functions in new code, they are officially deprecated. Instead of, have a look on prepared statements, and use Mysqli or PDO.
-
user2919681 over 10 years@zessx I have changed that, throws me an error (edited the main article) not sure of what to add. If you could throw some more advice. Thank you.
-
zessx over 10 years@user2919681 You now need to keep a trace of your connexion :
$con = mysqli_connect($host, $user, $pass); mysqli_select_db($con, $dbname);
-
zessx over 10 years@user2919681 Ya, I wrote a simplified version.
-
user2919681 over 10 years@zessex Is this what you mean?
global $cfg; mysqli_connect($cfg['db']['host'], $cfg['db']['user'], $cfg['db']['pass']) or die('Could not connect to MySQL server.'); mysqli_select_db($dbConn, $cfg['db']['db']) or die('Unable to select database: ');
-
user2919681 over 10 years@zessex I will also have to add the
Select
Delete
andInsert
functions. Any advice where to look for clues or more information, as you can tell i am not that bright in all of the PHP class communications and still will somehow have to out put this function in to the form version where user can use that. Any advice would be appreciated. Thanks in advance.
-
-
user2919681 over 10 yearsI see. Thank you for the advice although this were the tasks which i am doing (some self studies) not done any PHP before. Will read your links, but using this way i showed how can i check that the connection is there and the DB content can be shown?
-
chrki over 10 yearsWhen the connection fails the
mysql_connect()
function will return "FALSE", you can check it this way (analog to the example from the PHP docs):$link = mysql_connect($cfg['db']['host'], $cfg['db']['user'], $cfg['db']['pass']); if (!$link) { die('Could not connect: ' . mysql_error()); }
-- Thedie()
function here will end the script in case of failure, there are better ways to solve this when working with objects, you should try that later on. -
user2919681 over 10 yearsUnfortunately I have received strict task to use exactly that type of connection to cfg file which contains two dimensional array.
-
PeeHaa over 10 yearsWell the requirements (in this specific case) doesn't make much sense. You can include the config file in the bootstrap file if that makes you happy.